]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot
authorMarco Franchi <marco.franchi@nxp.com>
Wed, 8 Jun 2016 18:05:31 +0000 (15:05 -0300)
committerStefano Babic <sbabic@denx.de>
Sat, 18 Jun 2016 08:25:54 +0000 (10:25 +0200)
Currently the LVDS backlight does not work in U-Boot after a “reboot” comand
in the kernel.

This problem occurs because the kernel uses this pin in PWM mode and U-Boot
does not configure the backlight pin as GPIO functionality.

So fix the problem by explicitly configuring the backlight pin as GPIO in
U-Boot.

Signed-off-by: Marco Franchi <marco.franchi@nxp.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
board/freescale/mx6sabresd/mx6sabresd.c

index 54ba36b535910fdc3a9d446658182d0d10ecc041..0cf68097f4f43e3d5a278e86d357454c921b9146 100644 (file)
@@ -177,13 +177,27 @@ static iomux_v3_cfg_t const rgb_pads[] = {
        MX6_PAD_DISP0_DAT21__IPU1_DISP0_DATA21 | MUX_PAD_CTRL(NO_PAD_CTRL),
        MX6_PAD_DISP0_DAT22__IPU1_DISP0_DATA22 | MUX_PAD_CTRL(NO_PAD_CTRL),
        MX6_PAD_DISP0_DAT23__IPU1_DISP0_DATA23 | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+static iomux_v3_cfg_t const bl_pads[] = {
        MX6_PAD_SD1_DAT3__GPIO1_IO21 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
 
+static void enable_backlight(void)
+{
+       imx_iomux_v3_setup_multiple_pads(bl_pads, ARRAY_SIZE(bl_pads));
+       gpio_direction_output(DISP0_PWR_EN, 1);
+}
+
 static void enable_rgb(struct display_info_t const *dev)
 {
        imx_iomux_v3_setup_multiple_pads(rgb_pads, ARRAY_SIZE(rgb_pads));
-       gpio_direction_output(DISP0_PWR_EN, 1);
+       enable_backlight();
+}
+
+static void enable_lvds(struct display_info_t const *dev)
+{
+       enable_backlight();
 }
 
 static struct i2c_pads_info i2c_pad_info1 = {
@@ -370,7 +384,7 @@ struct display_info_t const displays[] = {{
        .addr   = 0,
        .pixfmt = IPU_PIX_FMT_RGB666,
        .detect = NULL,
-       .enable = NULL,
+       .enable = enable_lvds,
        .mode   = {
                .name           = "Hannstar-XGA",
                .refresh        = 60,