From 242e3d893d1311ea38abd25613076a29961d422e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 16 Feb 2015 17:26:41 +0100 Subject: 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 Acked-by: Ian Campbell --- board/sunxi/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 3eab81f..a170c56 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -312,6 +312,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 -- cgit v1.1 From 55410089cb979d7a86ee817c0309c4c2348a90df Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 16 Feb 2015 17:23:25 +0100 Subject: sunxi: video: Add support for LCD panels which need to be configured via i2c This commits adds support for configuring a a bitbang i2c controller, which is used on some boards to configure the LCD panel (via i2c). Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/Kconfig | 24 ++++++++++++++++++++++++ board/sunxi/board.c | 10 ++++++++++ 2 files changed, 34 insertions(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index a170c56..bbb4d1b 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -344,6 +344,30 @@ config VIDEO_LCD_BL_PWM_ACTIVE_LOW ---help--- Set this if the backlight pwm output is active low. +config VIDEO_LCD_PANEL_I2C + bool "LCD panel needs to be configured via i2c" + depends on VIDEO + default m + ---help--- + Say y here if the LCD panel needs to be configured via i2c. This + will add a bitbang i2c controller using gpios to talk to the LCD. + +config VIDEO_LCD_PANEL_I2C_SDA + string "LCD panel i2c interface SDA pin" + depends on VIDEO_LCD_PANEL_I2C + default "PG12" + ---help--- + Set the SDA pin for the LCD i2c interface. 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_PANEL_I2C_SCL + string "LCD panel i2c interface SCL pin" + depends on VIDEO_LCD_PANEL_I2C + default "PG10" + ---help--- + Set the SCL pin for the LCD i2c interface. This takes a string in the + format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. + # Note only one of these may be selected at a time! But hidden choices are # not supported by Kconfig diff --git a/board/sunxi/board.c b/board/sunxi/board.c index b70e00c..e1891d1 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -33,6 +33,12 @@ #include #include +#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD) +/* So that we can use pin names in Kconfig and sunxi_name_to_gpio() */ +int soft_i2c_gpio_sda; +int soft_i2c_gpio_scl; +#endif + DECLARE_GLOBAL_DATA_PTR; /* add board specific code here */ @@ -152,6 +158,10 @@ void i2c_init_board(void) sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUNXI_GPB0_TWI0); sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUNXI_GPB0_TWI0); clock_twi_onoff(0, 1); +#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD) + soft_i2c_gpio_sda = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_PANEL_I2C_SDA); + soft_i2c_gpio_scl = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_PANEL_I2C_SCL); +#endif } #ifdef CONFIG_SPL_BUILD -- cgit v1.1 From aad2ac24c0871bb897be676aca946f37dd05f187 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 16 Feb 2015 17:49:47 +0100 Subject: sunxi: video: Add support for tl059wv5c0 lcd panels Add support for the 6" 480x800 tl059wv5c0 panel used on e.g. Utoo P66 and Aigo M60/M608/M606 tablets. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index bbb4d1b..f5471a1 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -406,6 +406,14 @@ config VIDEO_LCD_PANEL_HITACHI_TX18D42VM ---help--- 7.85" 1024x768 Hitachi tx18d42vm LCD panel support +config VIDEO_LCD_TL059WV5C0 + bool "tl059wv5c0 LCD panel" + select VIDEO_LCD_PANEL_I2C + select VIDEO_LCD_IF_PARALLEL + ---help--- + 6" 480x800 tl059wv5c0 panel support, as used on the Utoo P66 and + Aigo M60/M608/M606 tablets. + endchoice -- cgit v1.1 From 52defe8f65700ad625c3ca63f723564210b2dc82 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 16 Feb 2015 22:13:43 +0100 Subject: sunxi: musb: Check Vbus-det before enabling otg port power Sending out 5V when there is a charger connected to the otg port is not a good idea, so check for this and error out. Note this commit currently breaks otg support on the q8h tablets, as we need to do some magic with the pmic there to get vbus info, this is deliberate (better safe then sorry), fixing this is on my TODO list. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index f5471a1..9cf54e5 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -223,6 +223,14 @@ config USB0_VBUS_PIN Set the Vbus enable pin for usb0 (otg). This takes a string in the format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. +config USB0_VBUS_DET + string "Vbus detect pin for usb0 (otg)" + depends on USB_MUSB_SUNXI + default "" + ---help--- + Set the Vbus detect pin for usb0 (otg). This takes a string in the + format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. + config USB1_VBUS_PIN string "Vbus enable pin for usb1 (ehci0)" default "PH6" if MACH_SUN4I || MACH_SUN7I -- cgit v1.1