]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx51/tx51.c
Merge branch 'tx51-devel' into uboot-merge
[karo-tx-uboot.git] / board / karo / tx51 / tx51.c
index 7e3bb68798677ad3f695ab01d499e823ca304f90..eff52076dd6957f684f922027bddaef0fb4b86c3 100644 (file)
@@ -386,9 +386,6 @@ int board_mmc_init(bd_t *bis)
                struct tx51_esdhc_cfg *cfg = &tx51_esdhc_cfg[i];
                int ret;
 
-               if (i >= CONFIG_SYS_FSL_ESDHC_NUM)
-                       break;
-
                imx_iomux_v3_setup_multiple_pads(cfg->pads,
                                                cfg->num_pads);
                cfg->cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
@@ -689,6 +686,12 @@ static struct fb_videomode tx51_fb_modes[] = {
 };
 
 static int lcd_enabled = 1;
+static int lcd_bl_polarity;
+
+static int lcd_backlight_polarity(void)
+{
+       return lcd_bl_polarity;
+}
 
 void lcd_enable(void)
 {
@@ -707,7 +710,8 @@ void lcd_enable(void)
                udelay(100);
                gpio_set_value(TX51_LCD_RST_GPIO, 1);
                udelay(300000);
-               gpio_set_value(TX51_LCD_BACKLIGHT_GPIO, 0);
+               gpio_set_value(TX51_LCD_BACKLIGHT_GPIO,
+                       lcd_backlight_polarity());
        }
 }
 
@@ -723,7 +727,8 @@ void lcd_panel_disable(void)
 {
        if (lcd_enabled) {
                debug("Switching LCD off\n");
-               gpio_set_value(TX51_LCD_BACKLIGHT_GPIO, 1);
+               gpio_set_value(TX51_LCD_BACKLIGHT_GPIO,
+                       !lcd_backlight_polarity());
                gpio_set_value(TX51_LCD_RST_GPIO, 0);
                gpio_set_value(TX51_LCD_PWR_GPIO, 0);
        }
@@ -800,6 +805,7 @@ void lcd_ctrl_init(void *lcdbase)
        }
 
        karo_fdt_move_fdt();
+       lcd_bl_polarity = karo_fdt_get_backlight_polarity(working_fdt);
 
        if (video_mode == NULL) {
                debug("Disabling LCD\n");