diff mbox

[U-Boot,2/3] sunxi: video: Add support for external DAC enable pin

Message ID 1421056932-13723-3-git-send-email-wens@csie.org
State Accepted
Delegated to: Hans de Goede
Headers show

Commit Message

Chen-Yu Tsai Jan. 12, 2015, 10:02 a.m. UTC
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>
---
 board/sunxi/Kconfig           |  8 ++++++++
 drivers/video/sunxi_display.c | 18 ++++++++++++++++++
 2 files changed, 26 insertions(+)

Comments

Hans de Goede Jan. 12, 2015, 10:19 a.m. UTC | #1
Hi,

On 12-01-15 11:02, Chen-Yu Tsai wrote:
> 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>
> ---
>   board/sunxi/Kconfig           |  8 ++++++++
>   drivers/video/sunxi_display.c | 18 ++++++++++++++++++
>   2 files changed, 26 insertions(+)
>
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index bce270e..e9a6b3c 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -315,6 +315,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
> diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
> index 47d820d..1052af2 100644
> --- a/drivers/video/sunxi_display.c
> +++ b/drivers/video/sunxi_display.c
> @@ -813,6 +813,23 @@ static void sunxi_drc_init(void)
>   #endif
>   }
>
> +#ifdef CONFIG_VIDEO_VGA_VIA_LCD
> +static void sunxi_vga_external_dac_enable(void)
> +{
> +	int pin;
> +
> +	/*
> +	 * Start with backlight disabled to avoid the screen flashing to
> +	 * white while the lcd inits.
> +	 */

This comment seems wrong, copy & paste error ?

Let me know if you agree that it is wrong, then I'll drop it before applying
the series, not need to resend.

Regards,

Hans


> +	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 +877,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;
>   	}
>
Chen-Yu Tsai Jan. 12, 2015, 10:51 a.m. UTC | #2
On Mon, Jan 12, 2015 at 6:19 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
>
> On 12-01-15 11:02, Chen-Yu Tsai wrote:
>>
>> 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>
>> ---
>>   board/sunxi/Kconfig           |  8 ++++++++
>>   drivers/video/sunxi_display.c | 18 ++++++++++++++++++
>>   2 files changed, 26 insertions(+)
>>
>> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
>> index bce270e..e9a6b3c 100644
>> --- a/board/sunxi/Kconfig
>> +++ b/board/sunxi/Kconfig
>> @@ -315,6 +315,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
>> diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
>> index 47d820d..1052af2 100644
>> --- a/drivers/video/sunxi_display.c
>> +++ b/drivers/video/sunxi_display.c
>> @@ -813,6 +813,23 @@ static void sunxi_drc_init(void)
>>   #endif
>>   }
>>
>> +#ifdef CONFIG_VIDEO_VGA_VIA_LCD
>> +static void sunxi_vga_external_dac_enable(void)
>> +{
>> +       int pin;
>> +
>> +       /*
>> +        * Start with backlight disabled to avoid the screen flashing to
>> +        * white while the lcd inits.
>> +        */
>
>
> This comment seems wrong, copy & paste error ?
>
> Let me know if you agree that it is wrong, then I'll drop it before applying
> the series, not need to resend.

Yes it's a copy & paste error. Please drop it.

Thanks!

ChenYu

> Regards,
>
> Hans
>
>
>
>> +       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 +877,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;
>>         }
>>
>
diff mbox

Patch

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index bce270e..e9a6b3c 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -315,6 +315,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
diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
index 47d820d..1052af2 100644
--- a/drivers/video/sunxi_display.c
+++ b/drivers/video/sunxi_display.c
@@ -813,6 +813,23 @@  static void sunxi_drc_init(void)
 #endif
 }
 
+#ifdef CONFIG_VIDEO_VGA_VIA_LCD
+static void sunxi_vga_external_dac_enable(void)
+{
+	int pin;
+
+	/*
+	 * Start with backlight disabled to avoid the screen flashing to
+	 * white while the lcd inits.
+	 */
+	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 +877,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;
 	}