video: cfb_console: Allow VGA device to work without i8042 keyboard
[oweals/u-boot.git] / drivers / video / exynos_fb.c
index c5d73308047fac83a9a663a136a6b3c1e3ed7a78..69edc3a3a4a382512167ae3660f49f953c419be5 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/arch/mipi_dsim.h>
 #include <asm/arch/dp_info.h>
 #include <asm/arch/system.h>
+#include <asm/gpio.h>
 #include <asm-generic/errno.h>
 
 #include "exynos_fb.h"
@@ -27,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static unsigned int panel_width, panel_height;
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 vidinfo_t panel_info  = {
        /*
         * Insert a value here so that we don't end up in the BSS
@@ -102,6 +103,10 @@ __weak int exynos_lcd_misc_init(vidinfo_t *vid)
 
 static void lcd_panel_on(vidinfo_t *vid)
 {
+       struct gpio_desc pwm_out_gpio;
+       struct gpio_desc bl_en_gpio;
+       unsigned int node;
+
        udelay(vid->init_delay);
 
        exynos_backlight_reset();
@@ -121,6 +126,22 @@ static void lcd_panel_on(vidinfo_t *vid)
 
        exynos_backlight_on(1);
 
+#if CONFIG_IS_ENABLED(OF_CONTROL)
+       node = fdtdec_next_compatible(gd->fdt_blob, 0,
+                                               COMPAT_SAMSUNG_EXYNOS_FIMD);
+       if (node <= 0) {
+               debug("FIMD: Can't get device node for FIMD\n");
+               return;
+       }
+       gpio_request_by_name_nodev(gd->fdt_blob, node, "samsung,pwm-out-gpio",
+                                  0, &pwm_out_gpio,
+                                  GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
+
+       gpio_request_by_name_nodev(gd->fdt_blob, node, "samsung,bl-en-gpio", 0,
+                                  &bl_en_gpio,
+                                  GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
+
+#endif
        exynos_cfg_ldo();
 
        exynos_enable_ldo(1);
@@ -129,7 +150,7 @@ static void lcd_panel_on(vidinfo_t *vid)
                exynos_mipi_dsi_init();
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int exynos_lcd_early_init(const void *blob)
 {
        unsigned int node;
@@ -274,7 +295,7 @@ void lcd_ctrl_init(void *lcdbase)
        set_system_display_ctrl();
        set_lcd_clk();
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 #ifdef CONFIG_EXYNOS_MIPI_DSIM
        exynos_init_dsim_platform_data(&panel_info);
 #endif