
This series does the initial work to migrate sunxi boards to DM_I2C. Version 1 of this series bitrotted quite a bit, so there is some reorganization in version 2.
First it takes care of the PMIC: - Patches 1-2 clean up the PMIC Kconfig, though they are not strictly necessary after 7abf178b, and are independent from the other patches. - Patch 3 then adds a DM_PMIC driver. - Patches 4-6 prepare to move the P2WI/RSB bus drivers to drivers/i2c. - Patches 7-8 move and add DM_I2C versions of those two drivers. - Patches 9-10 migrate the "pmic_bus" functions to use the DM_I2C bus and DM_PMIC driver when possible. Then it takes care of the LCD panels: - Patch 11 converts those drivers to use DM_I2C. Finally, patch 12 switches all sunxi boards over to DM_I2C.
I have build-tested each commit on all sunxi boards.
There is some remaining work to clean up uses of pmic_bus in U-Boot proper and replace them with DM_PMIC functions: - drivers/gpio/axp_gpio.c - I have a series for this. - do_poweroff() in drivers/gpio/axp???.c - I have a series for this. - axp_get_sid() in drivers/power/axp221.c - Not sure what to do here. - axp_set_eldo() in drivers/video/sunxi/sunxi_display.c - This will need a DM_REGULATOR driver.
Changes in v2: - Rebase to pick up 7abf178b ("power: Tidy up #undef of CONFIG_DM_PMIC") - Rebase to pick up 7abf178b ("power: Tidy up #undef of CONFIG_DM_PMIC") - Replace axp_pmic_bind() with `.bind = dm_scan_fdt_dev` - New patch to account for I2C Kconfig changes - Renamed Kconfig symbol to SYS_I2C_SUN6I_P2WI - Moved entire P2WI driver source to drivers/i2c - Renamed Kconfig symbol to SYS_I2C_SUN8I_RSB - Moved entire RSB driver source to drivers/i2c - Update IS_ENABLEDs in pmic_bus.c to match chages to previous patches
Samuel Holland (12): power: pmic: Consistently depend on DM_PMIC power: pmic: Consistently depend on SPL_DM_PMIC power: pmic: Add a driver for X-Powers AXP PMICs sunxi: Only initialize legacy I2C when enabled sunxi: Select SUN8I_RSB more carefully sunxi: pmic_bus: Fix Kconfig dependencies i2c: Add a DM_I2C driver for the sun6i P2WI controller i2c: Add a DM_I2C driver for the sun8i RSB controller sunxi: pmic_bus: Clean up preprocessor conditions sunxi: pmic_bus: Use the DM PMIC interface when possible sunxi: video: Convert panel I2C to use DM_I2C sunxi: Enable DM_I2C for all sunxi boards
arch/arm/Kconfig | 1 + arch/arm/mach-sunxi/Kconfig | 59 ++---- arch/arm/mach-sunxi/Makefile | 2 - arch/arm/mach-sunxi/board.c | 2 +- arch/arm/mach-sunxi/p2wi.c | 117 ------------ arch/arm/mach-sunxi/pmic_bus.c | 109 +++++------ arch/arm/mach-sunxi/rsb.c | 175 ----------------- board/sunxi/board.c | 44 +---- configs/Colombus_defconfig | 6 - configs/UTOO_P66_defconfig | 3 - drivers/i2c/Kconfig | 16 ++ drivers/i2c/Makefile | 2 + drivers/i2c/sun6i_p2wi.c | 220 ++++++++++++++++++++++ drivers/i2c/sun8i_rsb.c | 281 ++++++++++++++++++++++++++++ drivers/power/pmic/Kconfig | 69 ++++--- drivers/power/pmic/Makefile | 1 + drivers/power/pmic/axp.c | 38 ++++ drivers/video/anx9804.c | 103 +++++----- drivers/video/anx9804.h | 5 +- drivers/video/sunxi/sunxi_display.c | 55 ++++-- include/axp_pmic.h | 12 ++ include/configs/sunxi-common.h | 17 -- 22 files changed, 773 insertions(+), 564 deletions(-) delete mode 100644 arch/arm/mach-sunxi/p2wi.c delete mode 100644 arch/arm/mach-sunxi/rsb.c create mode 100644 drivers/i2c/sun6i_p2wi.c create mode 100644 drivers/i2c/sun8i_rsb.c create mode 100644 drivers/power/pmic/axp.c