aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/omap2/dss/core.c8
-rw-r--r--drivers/video/omap2/dss/dss.c41
-rw-r--r--drivers/video/omap2/dss/dss.h4
-rw-r--r--drivers/video/omap2/dss/sdi.c40
4 files changed, 28 insertions, 65 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index bcf69a462b5f..02db5f1269ee 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -166,7 +166,6 @@ static inline void dss_uninitialize_debugfs(void)
166static int omap_dss_probe(struct platform_device *pdev) 166static int omap_dss_probe(struct platform_device *pdev)
167{ 167{
168 struct omap_dss_board_info *pdata = pdev->dev.platform_data; 168 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
169 int skip_init = 0;
170 int r; 169 int r;
171 int i; 170 int i;
172 171
@@ -210,13 +209,8 @@ static int omap_dss_probe(struct platform_device *pdev)
210 goto err_venc; 209 goto err_venc;
211 } 210 }
212 211
213#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
214 /* DISPC_CONTROL */
215 if (omap_readl(0x48050440) & 1) /* LCD enabled? */
216 skip_init = 1;
217#endif
218 if (cpu_is_omap34xx()) { 212 if (cpu_is_omap34xx()) {
219 r = sdi_init(skip_init); 213 r = sdi_init();
220 if (r) { 214 if (r) {
221 DSSERR("Failed to initialize SDI\n"); 215 DSSERR("Failed to initialize SDI\n");
222 goto err_sdi; 216 goto err_sdi;
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 5c6805b3362d..4025a14c5bc1 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -559,7 +559,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
559 REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */ 559 REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */
560} 560}
561 561
562static int dss_init(bool skip_init) 562static int dss_init(void)
563{ 563{
564 int r; 564 int r;
565 u32 rev; 565 u32 rev;
@@ -578,22 +578,20 @@ static int dss_init(bool skip_init)
578 goto fail0; 578 goto fail0;
579 } 579 }
580 580
581 if (!skip_init) { 581 /* disable LCD and DIGIT output. This seems to fix the synclost
582 /* disable LCD and DIGIT output. This seems to fix the synclost 582 * problem that we get, if the bootloader starts the DSS and
583 * problem that we get, if the bootloader starts the DSS and 583 * the kernel resets it */
584 * the kernel resets it */ 584 omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
585 omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440); 585
586 586 /* We need to wait here a bit, otherwise we sometimes start to
587 /* We need to wait here a bit, otherwise we sometimes start to 587 * get synclost errors, and after that only power cycle will
588 * get synclost errors, and after that only power cycle will 588 * restore DSS functionality. I have no idea why this happens.
589 * restore DSS functionality. I have no idea why this happens. 589 * And we have to wait _before_ resetting the DSS, but after
590 * And we have to wait _before_ resetting the DSS, but after 590 * enabling clocks.
591 * enabling clocks. 591 */
592 */ 592 msleep(50);
593 msleep(50); 593
594 594 _omap_dss_reset();
595 _omap_dss_reset();
596 }
597 595
598 /* autoidle */ 596 /* autoidle */
599 REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0); 597 REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0);
@@ -954,7 +952,6 @@ void dss_debug_dump_clocks(struct seq_file *s)
954static int omap_dsshw_probe(struct platform_device *pdev) 952static int omap_dsshw_probe(struct platform_device *pdev)
955{ 953{
956 int r; 954 int r;
957 int skip_init = 0;
958 955
959 dss.pdev = pdev; 956 dss.pdev = pdev;
960 957
@@ -967,13 +964,7 @@ static int omap_dsshw_probe(struct platform_device *pdev)
967 dss.ctx_id = dss_get_ctx_id(); 964 dss.ctx_id = dss_get_ctx_id();
968 DSSDBG("initial ctx id %u\n", dss.ctx_id); 965 DSSDBG("initial ctx id %u\n", dss.ctx_id);
969 966
970#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT 967 r = dss_init();
971 /* DISPC_CONTROL */
972 if (omap_readl(0x48050440) & 1) /* LCD enabled? */
973 skip_init = 1;
974#endif
975
976 r = dss_init(skip_init);
977 if (r) { 968 if (r) {
978 DSSERR("Failed to initialize DSS\n"); 969 DSSERR("Failed to initialize DSS\n");
979 goto err_dss; 970 goto err_dss;
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 20590fb53c91..069fcc72331c 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -251,11 +251,11 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
251 251
252/* SDI */ 252/* SDI */
253#ifdef CONFIG_OMAP2_DSS_SDI 253#ifdef CONFIG_OMAP2_DSS_SDI
254int sdi_init(bool skip_init); 254int sdi_init(void);
255void sdi_exit(void); 255void sdi_exit(void);
256int sdi_init_display(struct omap_dss_device *display); 256int sdi_init_display(struct omap_dss_device *display);
257#else 257#else
258static inline int sdi_init(bool skip_init) 258static inline int sdi_init(void)
259{ 259{
260 return 0; 260 return 0;
261} 261}
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 9f10a0d9e760..54a53e648180 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -30,7 +30,6 @@
30#include "dss.h" 30#include "dss.h"
31 31
32static struct { 32static struct {
33 bool skip_init;
34 bool update_enabled; 33 bool update_enabled;
35 struct regulator *vdds_sdi_reg; 34 struct regulator *vdds_sdi_reg;
36} sdi; 35} sdi;
@@ -68,9 +67,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
68 if (r) 67 if (r)
69 goto err1; 68 goto err1;
70 69
71 /* In case of skip_init sdi_init has already enabled the clocks */ 70 dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
72 if (!sdi.skip_init)
73 dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
74 71
75 sdi_basic_init(dssdev); 72 sdi_basic_init(dssdev);
76 73
@@ -80,14 +77,8 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
80 dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config, 77 dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
81 dssdev->panel.acbi, dssdev->panel.acb); 78 dssdev->panel.acbi, dssdev->panel.acb);
82 79
83 if (!sdi.skip_init) { 80 r = dss_calc_clock_div(1, t->pixel_clock * 1000,
84 r = dss_calc_clock_div(1, t->pixel_clock * 1000, 81 &dss_cinfo, &dispc_cinfo);
85 &dss_cinfo, &dispc_cinfo);
86 } else {
87 r = dss_get_clock_div(&dss_cinfo);
88 r = dispc_get_clock_div(dssdev->manager->id, &dispc_cinfo);
89 }
90
91 if (r) 82 if (r)
92 goto err2; 83 goto err2;
93 84
@@ -116,18 +107,14 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
116 if (r) 107 if (r)
117 goto err2; 108 goto err2;
118 109
119 if (!sdi.skip_init) { 110 dss_sdi_init(dssdev->phy.sdi.datapairs);
120 dss_sdi_init(dssdev->phy.sdi.datapairs); 111 r = dss_sdi_enable();
121 r = dss_sdi_enable(); 112 if (r)
122 if (r) 113 goto err1;
123 goto err1; 114 mdelay(2);
124 mdelay(2);
125 }
126 115
127 dssdev->manager->enable(dssdev->manager); 116 dssdev->manager->enable(dssdev->manager);
128 117
129 sdi.skip_init = 0;
130
131 return 0; 118 return 0;
132err2: 119err2:
133 dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK); 120 dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
@@ -173,17 +160,8 @@ int sdi_init_display(struct omap_dss_device *dssdev)
173 return 0; 160 return 0;
174} 161}
175 162
176int sdi_init(bool skip_init) 163int sdi_init(void)
177{ 164{
178 /* we store this for first display enable, then clear it */
179 sdi.skip_init = skip_init;
180
181 /*
182 * Enable clocks already here, otherwise there would be a toggle
183 * of them until sdi_display_enable is called.
184 */
185 if (skip_init)
186 dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
187 return 0; 165 return 0;
188} 166}
189 167