u-boot/drivers/i2c
Samuel Holland 3227c85fe7 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>
2021-10-12 10:19:18 +01:00
..
muxes dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
acpi_i2c.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
acpi_i2c.h dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
ast_i2c.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
ast_i2c.h i2c: ast_i2c: Update to use standard enums for speed 2020-01-27 07:22:41 +01:00
at91_i2c.c i2c: at91: fix crash when using 'i2c probe' 2021-02-21 06:05:08 +01:00
at91_i2c.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
cros_ec_ldo.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
cros_ec_tunnel.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
davinci_i2c.c dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO 2021-02-21 06:08:00 +01:00
davinci_i2c.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
designware_i2c_pci.c i2c: desigware: Add an alias for Intel Apollo Lake 2021-01-30 14:25:41 -07:00
designware_i2c.c i2c: designware: Remove unused non-DM functionality 2021-08-30 14:10:07 -04:00
designware_i2c.h WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
exynos_hs_i2c.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
fsl_i2c.c i2c: fsl_i2c: Migrate to Kconfig 2021-08-30 14:10:07 -04:00
i2c_core.c Convert CONFIG_SYS_I2C_EARLY_INIT to Kconfig 2021-08-30 14:10:07 -04:00
i2c-cdns.c i2c: i2c_cdns: Enable i2c clock 2021-02-23 14:56:59 +01:00
i2c-cortina.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
i2c-cortina.h i2c: i2c-cortina: added CAxxxx I2C support 2020-07-09 06:02:44 +02:00
i2c-emul-uclass.c treewide: Use OF_REAL instead of !OF_PLATDATA 2021-09-25 09:46:15 -06:00
i2c-gpio.c i2c: i2c-gpio: Support the named GPIO binding 2021-08-22 11:03:55 +02:00
i2c-uclass.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
i2c-uniphier-f.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
i2c-uniphier.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
i2c-versatile.c i2c: Update for new sequence numbers 2020-12-18 20:32:21 -07:00
ihs_i2c.c i2c: Remove non-DM code from ihs_i2c.c 2021-08-30 14:10:07 -04:00
imx_lpi2c.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
intel_i2c.c i2c: Update for new sequence numbers 2020-12-18 20:32:21 -07:00
iproc_i2c.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
iproc_i2c.h drivers: i2c: add brcm iproc I2C driver support 2020-04-20 06:52:28 +02:00
Kconfig i2c: Add a DM_I2C driver for the sun8i RSB controller 2021-10-12 10:19:18 +01:00
kona_i2c.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
lpc32xx_i2c.c lpc32xx: i2c: finish DM/OF code 2021-07-06 14:12:15 -04:00
Makefile i2c: Add a DM_I2C driver for the sun8i RSB controller 2021-10-12 10:19:18 +01:00
meson_i2c.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mv_i2c.c Convert CONFIG_SYS_I2C_SPEED et al to Kconfig 2021-08-30 14:10:07 -04:00
mv_i2c.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mvtwsi.c i2c: mvtwsi: Add support for DM clocks and resets 2021-09-28 06:34:27 +02:00
mxc_i2c.c WS cleanup: remove excessive empty lines 2021-09-30 08:08:56 -04:00
nx_i2c.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
ocores_i2c.c riscv: Add missing sentinel in ocores_i2c.c 2021-09-07 10:34:29 +08:00
octeon_i2c.c octeon: Don't attempt to set the sequence number 2020-12-18 20:32:21 -07:00
omap24xx_i2c.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
omap24xx_i2c.h i2c: omap: Update to use standard enums for speed 2020-01-27 07:23:26 +01:00
rcar_i2c.c i2c: rcar_i2c: Enable configuring SCL rise and fall times 2021-09-28 06:34:14 +02:00
rcar_iic.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
rk_i2c.c dm: Rename U_BOOT_DRIVER_ALIAS to DM_DRIVER_ALIAS 2021-01-05 12:26:35 -07:00
s3c24x0_i2c.c i2c: S3C24X0: Finish Kconfig migration 2021-08-30 14:10:05 -04:00
s3c24x0_i2c.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sandbox_i2c.c sandbox: i2c: Move priv into a header file 2021-01-05 12:24:41 -07:00
sh_i2c.c rcar: i2c: Migrate SYS_I2C_SH to Kconfig 2021-08-30 14:10:07 -04:00
soft_i2c.c i2c: Remove unused additional legacy soft i2c bus support 2021-08-30 14:10:06 -04:00
stm32f7_i2c.c i2c: stm32f7_i2c: migrate trace to dev and log macro 2021-01-13 09:52:58 +01:00
sun6i_p2wi.c i2c: Add a DM_I2C driver for the sun6i P2WI controller 2021-10-12 09:50:56 +01:00
sun8i_rsb.c i2c: Add a DM_I2C driver for the sun8i RSB controller 2021-10-12 10:19:18 +01:00
synquacer_i2c.c i2c: synquacer: SNI Synquacer I2C controller 2021-07-06 14:07:37 -04:00
tegra186_bpmp_i2c.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
tegra_i2c.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
xilinx_xiic.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00