[PATCH 02/11] i2c: Add a DM_I2C wrapper for the sun8i_rsb controller

Heiko Schocher hs at denx.de
Sun Aug 22 10:40:11 CEST 2021


Hello Samuel,

On 22.08.21 01:05, Samuel Holland wrote:
> 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.
> 
> Since the non-DM bus controller driver is still needed in SPL, the quick
> solution is to implement the DM_I2C ops using the existing functions.
> 
> 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 at sholland.org>
> ---
> 
>  arch/arm/mach-sunxi/Kconfig    |  8 ----
>  arch/arm/mach-sunxi/pmic_bus.c | 11 ++---
>  drivers/i2c/Kconfig            |  8 ++++
>  drivers/i2c/Makefile           |  1 +
>  drivers/i2c/sun8i_rsb.c        | 86 ++++++++++++++++++++++++++++++++++
>  include/axp_pmic.h             |  6 +++
>  6 files changed, 105 insertions(+), 15 deletions(-)
>  create mode 100644 drivers/i2c/sun8i_rsb.c

Same comments as for path 1 of this series, beside of this:

Reviewed-by: Heiko Schocher <hs at denx.de>

bye,
Heiko

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de


More information about the U-Boot mailing list