From 549c497a4639f7f969f2e56e0fa9ef2fa3b8ce1a Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Tue, 18 Mar 2025 00:39:43 +0000 Subject: sunxi: pmic_bus: Move SPL I2C addresses into Kconfig Some of the X-Power AXP PMICs can be ordered with an alternative I2C address, for instance an AXP717 could be shipped with address 0x34 or with address 0x35. Similarly the AXP803 lists two possible addresses. For DM (DT) based drivers this is no problem, but the Allwinner SPL code relies on exactly one hardcoded address per PMIC so far. Add a Kconfig variable that holds the I2C address used by the PMIC accessed in the SPL, and provide the (mostly only one) supported address as its default, for the PMICs we use. Boards using the other address can easily set this in their defconfig. This effectively moves the hardcoding from C code to Kconfig. That enables to use the AXP717 on some boards with the new Allwinner A523 chip, which use the other I2C address there. Signed-off-by: Andre Przywara Reviewed-by: Heiko Schocher --- drivers/power/Kconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 5c73bc75a15..eed65058e66 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -148,6 +148,16 @@ config SY8106A_POWER endchoice +config AXP_I2C_ADDRESS + hex "AXP PMIC I2C address" + depends on ARCH_SUNXI && !SUNXI_NO_PMIC + default 0x36 if AXP305_POWER + default 0x36 if AXP313_POWER + default 0x30 if AXP152_POWER + default 0x34 + ---help--- + I2C address of the AXP PMIC, used for the SPL only. + config AXP_DCDC1_VOLT int "axp pmic dcdc1 voltage" depends on AXP221_POWER || AXP809_POWER || AXP818_POWER || AXP803_POWER -- cgit v1.3.1