aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/axp20x.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2017-07-26 16:28:26 +0800
committerLee Jones <lee.jones@linaro.org>2017-09-05 08:46:00 +0100
commit7303733a6ca2a68b210ebdc09cace8b0ffe8b179 (patch)
treefcec4906f2371b4ee7ff08a3a0107d64c7e8859a /drivers/mfd/axp20x.c
parentdt-bindings: mfd: axp20x: Add AXP806 to supported list of chips (diff)
downloadlinux-dev-7303733a6ca2a68b210ebdc09cace8b0ffe8b179.tar.xz
linux-dev-7303733a6ca2a68b210ebdc09cace8b0ffe8b179.zip
mfd: axp20x: Add support for AXP813 PMIC
The X-Powers AXP813 PMIC is normally used with Allwinner's A83T SoC. It has the same range of functions as other X-Powers PMICs, such as DC-DC buck converter and linear regulator outputs, AC-IN and VBUS power supplies, power button trigger, GPIOs, ADCs, and a battery charger. Note that the IRQ table given in the datasheet is incorrect: in IRQ enable/status registers 1, there are separate IRQs for ACIN and VBUS, instead of bits [7:5] being the same as bits [4:2]. So it shares the same IRQs as the AXP803, rather than the AXP288. This patch adds basic mfd support for it, with only the power button enabled. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/axp20x.c')
-rw-r--r--drivers/mfd/axp20x.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 917b6ddc4f15..ec4271ca065c 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -44,6 +44,7 @@ static const char * const axp20x_model_names[] = {
"AXP803",
"AXP806",
"AXP809",
+ "AXP813",
};
static const struct regmap_range axp152_writeable_ranges[] = {
@@ -870,6 +871,14 @@ static struct mfd_cell axp809_cells[] = {
},
};
+static struct mfd_cell axp813_cells[] = {
+ {
+ .name = "axp20x-pek",
+ .num_resources = ARRAY_SIZE(axp803_pek_resources),
+ .resources = axp803_pek_resources,
+ }
+};
+
static struct axp20x_dev *axp20x_pm_power_off;
static void axp20x_power_off(void)
{
@@ -956,6 +965,19 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
axp20x->regmap_cfg = &axp22x_regmap_config;
axp20x->regmap_irq_chip = &axp809_regmap_irq_chip;
break;
+ case AXP813_ID:
+ axp20x->nr_cells = ARRAY_SIZE(axp813_cells);
+ axp20x->cells = axp813_cells;
+ axp20x->regmap_cfg = &axp288_regmap_config;
+ /*
+ * The IRQ table given in the datasheet is incorrect.
+ * In IRQ enable/status registers 1, there are separate
+ * IRQs for ACIN and VBUS, instead of bits [7:5] being
+ * the same as bits [4:2]. So it shares the same IRQs
+ * as the AXP803, rather than the AXP288.
+ */
+ axp20x->regmap_irq_chip = &axp803_regmap_irq_chip;
+ break;
default:
dev_err(dev, "unsupported AXP20X ID %lu\n", axp20x->variant);
return -EINVAL;