]> git.karo-electronics.de Git - linux-beck.git/commitdiff
video: da8xx-fb: do clock reset of revision 2 LCDC before enabling
authorManjunathappa, Prakash <prakash.pm@ti.com>
Fri, 20 Jul 2012 15:51:11 +0000 (21:21 +0530)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sun, 29 Jul 2012 01:15:35 +0000 (01:15 +0000)
As in specification software reset should be applied for several
cycles before bringing it out of reset. Without this patch
particularly during suspend and resume clock reset is not guaranteed
to happen.

Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
drivers/video/da8xx-fb.c

index 6f0fb2d50c289b010ed8e3d80c33811eddf7b1e5..e81a4585902b167448734ffe06216138efa61044 100644 (file)
@@ -269,10 +269,18 @@ static inline void lcd_enable_raster(void)
 {
        u32 reg;
 
+       /* Put LCDC in reset for several cycles */
+       if (lcd_revision == LCD_VERSION_2)
+               /* Write 1 to reset LCDC */
+               lcdc_write(LCD_CLK_MAIN_RESET, LCD_CLK_RESET_REG);
+       mdelay(1);
+
        /* Bring LCDC out of reset */
        if (lcd_revision == LCD_VERSION_2)
                lcdc_write(0, LCD_CLK_RESET_REG);
+       mdelay(1);
 
+       /* Above reset sequence doesnot reset register context */
        reg = lcdc_read(LCD_RASTER_CTRL_REG);
        if (!(reg & LCD_RASTER_ENABLE))
                lcdc_write(reg | LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
@@ -286,10 +294,6 @@ static inline void lcd_disable_raster(void)
        reg = lcdc_read(LCD_RASTER_CTRL_REG);
        if (reg & LCD_RASTER_ENABLE)
                lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
-
-       if (lcd_revision == LCD_VERSION_2)
-               /* Write 1 to reset LCDC */
-               lcdc_write(LCD_CLK_MAIN_RESET, LCD_CLK_RESET_REG);
 }
 
 static void lcd_blit(int load_mode, struct da8xx_fb_par *par)