From f5a7532676a64a23e1c1cd7729ccf600e9557b7a Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Tue, 14 May 2024 00:47:09 +0100 Subject: power: pmic: sunxi: use generic AXP SPL driver for AXP305 The generic AXP SPL driver implementation can cover all regulators we need for the AXP305. Add the descriptions for four of the six DC/DC regulators of the AXP305, and enable that when CONFIG_AXP305_POWER is enabled. We won't need DCDC2 and DCDC3, but by using the position in the array for the index we keep the code cleaner. Also remove the old driver, and switch the Makefile to include the new, generic driver. Signed-off-by: Andre Przywara --- drivers/power/axp_spl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers/power/axp_spl.c') diff --git a/drivers/power/axp_spl.c b/drivers/power/axp_spl.c index 68cbf60eedf..3c86eb20ab4 100644 --- a/drivers/power/axp_spl.c +++ b/drivers/power/axp_spl.c @@ -50,6 +50,22 @@ static const struct axp_reg_desc_spl axp_spl_dcdc_regulators[] = { #define AXP_SHUTDOWN_REG 0x1a #define AXP_SHUTDOWN_MASK BIT(7) +#elif defined(CONFIG_AXP305_POWER) /* AXP305 */ + +static const struct axp_reg_desc_spl axp_spl_dcdc_regulators[] = { + { 0x10, BIT(0), 0x12, 0x7f, 600, 1520, 10, 50 }, + { 0x10, BIT(1), 0x13, 0x1f, 1000, 2550, 50, NA }, + { 0x10, BIT(2), 0x14, 0x7f, 600, 1520, 10, 50 }, + { 0x10, BIT(3), 0x15, 0x3f, 600, 1500, 20, NA }, + { 0x10, BIT(4), 0x16, 0x1f, 1100, 3400, 100, NA }, +}; + +#define AXP_CHIP_VERSION 0x3 +#define AXP_CHIP_VERSION_MASK 0xcf +#define AXP_CHIP_ID 0x40 +#define AXP_SHUTDOWN_REG 0x32 +#define AXP_SHUTDOWN_MASK BIT(7) + #else #error "Please define the regulator registers in axp_spl_regulators[]." -- cgit v1.2.3