From 9d0826879e13e8139a7b169c2365225e848ff57e Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Thu, 14 Jan 2016 14:06:26 +0100 Subject: sunxi: Add support for the I2C controller which is part of the PRCM Signed-off-by: Jelle van der Waa [hdegoede@redhat.com: Minor cleanups] Signed-off-by: Hans de Goede applied with fixing 2 checkpatch warnings: WARNING: please, no space before tabs Signed-off-by: Heiko Schocher --- board/sunxi/Kconfig | 6 ++++++ board/sunxi/board.c | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 9d67847850..7c69be918f 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -363,6 +363,12 @@ config I2C3_ENABLE See I2C0_ENABLE help text. endif +config R_I2C_ENABLE + bool "Enable the PRCM I2C/TWI controller" + default n + ---help--- + Set this to y to enable the I2C controller which is part of the PRCM. + if MACH_SUN7I config I2C4_ENABLE bool "Enable I2C/TWI controller 4" diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 386e2e04c2..1cc39e4d18 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -422,6 +422,12 @@ void i2c_init_board(void) clock_twi_onoff(4, 1); #endif #endif + +#ifdef CONFIG_R_I2C_ENABLE + clock_twi_onoff(5, 1); + sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_H3_GPL_R_TWI); + sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_H3_GPL_R_TWI); +#endif } #ifdef CONFIG_SPL_BUILD -- cgit v1.2.1