]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
drivers/video/am335x-fb: Add possibility to wait for stable power/picture
authorHannes Petermaier <oe5hpm@oevsv.at>
Tue, 3 Feb 2015 12:22:23 +0000 (13:22 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:20:09 +0000 (14:20 +0200)
Often on boards exists a circuit which switches power on/off to LCD display.
Due to the need of limiting the in-rush current the output voltage from this
circuit rises "slowly", so it is necessary to wait a bit (VCC ramp up time)
before starting output on LCD-pins.
This time is specified in <n> ms within the panel-settings, called "pup_delay"

Further some LCDs need a couple of frames to stabilize the image on it.
We have now the possibility to wait some time after starting output on LCD.
This time is also specified in <n> ms within panel-settings, called "pon_delay"

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
drivers/video/am335x-fb.c
drivers/video/am335x-fb.h

index ab9894102dc8bc96921d483c09ccc002e863a38d..6f956499d75332c1185afda7683210a212c7530b 100644 (file)
@@ -127,6 +127,12 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
        memset((void *)gd->fb_base, 0, 0x20);
        *(unsigned int *)gd->fb_base = 0x4000;
 
+       /* turn ON display through powercontrol function if accessible */
+       if (0 != panel->panel_power_ctrl)
+               panel->panel_power_ctrl(1);
+
+       debug("am335x-fb: wait for stable power ...\n");
+       mdelay(panel->pup_delay);
        lcdhw->clkc_enable = LCD_CORECLKEN | LCD_LIDDCLKEN | LCD_DMACLKEN;
        lcdhw->raster_ctrl = 0;
        lcdhw->ctrl = LCD_CLK_DIVISOR(panel->pxl_clk_div) | LCD_RASTER_MODE;
@@ -159,11 +165,8 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
 
        gd->fb_base += 0x20;    /* point fb behind palette */
 
-       /* turn ON display through powercontrol function if accessible */
-       if (0 != panel->panel_power_ctrl) {
-               mdelay(panel->pon_delay);
-               panel->panel_power_ctrl(1);
-       }
+       debug("am335x-fb: waiting picture to be stable.\n.");
+       mdelay(panel->pon_delay);
 
        return 0;
 }
index 8a0b1314958ff7740acc80657d127b8dff5bc1bb..7f799d1f31c2f8713f3e4d7191c24131dd15dd54 100644 (file)
@@ -55,9 +55,14 @@ struct am335x_lcdpanel {
        unsigned int    vsw;            /* Vertical Sync Pulse Width */
        unsigned int    pxl_clk_div;    /* Pixel clock divider*/
        unsigned int    pol;            /* polarity of sync, clock signals */
+       unsigned int    pup_delay;      /*
+                                        * time in ms after power on to
+                                        * initialization of lcd-controller
+                                        * (VCC ramp up time)
+                                        */
        unsigned int    pon_delay;      /*
-                                        * time in ms for turning on lcd after
-                                        * initializing lcd-controller
+                                        * time in ms after initialization of
+                                        * lcd-controller (pic stabilization)
                                         */
        void (*panel_power_ctrl)(int);  /* fp for power on/off display */
 };