diff options
author | Rahul Sharma <rahul.sharma@samsung.com> | 2013-05-10 11:00:03 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2013-05-22 17:09:52 +0530 |
commit | b6dcf162a847a9c106f4989d6988f178d921f42b (patch) | |
tree | 5a900cb96cd16e616d8eb6ab952405b68e5177dd | |
parent | cf4550d1ec04d8811c91308418c83277660c59bd (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 | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 21dca0d0547..fa894c37231 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"); @@ -2006,19 +2012,22 @@ static int hdmi_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 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; @@ -2064,6 +2073,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; } @@ -2085,6 +2100,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; } |