diff options
author | Rahul Sharma <rahul.sharma@samsung.com> | 2013-05-10 10:53:43 +0530 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2013-07-17 22:47:28 +0400 |
commit | 0e365feecd1a925b3abaefe4e966359414a9cb05 (patch) | |
tree | 5e01abf13c4df10eccad0e5902eaea42e5b66ab9 /drivers | |
parent | 7d0399fef17104ab03d410d27fdf9c09a384926f (diff) |
drm/exynos: add clock_prepare/unprepare in mixer driver
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_mixer.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 7c197d3820c..65006db4ead 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -1082,6 +1082,9 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx, } mixer_res->irq = res->start; + clk_prepare(mixer_res->mixer); + clk_prepare(mixer_res->sclk_hdmi); + return 0; } @@ -1109,9 +1112,6 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx, return -ENODEV; } - if (mixer_res->sclk_hdmi) - clk_set_parent(mixer_res->sclk_mixer, mixer_res->sclk_hdmi); - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); if (res == NULL) { dev_err(dev, "get memory resource failed.\n"); @@ -1125,6 +1125,13 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx, return -ENXIO; } + clk_prepare(mixer_res->vp); + clk_prepare(mixer_res->sclk_mixer); + clk_prepare(mixer_res->sclk_dac); + + if (mixer_res->sclk_hdmi) + clk_set_parent(mixer_res->sclk_mixer, mixer_res->sclk_hdmi); + return 0; } @@ -1216,7 +1223,7 @@ static int mixer_probe(struct platform_device *pdev) ret = vp_resources_init(drm_hdmi_ctx, pdev); if (ret) { DRM_ERROR("vp_resources_init failed\n"); - goto fail; + goto out_vp; } } @@ -1230,7 +1237,9 @@ static int mixer_probe(struct platform_device *pdev) return 0; - +out_vp: + clk_unprepare(ctx->mixer_res.sclk_hdmi); + clk_unprepare(ctx->mixer_res.mixer); fail: dev_info(dev, "probe failed\n"); return ret; @@ -1238,10 +1247,23 @@ fail: static int mixer_remove(struct platform_device *pdev) { + struct exynos_drm_hdmi_context *drm_hdmi_ctx = + get_mixer_context(&pdev->dev); + struct mixer_context *ctx = drm_hdmi_ctx->ctx; + dev_info(&pdev->dev, "remove successful\n"); pm_runtime_disable(&pdev->dev); + clk_unprepare(ctx->mixer_res.mixer); + clk_unprepare(ctx->mixer_res.sclk_hdmi); + + if (ctx->vp_enabled) { + clk_unprepare(ctx->mixer_res.vp); + clk_unprepare(ctx->mixer_res.sclk_mixer); + clk_unprepare(ctx->mixer_res.sclk_dac); + } + return 0; } |