HACK: OMAP: DSS2: Fix OMAP2_DSS_USE_DSI_PLL
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 2 Mar 2011 08:06:48 +0000 (10:06 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 Mar 2011 13:46:29 +0000 (15:46 +0200)
When using OMAP2_DSS_USE_DSI_PLL, which selects DSI PLL as source clock
for DISPC, the DSI needs the vdds_dsi regulator. Latest regulator
changes broke this, causing the the code to not acquire the regulator
when using OMAP2_DSS_USE_DSI_PLL.

This patch acquires the vdds_dsi regulator in dsi_pll_init(), fixing the
issue. This is is just a quick hack to get the OMAP2_DSS_USE_DSI_PLL
option working. There shouldn't be any other downside in this solution
than some extra lines of code.

OMAP2_DSS_USE_DSI_PLL is itself a big hack, and should be removed, and
the feature itself should be implemented in a more sane way. However,
the solution is not trivial, and people are using DSI PLL to get more
exact pixel clocks, so this hack is an acceptable temporary solution for
the time being.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/dsi.c

index 44b667b55ab80162dec78e498ad4dc39428e997f..be7694ff7ca7de0f880ba838ffff49652b84a7de 100644 (file)
@@ -1119,6 +1119,26 @@ int dsi_pll_init(struct omap_dss_device *dssdev, bool enable_hsclk,
 
        DSSDBG("PLL init\n");
 
+#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
+       /*
+        * HACK: this is just a quick hack to get the USE_DSI_PLL
+        * option working. USE_DSI_PLL is itself a big hack, and
+        * should be removed.
+        */
+       if (dsi.vdds_dsi_reg == NULL) {
+               struct regulator *vdds_dsi;
+
+               vdds_dsi = regulator_get(&dsi.pdev->dev, "vdds_dsi");
+
+               if (IS_ERR(vdds_dsi)) {
+                       DSSERR("can't get VDDS_DSI regulator\n");
+                       return PTR_ERR(vdds_dsi);
+               }
+
+               dsi.vdds_dsi_reg = vdds_dsi;
+       }
+#endif
+
        enable_clocks(1);
        dsi_enable_pll_clock(1);