]> git.sur5r.net Git - u-boot/commitdiff
sunxi: video: Add support for external DAC enable pin
authorChen-Yu Tsai <wens@csie.org>
Mon, 12 Jan 2015 10:02:11 +0000 (18:02 +0800)
committerHans de Goede <hdegoede@redhat.com>
Wed, 14 Jan 2015 13:56:40 +0000 (14:56 +0100)
The external DAC for VGA output might have either a power or reset
control pin that needs to be pulled up, as is the case on the
Hummingbird A31.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
board/sunxi/Kconfig
drivers/video/sunxi_display.c

index 5822b4126cfab308462d9fcfb0b7d2c3ffb8315e..c5105bbb38d9538f32e47993509d850e90db6f6c 100644 (file)
@@ -314,6 +314,14 @@ config VIDEO_VGA_VIA_LCD
        LCD interface driving a VGA connector, such as found on the
        Olimex A13 boards.
 
+config VIDEO_VGA_EXTERNAL_DAC_EN
+       string "LCD panel power enable pin"
+       depends on VIDEO_VGA_VIA_LCD
+       default ""
+       ---help---
+       Set the enable pin for the external VGA DAC. This takes a string in the
+       format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
+
 config VIDEO_LCD_MODE
        string "LCD panel timing details"
        depends on VIDEO
index 47d820d89f67be1266a205703654068d98408a05..d92dfa88635260560c871c92536209f18e27c194 100644 (file)
@@ -813,6 +813,19 @@ static void sunxi_drc_init(void)
 #endif
 }
 
+#ifdef CONFIG_VIDEO_VGA_VIA_LCD
+static void sunxi_vga_external_dac_enable(void)
+{
+       int pin;
+
+       pin = sunxi_name_to_gpio(CONFIG_VIDEO_VGA_EXTERNAL_DAC_EN);
+       if (pin != -1) {
+               gpio_request(pin, "vga_enable");
+               gpio_direction_output(pin, 1);
+       }
+}
+#endif /* CONFIG_VIDEO_VGA_VIA_LCD */
+
 static void sunxi_engines_init(void)
 {
        sunxi_composer_init();
@@ -860,6 +873,7 @@ static void sunxi_mode_set(const struct ctfb_res_modes *mode,
                sunxi_lcdc_tcon0_mode_set(mode);
                sunxi_composer_enable();
                sunxi_lcdc_enable();
+               sunxi_vga_external_dac_enable();
 #endif
                break;
        }