summaryrefslogtreecommitdiffstats
path: root/board/sunxi/board.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-02-16 17:23:25 +0100
committerHans de Goede <hdegoede@redhat.com>2015-02-20 08:11:57 +0100
commit55410089cb979d7a86ee817c0309c4c2348a90df (patch)
tree8fef2d3466678e793c264cad9c199ef6ea1934d1 /board/sunxi/board.c
parent242e3d893d1311ea38abd25613076a29961d422e (diff)
downloadblackbird-obmc-uboot-55410089cb979d7a86ee817c0309c4c2348a90df.tar.gz
blackbird-obmc-uboot-55410089cb979d7a86ee817c0309c4c2348a90df.zip
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 <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'board/sunxi/board.c')
-rw-r--r--board/sunxi/board.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index b70e00ce6b..e1891d198e 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -33,6 +33,12 @@
#include <linux/usb/musb.h>
#include <net.h>
+#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
OpenPOWER on IntegriCloud