summaryrefslogtreecommitdiff
path: root/drivers/power/axp_spl.c
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2024-05-14 00:47:09 +0100
committerAndre Przywara <andre.przywara@arm.com>2024-07-15 18:11:37 +0100
commitf5a7532676a64a23e1c1cd7729ccf600e9557b7a (patch)
treef402ad523e87134e04a81a743ae0bea10bf54945 /drivers/power/axp_spl.c
parent670c0324a1b570088cfb34523d5edd295fbc60c9 (diff)
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 <andre.przywara@arm.com>
Diffstat (limited to 'drivers/power/axp_spl.c')
-rw-r--r--drivers/power/axp_spl.c16
1 files changed, 16 insertions, 0 deletions
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[]."