-#include <asm/arch/p2wi.h>
-#include <asm/arch/rsb.h>
-#include <axp221.h>
-
-/*
- * The axp221 uses the p2wi bus, the axp223 is identical (for all registers
- * used sofar) but uses the rsb bus. These functions abstract this.
- */
-static int pmic_bus_init(void)
-{
-#ifdef CONFIG_MACH_SUN6I
- p2wi_init();
- return p2wi_change_to_p2wi_mode(AXP221_CHIP_ADDR, AXP221_CTRL_ADDR,
- AXP221_INIT_DATA);
-#else
- int ret;
-
- ret = rsb_init();
- if (ret)
- return ret;
-
- return rsb_set_device_address(AXP223_DEVICE_ADDR, AXP223_RUNTIME_ADDR);
-#endif
-}
-
-static int pmic_bus_read(const u8 addr, u8 *data)
-{
-#ifdef CONFIG_MACH_SUN6I
- return p2wi_read(addr, data);
-#else
- return rsb_read(AXP223_RUNTIME_ADDR, addr, data);
-#endif
-}
-
-static int pmic_bus_write(const u8 addr, u8 data)
-{
-#ifdef CONFIG_MACH_SUN6I
- return p2wi_write(addr, data);
-#else
- return rsb_write(AXP223_RUNTIME_ADDR, addr, data);
-#endif
-}