diff options
author | Rahul Sharma <rahul.sharma@samsung.com> | 2013-05-10 11:00:03 +0530 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2013-05-20 23:28:42 +0400 |
commit | a288669f028b44fc1b76bbb3030f7de4c730e73f (patch) | |
tree | 0bf289036ae22da800a5921aac465a967009d4b8 | |
parent | f4b35fd2b303ca4ca176bff856275eaddfa5bcb2 (diff) |
drm/exynos: add clock_prepare/unprepare in hdmi driver
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index c4e30c03f29..edcdc58e7db 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1832,8 +1832,6 @@ static int hdmi_resources_init(struct hdmi_context *hdata) goto fail; } - clk_set_parent(res->sclk_hdmi, res->sclk_pixel); - res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) * sizeof(res->regul_bulk[0]), GFP_KERNEL); if (!res->regul_bulk) { @@ -1851,6 +1849,14 @@ static int hdmi_resources_init(struct hdmi_context *hdata) } res->regul_count = ARRAY_SIZE(supply); + clk_prepare(res->hdmi); + clk_prepare(res->sclk_hdmi); + clk_prepare(res->sclk_pixel); + clk_prepare(res->sclk_hdmiphy); + clk_prepare(res->hdmiphy); + + clk_set_parent(res->sclk_hdmi, res->sclk_pixel); + return 0; fail: DRM_ERROR("HDMI resource init - failed\n"); @@ -2007,23 +2013,27 @@ static int hdmi_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { DRM_ERROR("failed to find registers\n"); - return -ENOENT; + ret = -ENOENT; + goto err_clk_res; } hdata->regs = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(hdata->regs)) - return PTR_ERR(hdata->regs); + if (IS_ERR(hdata->regs)) { + ret = PTR_ERR(hdata->regs); + goto err_clk_res; + } ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD"); if (ret) { DRM_ERROR("failed to request HPD gpio\n"); - return ret; + goto err_clk_res; } /* DDC i2c driver */ if (i2c_add_driver(&ddc_driver)) { DRM_ERROR("failed to register ddc i2c driver\n"); - return -ENOENT; + ret = -ENOENT; + goto err_clk_res; } hdata->ddc_port = hdmi_ddc; @@ -2069,6 +2079,12 @@ err_hdmiphy: i2c_del_driver(&hdmiphy_driver); err_ddc: i2c_del_driver(&ddc_driver); +err_clk_res: + clk_unprepare(hdata->res.hdmi); + clk_unprepare(hdata->res.sclk_hdmi); + clk_unprepare(hdata->res.sclk_pixel); + clk_unprepare(hdata->res.sclk_hdmiphy); + clk_unprepare(hdata->res.hdmiphy); return ret; } @@ -2090,6 +2106,11 @@ static int hdmi_remove(struct platform_device *pdev) /* DDC i2c driver */ i2c_del_driver(&ddc_driver); + clk_unprepare(hdata->res.hdmi); + clk_unprepare(hdata->res.sclk_hdmi); + clk_unprepare(hdata->res.sclk_pixel); + clk_unprepare(hdata->res.sclk_hdmiphy); + clk_unprepare(hdata->res.hdmiphy); return 0; } |