OMAP: DSS2: Remove FB_OMAP_BOOTLOADER_INIT support
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 2 Mar 2011 10:29:27 +0000 (12:29 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 Mar 2011 13:46:27 +0000 (15:46 +0200)
FB_OMAP_BOOTLOADER_INIT does not work, and it was only partially
implemented for SDI.

This patch removes support for FB_OMAP_BOOTLOADER_INIT to clean up the
code and to remove any assumptions that FB_OMAP_BOOTLOADER_INIT would
work.

Proper implementation is much more complex, requiring early boot time
register and clock handling to keep the DSS running.

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

index bcf69a462b5f578266adbe00ad395075bc124731..02db5f1269eede2f5997eda6fc8182191e995858 100644 (file)
@@ -166,7 +166,6 @@ static inline void dss_uninitialize_debugfs(void)
 static int omap_dss_probe(struct platform_device *pdev)
 {
        struct omap_dss_board_info *pdata = pdev->dev.platform_data;
-       int skip_init = 0;
        int r;
        int i;
 
@@ -210,13 +209,8 @@ static int omap_dss_probe(struct platform_device *pdev)
                goto err_venc;
        }
 
-#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
-       /* DISPC_CONTROL */
-       if (omap_readl(0x48050440) & 1) /* LCD enabled? */
-               skip_init = 1;
-#endif
        if (cpu_is_omap34xx()) {
-               r = sdi_init(skip_init);
+               r = sdi_init();
                if (r) {
                        DSSERR("Failed to initialize SDI\n");
                        goto err_sdi;
index 5c6805b3362d10ad2ec57a07469ea3652b822b39..4025a14c5bc120589eccff5daec5f2c7028a0a7c 100644 (file)
@@ -559,7 +559,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
        REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */
 }
 
-static int dss_init(bool skip_init)
+static int dss_init(void)
 {
        int r;
        u32 rev;
@@ -578,22 +578,20 @@ static int dss_init(bool skip_init)
                goto fail0;
        }
 
-       if (!skip_init) {
-               /* disable LCD and DIGIT output. This seems to fix the synclost
-                * problem that we get, if the bootloader starts the DSS and
-                * the kernel resets it */
-               omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
-
-               /* We need to wait here a bit, otherwise we sometimes start to
-                * get synclost errors, and after that only power cycle will
-                * restore DSS functionality. I have no idea why this happens.
-                * And we have to wait _before_ resetting the DSS, but after
-                * enabling clocks.
-                */
-               msleep(50);
-
-               _omap_dss_reset();
-       }
+       /* disable LCD and DIGIT output. This seems to fix the synclost
+        * problem that we get, if the bootloader starts the DSS and
+        * the kernel resets it */
+       omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
+
+       /* We need to wait here a bit, otherwise we sometimes start to
+        * get synclost errors, and after that only power cycle will
+        * restore DSS functionality. I have no idea why this happens.
+        * And we have to wait _before_ resetting the DSS, but after
+        * enabling clocks.
+        */
+       msleep(50);
+
+       _omap_dss_reset();
 
        /* autoidle */
        REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0);
@@ -954,7 +952,6 @@ void dss_debug_dump_clocks(struct seq_file *s)
 static int omap_dsshw_probe(struct platform_device *pdev)
 {
        int r;
-       int skip_init = 0;
 
        dss.pdev = pdev;
 
@@ -967,13 +964,7 @@ static int omap_dsshw_probe(struct platform_device *pdev)
        dss.ctx_id = dss_get_ctx_id();
        DSSDBG("initial ctx id %u\n", dss.ctx_id);
 
-#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
-       /* DISPC_CONTROL */
-       if (omap_readl(0x48050440) & 1) /* LCD enabled? */
-               skip_init = 1;
-#endif
-
-       r = dss_init(skip_init);
+       r = dss_init();
        if (r) {
                DSSERR("Failed to initialize DSS\n");
                goto err_dss;
index 20590fb53c91b6969d0572dad4206b50f4bfe8c1..069fcc72331c18a295f774ac0af7a39e7e0cb85c 100644 (file)
@@ -251,11 +251,11 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
 
 /* SDI */
 #ifdef CONFIG_OMAP2_DSS_SDI
-int sdi_init(bool skip_init);
+int sdi_init(void);
 void sdi_exit(void);
 int sdi_init_display(struct omap_dss_device *display);
 #else
-static inline int sdi_init(bool skip_init)
+static inline int sdi_init(void)
 {
        return 0;
 }
index 9f10a0d9e76099abdce5286fe60e66d9c1de02df..54a53e648180e1e31fe830777d2302056f33b2fc 100644 (file)
@@ -30,7 +30,6 @@
 #include "dss.h"
 
 static struct {
-       bool skip_init;
        bool update_enabled;
        struct regulator *vdds_sdi_reg;
 } sdi;
@@ -68,9 +67,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
        if (r)
                goto err1;
 
-       /* In case of skip_init sdi_init has already enabled the clocks */
-       if (!sdi.skip_init)
-               dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
+       dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 
        sdi_basic_init(dssdev);
 
@@ -80,14 +77,8 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
        dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
                        dssdev->panel.acbi, dssdev->panel.acb);
 
-       if (!sdi.skip_init) {
-               r = dss_calc_clock_div(1, t->pixel_clock * 1000,
-                               &dss_cinfo, &dispc_cinfo);
-       } else {
-               r = dss_get_clock_div(&dss_cinfo);
-               r = dispc_get_clock_div(dssdev->manager->id, &dispc_cinfo);
-       }
-
+       r = dss_calc_clock_div(1, t->pixel_clock * 1000,
+                       &dss_cinfo, &dispc_cinfo);
        if (r)
                goto err2;
 
@@ -116,18 +107,14 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
        if (r)
                goto err2;
 
-       if (!sdi.skip_init) {
-               dss_sdi_init(dssdev->phy.sdi.datapairs);
-               r = dss_sdi_enable();
-               if (r)
-                       goto err1;
-               mdelay(2);
-       }
+       dss_sdi_init(dssdev->phy.sdi.datapairs);
+       r = dss_sdi_enable();
+       if (r)
+               goto err1;
+       mdelay(2);
 
        dssdev->manager->enable(dssdev->manager);
 
-       sdi.skip_init = 0;
-
        return 0;
 err2:
        dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
@@ -173,17 +160,8 @@ int sdi_init_display(struct omap_dss_device *dssdev)
        return 0;
 }
 
-int sdi_init(bool skip_init)
+int sdi_init(void)
 {
-       /* we store this for first display enable, then clear it */
-       sdi.skip_init = skip_init;
-
-       /*
-        * Enable clocks already here, otherwise there would be a toggle
-        * of them until sdi_display_enable is called.
-        */
-       if (skip_init)
-               dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
        return 0;
 }