Skip to contentSkip to conversation

drm/exynos: enable FIMD clocks

PATCH New Vikas Sajjan 1 participant 1 message Apr 23, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 drm/exynos: enable FIMD clocks

Common Clock Framework introduced the need to prepare clocks before enabling them, otherwise clk_enable() fails. This patch adds clk_prepare_enable and clk_disable_unprepare() calls to the driver.
This patch also removes clk_disable() from fimd_remove() as it will be done by pm_runtime_put_sync.

---
Changes since v4:
- replaced clk_enable() and clk_disable() with clk_prepare_enable() and clk_disable_unprepare() in fimd_clock() and removed clk_disable() from fimd_remove() as dicussed at
http://lists.freedesktop.org/archives/dri-devel/2013-April/037727.html

Changes since v3:
- added clk_prepare() in fimd_probe() and clk_unprepare() in fimd_remove() as suggested by Viresh Kumar <[email protected]>

Changes since v2:
- moved clk_prepare_enable() and clk_disable_unprepare() from fimd_probe() to fimd_clock() as suggested by Inki Dae <[email protected]>

Changes since v1:
- added error checking for clk_prepare_enable() and also replaced clk_disable() with clk_disable_unprepare() during exit.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 -8
index 4073430..746b282 100644
@@ -801,18 +801,18 @@ static int fimd_clock(struct fimd_context *ctx, bool enable)
 	if (enable) {
 		int ret;
 
-		ret = clk_enable(ctx->bus_clk);
+		ret = clk_prepare_enable(ctx->bus_clk);
 		if (ret < 0)
 			return ret;
 
-		ret = clk_enable(ctx->lcd_clk);
+		ret = clk_prepare_enable(ctx->lcd_clk);
 		if  (ret < 0) {
-			clk_disable(ctx->bus_clk);
+			clk_disable_unprepare(ctx->bus_clk);
 			return ret;
 		}
 	} else {
-		clk_disable(ctx->lcd_clk);
-		clk_disable(ctx->bus_clk);
+		clk_disable_unprepare(ctx->lcd_clk);
+		clk_disable_unprepare(ctx->bus_clk);
 	}
 
 	return 0;
@@ -996,9 +996,6 @@ static int fimd_remove(struct platform_device *pdev)
 	if (ctx->suspended)
 		goto out;
 
-	clk_disable(ctx->lcd_clk);
-	clk_disable(ctx->bus_clk);
-
 	pm_runtime_set_suspended(dev);
 	pm_runtime_put_sync(dev);
 
Signature · 1 line
1.7.9.5