]> git.baikalelectronics.ru Git - uboot.git/commit
i2c: Add a DM_I2C driver for the sun8i RSB controller
authorSamuel Holland <samuel@sholland.org>
Fri, 8 Oct 2021 05:17:21 +0000 (00:17 -0500)
committerAndre Przywara <andre.przywara@arm.com>
Tue, 12 Oct 2021 09:19:18 +0000 (10:19 +0100)
commitbf7d5ce1e6bbdabc2b78dc076af715e06d9e553f
tree1b7f74ecdbf023f730d21a706fe7f9476cb8f14f
parentada988efe5ff1558b2a1a3406f9d63a558f37be4
i2c: Add a DM_I2C driver for the sun8i RSB controller

This bus controller is used to communicate with an X-Powers AXP PMIC.
Currently, various drivers access PMIC registers through a platform-
specific non-DM "pmic_bus" interface, which depends on the legacy I2C
framework. In order to convert those drivers to use DM_PMIC, this bus
needs a DM_I2C driver.

Refactor the rsb functions to take the base address as a parameter,
and implement both the existing interface (which is still needed in
SPL) and the DM_I2C interface on top of them.

The register for switching between I2C/P2WI/RSB mode is the same across
all PMIC variants, so move that to the common header.

There are only a couple of pairs of hardware/runtime addresses used
across all PMIC variants. So far the code expected only the "primary"
pair, but some PMICs like the AXP305 and AXP805 use the secondary pair,
so add support for that to the DM driver as well.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/mach-sunxi/Kconfig
arch/arm/mach-sunxi/Makefile
arch/arm/mach-sunxi/pmic_bus.c
arch/arm/mach-sunxi/rsb.c [deleted file]
configs/Cubieboard4_defconfig
configs/Merrii_A80_Optimus_defconfig
drivers/i2c/Kconfig
drivers/i2c/Makefile
drivers/i2c/sun8i_rsb.c [new file with mode: 0644]
include/axp_pmic.h