sh: LCDC SYS bus access wait fix
authorMagnus Damm <damm@igel.co.jp>
Thu, 6 Aug 2009 14:28:12 +0000 (14:28 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 6 Aug 2009 18:54:52 +0000 (03:54 +0900)
Update the SuperH Mobile LCDC driver to wait for SYS bus to
become idle after reading or writing. This is needed by the
kfr2r09 board, but also fixes potential problems on other
boards making use of the LCDC in a SYS configuration.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/video/sh_mobile_lcdcfb.c

index 98fb82f1161145b17cbf0bae4b7c08d35621c286..d1eb9656ca55f28bf0d357aad91ccc4d37d6e87c 100644 (file)
@@ -154,6 +154,7 @@ static void lcdc_sys_write_index(void *handle, unsigned long data)
        lcdc_write(ch->lcdc, _LDDWD0R, data | 0x10000000);
        lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
        lcdc_write(ch->lcdc, _LDDWAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
+       lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
 }
 
 static 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)
        lcdc_write(ch->lcdc, _LDDWD0R, data | 0x11000000);
        lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
        lcdc_write(ch->lcdc, _LDDWAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
+       lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
 }
 
 static unsigned long lcdc_sys_read_data(void *handle)
@@ -173,6 +175,7 @@ static unsigned long lcdc_sys_read_data(void *handle)
        lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
        lcdc_write(ch->lcdc, _LDDRAR, 1 | (lcdc_chan_is_sublcd(ch) ? 2 : 0));
        udelay(1);
+       lcdc_wait_bit(ch->lcdc, _LDSR, 2, 0);
 
        return lcdc_read(ch->lcdc, _LDDRDR) & 0xffff;
 }
This page took 0.026973 seconds and 5 git commands to generate.