summaryrefslogtreecommitdiff
path: root/arch/arm/mach-sunxi
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2016-11-30 15:30:30 +0800
committerMaxime Ripard <maxime.ripard@free-electrons.com>2017-04-20 13:30:00 +0200
commit409677ec1706c1374f9ce5e1833ae425dd0a9602 (patch)
tree0bea62641c350ba03d79e436ea4e0014fbf98640 /arch/arm/mach-sunxi
parent379febac5a3ea9f1952c2234a9acfd1b16f9100f (diff)
sunxi: Enable AXP221s in I2C mode with the R40 SoC
The R40 SoC uses the AXP221s in I2C mode to supply power. Some regulator's common usages have changed, and also the recommended voltage for existing usages have changed. Update the defaults to match. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'arch/arm/mach-sunxi')
-rw-r--r--arch/arm/mach-sunxi/pmic_bus.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mach-sunxi/pmic_bus.c b/arch/arm/mach-sunxi/pmic_bus.c
index 7c57f02792..f917c3e070 100644
--- a/arch/arm/mach-sunxi/pmic_bus.c
+++ b/arch/arm/mach-sunxi/pmic_bus.c
@@ -41,6 +41,9 @@ int pmic_bus_init(void)
p2wi_init();
ret = p2wi_change_to_p2wi_mode(AXP221_CHIP_ADDR, AXP221_CTRL_ADDR,
AXP221_INIT_DATA);
+# elif defined CONFIG_MACH_SUN8I_R40
+ /* Nothing. R40 uses the AXP221s in I2C mode */
+ ret = 0;
# else
ret = rsb_init();
if (ret)
@@ -65,6 +68,8 @@ int pmic_bus_read(u8 reg, u8 *data)
#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
# ifdef CONFIG_MACH_SUN6I
return p2wi_read(reg, data);
+# elif defined CONFIG_MACH_SUN8I_R40
+ return i2c_read(AXP209_I2C_ADDR, reg, 1, data, 1);
# else
return rsb_read(AXP223_RUNTIME_ADDR, reg, data);
# endif
@@ -80,6 +85,8 @@ int pmic_bus_write(u8 reg, u8 data)
#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
# ifdef CONFIG_MACH_SUN6I
return p2wi_write(reg, data);
+# elif defined CONFIG_MACH_SUN8I_R40
+ return i2c_write(AXP209_I2C_ADDR, reg, 1, &data, 1);
# else
return rsb_write(AXP223_RUNTIME_ADDR, reg, data);
# endif