Skip to contentSkip to conversation

regulator: axp20x: support AXP813 variant

PATCH New Jean-Francois Moine 1 participant 1 message Jul 28, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: axp20x: support AXP813 variant

The X-Powers AXP813 PMIC is close enough to the AXP809 with some more outputs.

---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 32 ++++++++-
 drivers/mfd/axp20x-rsb.c                         |  1 +
 drivers/mfd/axp20x.c                             |  3 +
 drivers/regulator/axp20x-regulator.c             | 82 +++++++++++++++++++++++-
 include/linux/mfd/axp20x.h                       | 38 +++++++++++
 5 files changed, 153 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/mfd/axp20x.txt +31 -1
index 585a955..2a8ec61 100644
@@ -7,10 +7,12 @@ axp209 (X-Powers)
 axp221 (X-Powers)
 axp223 (X-Powers)
 axp809 (X-Powers)
+axp813 (X-Powers)
 
 Required properties:
 - compatible: "x-powers,axp152", "x-powers,axp202", "x-powers,axp209",
-	      "x-powers,axp221", "x-powers,axp223", "x-powers,axp809"
+	      "x-powers,axp221", "x-powers,axp223", "x-powers,axp809",
+	      "x-powers,axp813"
 - reg: The I2C slave address or RSB hardware address for the AXP chip
 - interrupt-parent: The parent interrupt controller
 - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
@@ -110,6 +112,34 @@ LDO_IO1		: LDO		: ips-supply		: GPIO 1
 RTC_LDO		: LDO		: ips-supply		: always on
 SW		: On/Off Switch : swin-supply
 
+AXP813 regulators, type, and corresponding input supply names:
+
+Regulator	  Type		  Supply Name		  Notes
+---------	  ----		  -----------		  -----
+DCDC1		: DC-DC buck	: vin1-supply
+DCDC2		: DC-DC buck	: vin2-supply
+DCDC3		: DC-DC	buck	: vin3-supply
+DCDC4		: DC-DC	buck	: vin4-supply
+DCDC5		: DC-DC	buck	: vin5-supply
+DCDC6		: DC-DC	buck	: vin6-supply
+DCDC7		: DC-DC	buck	: vin7-supply
+RTC_LDO		: LDO		: ips-supply		: always on
+ALDO1		: LDO		: aldoin-supply		: shared supply
+ALDO2		: LDO		: aldoin-supply		: shared supply
+ALDO3		: LDO		: aldoin-supply		: shared supply
+DLDO1		: LDO		: dldoin-supply		: shared supply
+DLDO2		: LDO		: dldoin-supply		: shared supply
+DLDO3		: LDO		: dldoin-supply		: shared supply
+DLDO4		: LDO		: dldoin-supply		: shared supply
+ELDO1		: LDO		: eldoin-supply		: shared supply
+ELDO2		: LDO		: eldoin-supply		: shared supply
+ELDO3		: LDO		: eldoin-supply		: shared supply
+FLDO1		: LDO		: fldoin-supply		: shared supply
+FLDO2		: LDO		: fldoin-supply		: shared supply
+LDO_IO0		: LDO		: ips-supply		: GPIO 0
+LDO_IO1		: LDO		: ips-supply		: GPIO 1
+DC1SW		: On/Off Switch	:			: DCDC1 secondary output
+
 Example:
 
 axp209: pmic at 34 {
drivers/mfd/axp20x-rsb.c +1 -0
index a407527..e34643b 100644
@@ -62,6 +62,7 @@ static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev)
 static const struct of_device_id axp20x_rsb_of_match[] = {
 	{ .compatible = "x-powers,axp223", .data = (void *)AXP223_ID },
 	{ .compatible = "x-powers,axp809", .data = (void *)AXP809_ID },
+	{ .compatible = "x-powers,axp813", .data = (void *)AXP813_ID },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, axp20x_rsb_of_match);
drivers/mfd/axp20x.c +3 -0
index fd80b09..e62d56f 100644
@@ -39,6 +39,7 @@ static const char * const axp20x_model_names[] = {
 	"AXP223",
 	"AXP288",
 	"AXP809",
+	"AXP813",
 };
 
 static const struct regmap_range axp152_writeable_ranges[] = {
@@ -494,6 +495,7 @@ static const struct regmap_irq_chip axp288_regmap_irq_chip = {
 
 };
 
+/* common 803/809/813 */
 static const struct regmap_irq_chip axp809_regmap_irq_chip = {
 	.name			= "axp809",
 	.status_base		= AXP20X_IRQ1_STATE,
@@ -733,6 +735,7 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
 		axp20x->regmap_irq_chip = &axp288_regmap_irq_chip;
 		break;
 	case AXP809_ID:
+	case AXP813_ID:
 		axp20x->nr_cells = ARRAY_SIZE(axp809_cells);
 		axp20x->cells = axp809_cells;
 		axp20x->regmap_cfg = &axp22x_regmap_config;
drivers/regulator/axp20x-regulator.c +80 -2

106 lines not on this page · raw message

include/linux/mfd/axp20x.h +38 -0
index 0be4982..637fb7c 100644
@@ -21,6 +21,7 @@ enum {
 	AXP223_ID,
 	AXP288_ID,
 	AXP809_ID,
+	AXP813_ID,
 	NR_AXP20X_VARIANTS,
 };
 
@@ -91,6 +92,16 @@ enum {
 #define AXP22X_ALDO3_V_OUT		0x2a
 #define AXP22X_CHRG_CTRL3		0x35
 
+#define AXP813_FLDO1_V_OUT		0x1c
+#define AXP813_FLDO2_V_OUT		0x1d
+#define AXP813_DCDC1_V_OUT		0x20
+#define AXP813_DCDC2_V_OUT		0x21
+#define AXP813_DCDC3_V_OUT		0x22
+#define AXP813_DCDC4_V_OUT		0x23
+#define AXP813_DCDC5_V_OUT		0x24
+#define AXP813_DCDC6_V_OUT		0x25
+#define AXP813_DCDC7_V_OUT		0x26
+
 /* Interrupt */
 #define AXP152_IRQ1_EN			0x40
 #define AXP152_IRQ2_EN			0x41
@@ -288,6 +299,33 @@ enum {
 	AXP809_REG_ID_MAX,
 };
 
+enum {
+	AXP813_DCDC1 = 0,
+	AXP813_DCDC2,
+	AXP813_DCDC3,
+	AXP813_DCDC4,
+	AXP813_DCDC5,
+	AXP813_DCDC6,
+	AXP813_DCDC7,
+	AXP813_RTC_LDO,
+	AXP813_ALDO1,
+	AXP813_ALDO2,
+	AXP813_ALDO3,
+	AXP813_DLDO1,
+	AXP813_DLDO2,
+	AXP813_DLDO3,
+	AXP813_DLDO4,
+	AXP813_ELDO1,
+	AXP813_ELDO2,
+	AXP813_ELDO3,
+	AXP813_FLDO1,
+	AXP813_FLDO2,
+	AXP813_LDO_IO0,
+	AXP813_LDO_IO1,
+	AXP813_DC1SW,
+	AXP813_REG_ID_MAX,
+};
+
 /* IRQs */
 enum {
 	AXP152_IRQ_LDO0IN_CONNECT = 1,
Signature · 1 line
2.9.2