sunxi: video: Add support for LCD reset pin
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> Acked-by: Ian Campbell <ijc@hellion.org.uk>
This commit is contained in:
parent
1320112c8a
commit
242e3d893d
|
@ -312,6 +312,14 @@ config VIDEO_LCD_POWER
|
||||||
Set the power enable pin for the LCD panel. This takes a string in the
|
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.
|
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
|
config VIDEO_LCD_BL_EN
|
||||||
string "LCD panel backlight enable pin"
|
string "LCD panel backlight enable pin"
|
||||||
depends on VIDEO
|
depends on VIDEO
|
||||||
|
|
|
@ -592,7 +592,7 @@ static void sunxi_lcdc_enable(void)
|
||||||
|
|
||||||
static void sunxi_lcdc_panel_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
|
* 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);
|
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. */
|
/* Give the backlight some time to turn off and power up the panel. */
|
||||||
mdelay(40);
|
mdelay(40);
|
||||||
pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_POWER);
|
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_request(pin, "lcd_power");
|
||||||
gpio_direction_output(pin, 1);
|
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)
|
static void sunxi_lcdc_backlight_enable(void)
|
||||||
|
|
Loading…
Reference in New Issue