public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] sunxi: video: Add support for LCD reset pin
@ 2015-02-16 22:25 Hans de Goede
  2015-02-16 22:25 ` [U-Boot] [PATCH 2/4] sunxi: video: Add support for LCD panels which need to be configured via i2c Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hans de Goede @ 2015-02-16 22:25 UTC (permalink / raw)
  To: u-boot

On some boards there is a gpio to reset the LCD panel, add support for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 board/sunxi/Kconfig           |  8 ++++++++
 drivers/video/sunxi_display.c | 11 ++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 0226d28..70e6f4d 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -317,6 +317,14 @@ config VIDEO_LCD_POWER
 	Set the power enable pin for the LCD panel. 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_RESET
+	string "LCD panel reset pin"
+	depends on VIDEO
+	default ""
+	---help---
+	Set the reset pin for the LCD panel. 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_BL_EN
 	string "LCD panel backlight enable pin"
 	depends on VIDEO
diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
index dbda97e..7f01401 100644
--- a/drivers/video/sunxi_display.c
+++ b/drivers/video/sunxi_display.c
@@ -592,7 +592,7 @@ static void sunxi_lcdc_enable(void)
 
 static void sunxi_lcdc_panel_enable(void)
 {
-	int pin;
+	int pin, reset_pin;
 
 	/*
 	 * Start with backlight disabled to avoid the screen flashing to
@@ -610,6 +610,12 @@ static void sunxi_lcdc_panel_enable(void)
 		gpio_direction_output(pin, PWM_OFF);
 	}
 
+	reset_pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_RESET);
+	if (reset_pin != -1) {
+		gpio_request(reset_pin, "lcd_reset");
+		gpio_direction_output(reset_pin, 0); /* Assert reset */
+	}
+
 	/* Give the backlight some time to turn off and power up the panel. */
 	mdelay(40);
 	pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_POWER);
@@ -617,6 +623,9 @@ static void sunxi_lcdc_panel_enable(void)
 		gpio_request(pin, "lcd_power");
 		gpio_direction_output(pin, 1);
 	}
+
+	if (reset_pin != -1)
+		gpio_direction_output(reset_pin, 1); /* De-assert reset */
 }
 
 static void sunxi_lcdc_backlight_enable(void)
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-18 15:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-16 22:25 [U-Boot] [PATCH 1/4] sunxi: video: Add support for LCD reset pin Hans de Goede
2015-02-16 22:25 ` [U-Boot] [PATCH 2/4] sunxi: video: Add support for LCD panels which need to be configured via i2c Hans de Goede
2015-02-16 22:25 ` [U-Boot] [PATCH 3/4] sunxi: video: Add support for tl059wv5c0 lcd panels Hans de Goede
2015-02-18  9:21   ` Ian Campbell
2015-02-18 15:14     ` Hans de Goede
2015-02-18 15:14     ` Hans de Goede
2015-02-16 22:25 ` [U-Boot] [PATCH 4/4] sunxi: musb: Check Vbus-det before enabling otg port power Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox