From: Paul Kocialkowski <cont...@paulk.fr>

Both the V3 and V3s support I2C1 on PB pins, which is often used to
connect an AXP209 PMIC on V3 boards.

Signed-off-by: Paul Kocialkowski <cont...@paulk.fr>
---
 board/sunxi/board.c  | 4 ++++
 include/sunxi_gpio.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 6520636ffab5..72aa86cd752d 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -98,6 +98,10 @@ void i2c_init_board(void)
        sunxi_gpio_set_cfgpin(SUNXI_GPH(16), SUN6I_GPH_TWI1);
        sunxi_gpio_set_cfgpin(SUNXI_GPH(17), SUN6I_GPH_TWI1);
        clock_twi_onoff(1, 1);
+#elif defined(CONFIG_MACH_SUN8I_V3_V3S)
+       sunxi_gpio_set_cfgpin(SUNXI_GPB(8), SUN8I_V3S_GPB_TWI1);
+       sunxi_gpio_set_cfgpin(SUNXI_GPB(9), SUN8I_V3S_GPB_TWI1);
+       clock_twi_onoff(1, 1);
 #elif defined(CONFIG_MACH_SUN8I)
        sunxi_gpio_set_cfgpin(SUNXI_GPH(4), SUN8I_GPH_TWI1);
        sunxi_gpio_set_cfgpin(SUNXI_GPH(5), SUN8I_GPH_TWI1);
diff --git a/include/sunxi_gpio.h b/include/sunxi_gpio.h
index 12b54c8dda4d..e166b9758f44 100644
--- a/include/sunxi_gpio.h
+++ b/include/sunxi_gpio.h
@@ -110,6 +110,7 @@ enum sunxi_gpio_number {
 #define SUN4I_GPB_TWI1         2
 #define SUN5I_GPB_TWI1         2
 #define SUN8I_V3S_GPB_TWI0     2
+#define SUN8I_V3S_GPB_TWI1     2
 #define SUN4I_GPB_UART0                2
 #define SUN5I_GPB_UART0                2
 #define SUN8I_GPB_UART2                2
-- 
2.49.0

Reply via email to