Add the descriptions for the DC/DC regulators of the AXP318W, and enable
it when CONFIG_AXP318W_POWER is enabled.

Signed-off-by: Yixun Lan <[email protected]>
---
 drivers/power/Makefile  |  1 +
 drivers/power/axp_spl.c | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 3363191fdc8..1a54898c874 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_AXP152_POWER)    += axp152.o
 obj-$(CONFIG_AXP209_POWER)     += axp209.o
 obj-$(CONFIG_AXP305_POWER)     += axp_spl.o
 obj-$(CONFIG_AXP313_POWER)     += axp_spl.o
+obj-$(CONFIG_AXP318W_POWER)    += axp_spl.o
 obj-$(CONFIG_AXP717_POWER)     += axp_spl.o
 obj-$(CONFIG_AXP809_POWER)     += axp809.o
 obj-$(CONFIG_AXP818_POWER)     += axp818.o
diff --git a/drivers/power/axp_spl.c b/drivers/power/axp_spl.c
index 7c51a9b3dfb..790eab8e262 100644
--- a/drivers/power/axp_spl.c
+++ b/drivers/power/axp_spl.c
@@ -67,6 +67,26 @@ 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_AXP318W_POWER)                            /* AXP318W */
+
+static const struct axp_reg_desc_spl axp_spl_dcdc_regulators[] = {
+       { 0x10, BIT(0), 0x12, 0x1f, 1000, 3400, 100,  0 },
+       { 0x10, BIT(1), 0x13, 0x7f, 500,  1540,  10, 70 },
+       { 0x10, BIT(2), 0x14, 0x7f, 500,  1540,  10, 70 },
+       { 0x10, BIT(3), 0x15, 0x7f, 500,  1540,  10, 70 },
+       { 0x10, BIT(4), 0x16, 0x7f, 500,  1540,  10, 70 },
+       { 0x10, BIT(5), 0x17, 0x7f, 500,  1540,  10, 70 },
+       { 0x10, BIT(6), 0x18, 0x7f, 500,  1840,  10, 70 },
+       { 0x10, BIT(7), 0x19, 0x7f, 500,  1840,  10, 70 },
+       { 0x11, BIT(0), 0x1a, 0x7f, 500,  1840,  10, 70 },
+};
+
+#define AXP_CHIP_VERSION       0
+#define AXP_CHIP_VERSION_MASK  0
+#define AXP_CHIP_ID            0
+#define AXP_SHUTDOWN_REG       0x55
+#define AXP_SHUTDOWN_MASK      BIT(7)
+
 #elif defined(CONFIG_AXP305_POWER)                             /* AXP305 */
 
 static const struct axp_reg_desc_spl axp_spl_dcdc_regulators[] = {

-- 
2.51.2

Reply via email to