aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sh_mobile_lcdcfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 98fb82f11611..fc3f9662ceae 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -154,6 +154,7 @@ static void lcdc_sys_write_index(void *handle, unsigned long data)
154 lcdc_write(ch->lcdc, _LDDWD0R, data | 0x10000000); 154 lcdc_write(ch->lcdc, _LDDWD0R, data | 0x10000000);
155 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0); 155 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
156 lcdc_write(ch->lcdc, _LDDWAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0)); 156 lcdc_write(ch->lcdc, _LDDWAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
157 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
157} 158}
158 159
159static void lcdc_sys_write_data(void *handle, unsigned long data) 160static void lcdc_sys_write_data(void *handle, unsigned long data)
@@ -163,6 +164,7 @@ static void lcdc_sys_write_data(void *handle, unsigned long data)
163 lcdc_write(ch->lcdc, _LDDWD0R, data | 0x11000000); 164 lcdc_write(ch->lcdc, _LDDWD0R, data | 0x11000000);
164 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0); 165 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
165 lcdc_write(ch->lcdc, _LDDWAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0)); 166 lcdc_write(ch->lcdc, _LDDWAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
167 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
166} 168}
167 169
168static unsigned long lcdc_sys_read_data(void *handle) 170static unsigned long lcdc_sys_read_data(void *handle)
@@ -173,8 +175,9 @@ static unsigned long lcdc_sys_read_data(void *handle)
173 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0); 175 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
174 lcdc_write(ch->lcdc, _LDDRAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0)); 176 lcdc_write(ch->lcdc, _LDDRAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
175 udelay(1); 177 udelay(1);
178 lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
176 179
177 return lcdc_read(ch->lcdc, _LDDRDR) & 0xffff; 180 return lcdc_read(ch->lcdc, _LDDRDR) & 0x3ffff;
178} 181}
179 182
180struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = { 183struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
@@ -474,6 +477,9 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
474 /* tell the board code to enable the panel */ 477 /* tell the board code to enable the panel */
475 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) { 478 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
476 ch = &priv->ch[k]; 479 ch = &priv->ch[k];
480 if (!ch->enabled)
481 continue;
482
477 board_cfg = &ch->cfg.board_cfg; 483 board_cfg = &ch->cfg.board_cfg;
478 if (board_cfg->display_on) 484 if (board_cfg->display_on)
479 board_cfg->display_on(board_cfg->board_data); 485 board_cfg->display_on(board_cfg->board_data);
@@ -491,6 +497,8 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
491 /* clean up deferred io and ask board code to disable panel */ 497 /* clean up deferred io and ask board code to disable panel */
492 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) { 498 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
493 ch = &priv->ch[k]; 499 ch = &priv->ch[k];
500 if (!ch->enabled)
501 continue;
494 502
495 /* deferred io mode: 503 /* deferred io mode:
496 * flush frame, and wait for frame end interrupt 504 * flush frame, and wait for frame end interrupt