From 0722361a0921296c980cb9011dad42f56c929007 Mon Sep 17 00:00:00 2001
From: Sumit Semwal <sumit.semwal@ti.com>
Date: Tue, 1 Mar 2011 14:23:09 +0530
Subject: [PATCH] OMAP4:DSS2: add dss_dss_clk.
dss_dss_clk is a new clock needed in OMAP4 as an opt-clock.
Adding the same in dss clock handling.
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
---
drivers/video/omap2/dss/dss.c | 33 ++++++++++++++++++++++++++++++---
1 files changed, 30 insertions(+), 3 deletions(-)
@@ -67,6 +67,7 @@ static struct {
struct clk *dss_sys_clk;
struct clk *dss_tv_fck;
struct clk *dss_video_fck;
+ struct clk *dss_dss_clk;
unsigned num_clks_enabled;
unsigned long cache_req_pck;
@@ -706,6 +707,7 @@ static int dss_get_clocks(void)
dss.dss_sys_clk = NULL;
dss.dss_tv_fck = NULL;
dss.dss_video_fck = NULL;
+ dss.dss_dss_clk = NULL;
r = dss_get_clock(&dss.dss_ick, "ick");
if (r)
@@ -738,6 +740,12 @@ static int dss_get_clocks(void)
goto err;
}
+ if (pdata->opt_clock_available("dss_clk")) {
+ r = dss_get_clock(&dss.dss_dss_clk, "dss_clk");
+ if (r)
+ goto err;
+ }
+
return 0;
err:
@@ -751,7 +759,8 @@ err:
clk_put(dss.dss_tv_fck);
if (dss.dss_video_fck)
clk_put(dss.dss_video_fck);
-
+ if (dss.dss_dss_clk)
+ clk_put(dss.dss_dss_clk);
return r;
}
@@ -763,6 +772,8 @@ static void dss_put_clocks(void)
clk_put(dss.dss_tv_fck);
if (dss.dss_sys_clk)
clk_put(dss.dss_sys_clk);
+ if (dss.dss_dss_clk)
+ clk_put(dss.dss_dss_clk);
clk_put(dss.dss_fck);
clk_put(dss.dss_ick);
}
@@ -810,8 +821,16 @@ static void dss_clk_enable_no_ctx(enum dss_clock clks)
if (clks & DSS_CLK_ICK)
clk_enable(dss.dss_ick);
- if (clks & DSS_CLK_FCK)
+ /*
+ * XXX: tie dss_dss_clk to FCK - this will change with following
+ * pm_runtime patches. Needed for OMAP4 boot up due to stricter
+ * clock cutting in pm framework post 2.6.38-rc5.
+ */
+ if (clks & DSS_CLK_FCK) {
clk_enable(dss.dss_fck);
+ if (dss.dss_dss_clk)
+ clk_enable(dss.dss_dss_clk);
+ }
if ((clks & DSS_CLK_SYSCK) && dss.dss_sys_clk)
clk_enable(dss.dss_sys_clk);
if ((clks & DSS_CLK_TVFCK) && dss.dss_tv_fck)
@@ -838,8 +857,16 @@ static void dss_clk_disable_no_ctx(enum dss_clock clks)
if (clks & DSS_CLK_ICK)
clk_disable(dss.dss_ick);
- if (clks & DSS_CLK_FCK)
+ /*
+ * XXX: tie dss_dss_clk to FCK - this will change with following
+ * pm_runtime patches. Needed for OMAP4 boot up due to stricter
+ * clock cutting in pm framework post 2.6.38-rc5.
+ */
+ if (clks & DSS_CLK_FCK) {
clk_disable(dss.dss_fck);
+ if (dss.dss_dss_clk)
+ clk_disable(dss.dss_dss_clk);
+ }
if ((clks & DSS_CLK_SYSCK) && dss.dss_sys_clk)
clk_disable(dss.dss_sys_clk);
if ((clks & DSS_CLK_TVFCK) && dss.dss_tv_fck)
--
1.7.1