* [PATCH 1/6] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips
2017-06-22 4:08 [PATCH 0/6] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
@ 2017-06-22 4:08 ` Chen-Yu Tsai
2017-06-26 18:36 ` Rob Herring
2017-07-17 10:41 ` Lee Jones
2017-06-22 4:08 ` [PATCH 2/6] dt-bindings: mfd: axp20x: Introduce bindings for AXP813 Chen-Yu Tsai
` (4 subsequent siblings)
5 siblings, 2 replies; 12+ messages in thread
From: Chen-Yu Tsai @ 2017-06-22 4:08 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Mark Rutland, Maxime Ripard
Cc: Chen-Yu Tsai, linux-kernel, devicetree, linux-arm-kernel,
linux-sunxi
The binding already lists compatibles and regulators for the AXP806,
but it is missing from the list of supported chips at the beginning.
Add it.
Fixes: 204ae2963e10 ("mfd: axp20x: Add bindings for AXP806 PMIC")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
Documentation/devicetree/bindings/mfd/axp20x.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index aca09af66514..211a100c6b20 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -7,6 +7,7 @@ axp209 (X-Powers)
axp221 (X-Powers)
axp223 (X-Powers)
axp803 (X-Powers)
+axp806 (X-Powers)
axp809 (X-Powers)
Required properties:
--
2.11.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 1/6] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips
2017-06-22 4:08 ` [PATCH 1/6] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
@ 2017-06-26 18:36 ` Rob Herring
2017-07-17 10:41 ` Lee Jones
1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring @ 2017-06-26 18:36 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Lee Jones, Mark Rutland, Maxime Ripard, linux-kernel, devicetree,
linux-arm-kernel, linux-sunxi
On Thu, Jun 22, 2017 at 12:08:28PM +0800, Chen-Yu Tsai wrote:
> The binding already lists compatibles and regulators for the AXP806,
> but it is missing from the list of supported chips at the beginning.
>
> Add it.
>
> Fixes: 204ae2963e10 ("mfd: axp20x: Add bindings for AXP806 PMIC")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
> Documentation/devicetree/bindings/mfd/axp20x.txt | 1 +
> 1 file changed, 1 insertion(+)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/6] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips
2017-06-22 4:08 ` [PATCH 1/6] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
2017-06-26 18:36 ` Rob Herring
@ 2017-07-17 10:41 ` Lee Jones
1 sibling, 0 replies; 12+ messages in thread
From: Lee Jones @ 2017-07-17 10:41 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Rob Herring, Mark Rutland, Maxime Ripard, linux-kernel,
devicetree, linux-arm-kernel, linux-sunxi
On Thu, 22 Jun 2017, Chen-Yu Tsai wrote:
> The binding already lists compatibles and regulators for the AXP806,
> but it is missing from the list of supported chips at the beginning.
>
> Add it.
>
> Fixes: 204ae2963e10 ("mfd: axp20x: Add bindings for AXP806 PMIC")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
> Documentation/devicetree/bindings/mfd/axp20x.txt | 1 +
> 1 file changed, 1 insertion(+)
For my own reference:
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index aca09af66514..211a100c6b20 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -7,6 +7,7 @@ axp209 (X-Powers)
> axp221 (X-Powers)
> axp223 (X-Powers)
> axp803 (X-Powers)
> +axp806 (X-Powers)
> axp809 (X-Powers)
>
> Required properties:
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/6] dt-bindings: mfd: axp20x: Introduce bindings for AXP813
2017-06-22 4:08 [PATCH 0/6] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
2017-06-22 4:08 ` [PATCH 1/6] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
@ 2017-06-22 4:08 ` Chen-Yu Tsai
2017-06-26 18:38 ` Rob Herring
2017-07-17 10:43 ` Lee Jones
2017-06-22 4:08 ` [PATCH 3/6] mfd: axp20x: Add support for AXP813 PMIC Chen-Yu Tsai
` (3 subsequent siblings)
5 siblings, 2 replies; 12+ messages in thread
From: Chen-Yu Tsai @ 2017-06-22 4:08 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Mark Rutland, Maxime Ripard
Cc: Chen-Yu Tsai, linux-kernel, devicetree, linux-arm-kernel,
linux-sunxi
The X-Powers AXP813 is a PMIC designed to be paired with Allwinner's
A83T SoC. There is also an AXP818, which is paired with the H8 SoC.
The two models seem to be identical, apart from the external markings.
This patch introduces the basic mfd and regulator bindings for the
AXP813.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
Documentation/devicetree/bindings/mfd/axp20x.txt | 49 +++++++++++++++++++++---
1 file changed, 44 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 211a100c6b20..1dff7e2ec375 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -9,6 +9,12 @@ axp223 (X-Powers)
axp803 (X-Powers)
axp806 (X-Powers)
axp809 (X-Powers)
+axp813 (X-Powers)
+
+The AXP813 is 2 chips packaged into 1. The 2 chips do not share anything
+other than the packaging. Pins are routed separately. As such they should
+be treated as separate entities. The other half is an AC100 RTC/codec
+combo chip. Please see ac100.txt for its bindings.
Required properties:
- compatible: should be one of:
@@ -20,6 +26,7 @@ Required properties:
* "x-powers,axp803"
* "x-powers,axp806"
* "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
@@ -29,12 +36,14 @@ Required properties:
Optional properties:
- x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz
AXP152/20X: range: 750-1875, Default: 1.5 MHz
- AXP22X/80X: range: 1800-4050, Default: 3 MHz
+ AXP22X/8XX: range: 1800-4050, Default: 3 MHz
-- x-powers,drive-vbus-en: axp221 / axp223 only boolean, set this when the
- N_VBUSEN pin is used as an output pin to control an external
- regulator to drive the OTG VBus, rather then as an input pin
- which signals whether the board is driving OTG VBus or not.
+- x-powers,drive-vbus-en: boolean, set this when the N_VBUSEN pin is
+ used as an output pin to control an external
+ regulator to drive the OTG VBus, rather then
+ as an input pin which signals whether the
+ board is driving OTG VBus or not.
+ (axp221 / axp223 / axp813 only)
- x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is
wired for master mode. The default is slave mode.
@@ -172,6 +181,36 @@ 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 : poly-phase capable
+DCDC3 : DC-DC buck : vin3-supply : poly-phase capable
+DCDC4 : DC-DC buck : vin4-supply
+DCDC5 : DC-DC buck : vin5-supply : poly-phase capable
+DCDC6 : DC-DC buck : vin6-supply : poly-phase capable
+DCDC7 : DC-DC buck : vin7-supply
+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
+FLDO3 : LDO : fldoin-supply : shared supply
+LDO_IO0 : LDO : ips-supply : GPIO 0
+LDO_IO1 : LDO : ips-supply : GPIO 1
+RTC_LDO : LDO : ips-supply : always on
+SW : On/Off Switch : swin-supply
+DRIVEVBUS : Enable output : drivevbus-supply : external regulator
+
Example:
axp209: pmic@34 {
--
2.11.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 2/6] dt-bindings: mfd: axp20x: Introduce bindings for AXP813
2017-06-22 4:08 ` [PATCH 2/6] dt-bindings: mfd: axp20x: Introduce bindings for AXP813 Chen-Yu Tsai
@ 2017-06-26 18:38 ` Rob Herring
2017-07-17 10:43 ` Lee Jones
1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring @ 2017-06-26 18:38 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Lee Jones, Mark Rutland, Maxime Ripard, linux-kernel, devicetree,
linux-arm-kernel, linux-sunxi
On Thu, Jun 22, 2017 at 12:08:29PM +0800, Chen-Yu Tsai wrote:
> The X-Powers AXP813 is a PMIC designed to be paired with Allwinner's
> A83T SoC. There is also an AXP818, which is paired with the H8 SoC.
>
> The two models seem to be identical, apart from the external markings.
>
> This patch introduces the basic mfd and regulator bindings for the
> AXP813.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
> Documentation/devicetree/bindings/mfd/axp20x.txt | 49 +++++++++++++++++++++---
> 1 file changed, 44 insertions(+), 5 deletions(-)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/6] dt-bindings: mfd: axp20x: Introduce bindings for AXP813
2017-06-22 4:08 ` [PATCH 2/6] dt-bindings: mfd: axp20x: Introduce bindings for AXP813 Chen-Yu Tsai
2017-06-26 18:38 ` Rob Herring
@ 2017-07-17 10:43 ` Lee Jones
1 sibling, 0 replies; 12+ messages in thread
From: Lee Jones @ 2017-07-17 10:43 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Rob Herring, Mark Rutland, Maxime Ripard, linux-kernel,
devicetree, linux-arm-kernel, linux-sunxi
On Thu, 22 Jun 2017, Chen-Yu Tsai wrote:
> The X-Powers AXP813 is a PMIC designed to be paired with Allwinner's
> A83T SoC. There is also an AXP818, which is paired with the H8 SoC.
>
> The two models seem to be identical, apart from the external markings.
>
> This patch introduces the basic mfd and regulator bindings for the
> AXP813.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
> Documentation/devicetree/bindings/mfd/axp20x.txt | 49 +++++++++++++++++++++---
> 1 file changed, 44 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 211a100c6b20..1dff7e2ec375 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -9,6 +9,12 @@ axp223 (X-Powers)
> axp803 (X-Powers)
> axp806 (X-Powers)
> axp809 (X-Powers)
> +axp813 (X-Powers)
> +
> +The AXP813 is 2 chips packaged into 1. The 2 chips do not share anything
> +other than the packaging. Pins are routed separately. As such they should
> +be treated as separate entities. The other half is an AC100 RTC/codec
> +combo chip. Please see ac100.txt for its bindings.
Please indicate where this lives using standard Linux syntax.
./ac100.txt
../<subsystem>/ac100.txt
etc.
Once that's been fixed, you may apply my:
For my own reference:
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/6] mfd: axp20x: Add support for AXP813 PMIC
2017-06-22 4:08 [PATCH 0/6] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
2017-06-22 4:08 ` [PATCH 1/6] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
2017-06-22 4:08 ` [PATCH 2/6] dt-bindings: mfd: axp20x: Introduce bindings for AXP813 Chen-Yu Tsai
@ 2017-06-22 4:08 ` Chen-Yu Tsai
2017-07-17 10:41 ` Lee Jones
2017-06-22 4:08 ` [PATCH 4/6] ARM: sun8i: a83t: Add device node and pinmux setting for RSB controller Chen-Yu Tsai
` (2 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Chen-Yu Tsai @ 2017-06-22 4:08 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Mark Rutland, Maxime Ripard
Cc: Chen-Yu Tsai, linux-kernel, devicetree, linux-arm-kernel,
linux-sunxi
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>
---
drivers/mfd/axp20x-rsb.c | 1 +
drivers/mfd/axp20x.c | 22 ++++++++++++++++++++++
include/linux/mfd/axp20x.h | 29 +++++++++++++++++++++++++++++
3 files changed, 52 insertions(+)
diff --git a/drivers/mfd/axp20x-rsb.c b/drivers/mfd/axp20x-rsb.c
index fd5c7267b136..7ddbd9e8dd03 100644
--- a/drivers/mfd/axp20x-rsb.c
+++ b/drivers/mfd/axp20x-rsb.c
@@ -64,6 +64,7 @@ static const struct of_device_id axp20x_rsb_of_match[] = {
{ .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
{ .compatible = "x-powers,axp806", .data = (void *)AXP806_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);
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;
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index 965b027e31b3..e9c908c4fba8 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -23,6 +23,7 @@ enum axp20x_variants {
AXP803_ID,
AXP806_ID,
AXP809_ID,
+ AXP813_ID,
NR_AXP20X_VARIANTS,
};
@@ -387,6 +388,34 @@ enum {
AXP803_REG_ID_MAX,
};
+enum {
+ AXP813_DCDC1 = 0,
+ AXP813_DCDC2,
+ AXP813_DCDC3,
+ AXP813_DCDC4,
+ AXP813_DCDC5,
+ AXP813_DCDC6,
+ AXP813_DCDC7,
+ 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_FLDO3,
+ AXP813_RTC_LDO,
+ AXP813_LDO_IO0,
+ AXP813_LDO_IO1,
+ AXP813_SW,
+ AXP813_REG_ID_MAX,
+};
+
/* IRQs */
enum {
AXP152_IRQ_LDO0IN_CONNECT = 1,
--
2.11.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 3/6] mfd: axp20x: Add support for AXP813 PMIC
2017-06-22 4:08 ` [PATCH 3/6] mfd: axp20x: Add support for AXP813 PMIC Chen-Yu Tsai
@ 2017-07-17 10:41 ` Lee Jones
0 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2017-07-17 10:41 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Rob Herring, Mark Rutland, Maxime Ripard, linux-kernel,
devicetree, linux-arm-kernel, linux-sunxi
On Thu, 22 Jun 2017, Chen-Yu Tsai wrote:
> 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>
> ---
> drivers/mfd/axp20x-rsb.c | 1 +
> drivers/mfd/axp20x.c | 22 ++++++++++++++++++++++
> include/linux/mfd/axp20x.h | 29 +++++++++++++++++++++++++++++
> 3 files changed, 52 insertions(+)
For my own reference:
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> diff --git a/drivers/mfd/axp20x-rsb.c b/drivers/mfd/axp20x-rsb.c
> index fd5c7267b136..7ddbd9e8dd03 100644
> --- a/drivers/mfd/axp20x-rsb.c
> +++ b/drivers/mfd/axp20x-rsb.c
> @@ -64,6 +64,7 @@ static const struct of_device_id axp20x_rsb_of_match[] = {
> { .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
> { .compatible = "x-powers,axp806", .data = (void *)AXP806_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);
> 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;
> diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
> index 965b027e31b3..e9c908c4fba8 100644
> --- a/include/linux/mfd/axp20x.h
> +++ b/include/linux/mfd/axp20x.h
> @@ -23,6 +23,7 @@ enum axp20x_variants {
> AXP803_ID,
> AXP806_ID,
> AXP809_ID,
> + AXP813_ID,
> NR_AXP20X_VARIANTS,
> };
>
> @@ -387,6 +388,34 @@ enum {
> AXP803_REG_ID_MAX,
> };
>
> +enum {
> + AXP813_DCDC1 = 0,
> + AXP813_DCDC2,
> + AXP813_DCDC3,
> + AXP813_DCDC4,
> + AXP813_DCDC5,
> + AXP813_DCDC6,
> + AXP813_DCDC7,
> + 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_FLDO3,
> + AXP813_RTC_LDO,
> + AXP813_LDO_IO0,
> + AXP813_LDO_IO1,
> + AXP813_SW,
> + AXP813_REG_ID_MAX,
> +};
> +
> /* IRQs */
> enum {
> AXP152_IRQ_LDO0IN_CONNECT = 1,
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/6] ARM: sun8i: a83t: Add device node and pinmux setting for RSB controller
2017-06-22 4:08 [PATCH 0/6] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
` (2 preceding siblings ...)
2017-06-22 4:08 ` [PATCH 3/6] mfd: axp20x: Add support for AXP813 PMIC Chen-Yu Tsai
@ 2017-06-22 4:08 ` Chen-Yu Tsai
2017-06-22 4:08 ` [PATCH 5/6] ARM: sun8i: a83t: Add device node for AXP813 PMIC Chen-Yu Tsai
2017-06-22 4:08 ` [PATCH 6/6] ARM: sun8i: a83t: Enable AC100 codec / RTC combo chip in " Chen-Yu Tsai
5 siblings, 0 replies; 12+ messages in thread
From: Chen-Yu Tsai @ 2017-06-22 4:08 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Mark Rutland, Maxime Ripard
Cc: Chen-Yu Tsai, linux-kernel, devicetree, linux-arm-kernel,
linux-sunxi
The A83T has an RSB controller for talking to the PMIC and audio codec.
Add a device node for it. Since there is only one usable pinmux setting,
for it, add that as well.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/boot/dts/sun8i-a83t.dtsi | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 21439d0aa55d..420b1484e17d 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -45,6 +45,7 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/sun8i-r-ccu.h>
+#include <dt-bindings/reset/sun8i-r-ccu.h>
/ {
interrupt-parent = <&gic>;
@@ -309,6 +310,27 @@
#gpio-cells = <3>;
interrupt-controller;
#interrupt-cells = <3>;
+
+ r_rsb_pins: r-rsb-pins {
+ pins = "PL0", "PL1";
+ function = "s_rsb";
+ drive-strength = <20>;
+ bias-pull-up;
+ };
+ };
+
+ r_rsb: rsb@1f03400 {
+ compatible = "allwinner,sun8i-a23-rsb";
+ reg = <0x01f03400 0x400>;
+ interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&r_ccu CLK_APB0_RSB>;
+ clock-frequency = <3000000>;
+ resets = <&r_ccu RST_APB0_RSB>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&r_rsb_pins>;
+ status = "disabled";
+ #address-cells = <1>;
+ #size-cells = <0>;
};
};
};
--
2.11.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 5/6] ARM: sun8i: a83t: Add device node for AXP813 PMIC
2017-06-22 4:08 [PATCH 0/6] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
` (3 preceding siblings ...)
2017-06-22 4:08 ` [PATCH 4/6] ARM: sun8i: a83t: Add device node and pinmux setting for RSB controller Chen-Yu Tsai
@ 2017-06-22 4:08 ` Chen-Yu Tsai
2017-06-22 4:08 ` [PATCH 6/6] ARM: sun8i: a83t: Enable AC100 codec / RTC combo chip in " Chen-Yu Tsai
5 siblings, 0 replies; 12+ messages in thread
From: Chen-Yu Tsai @ 2017-06-22 4:08 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Mark Rutland, Maxime Ripard
Cc: Chen-Yu Tsai, linux-kernel, devicetree, linux-arm-kernel,
linux-sunxi
The AXP813/AXP818 PMICs used with the A83T/H8 SoCs are actually 2 dies
in one package sharing the serial bus (I2C/RSB) pins. One die is the
actual PMIC. The other is an AC100 codec / RTC combo chip.
This patch adds a device node for the PMIC die.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
index cff33454fc24..027602ce03d1 100644
--- a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
@@ -102,6 +102,17 @@
};
};
+&r_rsb {
+ status = "okay";
+
+ axp813: pmic@3a3 {
+ compatible = "x-powers,axp813";
+ reg = <0x3a3>;
+ interrupt-parent = <&r_intc>;
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
&spdif {
status = "okay";
};
--
2.11.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6/6] ARM: sun8i: a83t: Enable AC100 codec / RTC combo chip in AXP813 PMIC
2017-06-22 4:08 [PATCH 0/6] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
` (4 preceding siblings ...)
2017-06-22 4:08 ` [PATCH 5/6] ARM: sun8i: a83t: Add device node for AXP813 PMIC Chen-Yu Tsai
@ 2017-06-22 4:08 ` Chen-Yu Tsai
5 siblings, 0 replies; 12+ messages in thread
From: Chen-Yu Tsai @ 2017-06-22 4:08 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Mark Rutland, Maxime Ripard
Cc: Chen-Yu Tsai, linux-kernel, devicetree, linux-arm-kernel,
linux-sunxi
The AXP813/AXP818 PMICs used with the A83T/H8 SoCs are actually 2 dies
in one package sharing the serial bus (I2C/RSB) pins. One die is the
actual PMIC. The other is an AC100 codec / RTC combo chip.
This patch enables the RSB controller and adds the device nodes for
the AC100 chip under it.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
index 027602ce03d1..933245758603 100644
--- a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
@@ -111,6 +111,30 @@
interrupt-parent = <&r_intc>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
};
+
+ ac100: codec@e89 {
+ compatible = "x-powers,ac100";
+ reg = <0xe89>;
+
+ ac100_codec: codec {
+ compatible = "x-powers,ac100-codec";
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */
+ #clock-cells = <0>;
+ clock-output-names = "4M_adda";
+ };
+
+ ac100_rtc: rtc {
+ compatible = "x-powers,ac100-rtc";
+ interrupt-parent = <&r_intc>;
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&ac100_codec>;
+ #clock-cells = <1>;
+ clock-output-names = "cko1_rtc",
+ "cko2_rtc",
+ "cko3_rtc";
+ };
+ };
};
&spdif {
--
2.11.0
^ permalink raw reply related [flat|nested] 12+ messages in thread