linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813
@ 2017-07-26  8:28 Chen-Yu Tsai
  2017-07-26  8:28 ` [PATCH v2 1/9] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, Maxime Ripard
  Cc: Chen-Yu Tsai, linux-kernel, devicetree, linux-arm-kernel, linux-sunxi

Hi everyone,

This is v2 of my AXP813 support series. The device tree patches are
based on my A83T MMC support series. These will go through the sunxi
tree. The dt-binding and mfd patches are based on v4.13-rc1. These
will go through Lee's mfd tree.

Changes since v1:

  - Provided relative path for ac100.txt in dt-bindings/mfd/axp20x.txt

  - Added Rob's acks to dt-binding patches

  - Added Quentin's "mfd: axp20x: use correct platform device id for
    many PEK" patch to this series. This patch depends on mfd changes
    in this series. It is included so Lee can take them together in
    one go.

  - Added Lee's mfd-acks to mfd patches

  - Added axp818 compatible with axp813 fallback. The two chips are
    identical except for the markings. The added compatible matches
    what is actually on the board, to avoid confusing readers.

  - Fixed up device tree patches to mention which board is changed

  - Added device tree patches for the H8 homlet

Patch 1 adds AXP806 to the main list of supported chips, which was
missing.

Patch 2 adds bindings for the AXP813.

Patch 3 adds basic mfd driver support with PEK enabled for AXP813.

Patch 4 changes the PEK sub-device's platform ID for AXP22x and
later PMICs. This is included as it depends on the previous patch.

Patch 5 adds the device node and pinmux settings for the RSB controller
on the A83T. This is used to communicate with the PMIC.

Patch 6 adds a device node for the PMIC part of the chip for the
Cubietruck Plus.

Patch 7 adds a device node for the embedded AC100 part of the chip
for the Cubietruck Plus.

Patch 8 adds a device node for the PMIC part of the chip for the
H8 homlet board.

Patch 9 adds a device node for the embedded AC100 part of the chip
for the H8 homlet board.


Excerpt from original cover letter from v1:

This series adds basic device tree bindings and driver support for the
AXP813/818 PMICs. The two models are identical when comparing their
datasheets. These PMICs are actually two dies in one package: one being
the actual PMIC, the other being an AC100 codec/RTC combo chip. The
latter has its own device tree binding.

This series only adds the basic parts of the device tree binding and
driver. For the bindings, only the core and regulator bits are added.
Any sub-devices that have their own binding will be updated later on.
For the driver, only the mfd part with a basic power button (PEK) cell
is added, along with regulator IDs.


Regards
ChenYu

Chen-Yu Tsai (8):
  dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips
  dt-bindings: mfd: axp20x: Introduce bindings for AXP813
  mfd: axp20x: Add support for AXP813 PMIC
  ARM: sun8i: a83t: Add device node and pinmux setting for RSB
    controller
  ARM: sun8i: a83t: cubietruck-plus: Enable PMIC part of AXP818 PMIC
  ARM: sun8i: a83t: cubietruck-plus: Enable AC100 combo chip in AXP818
    PMIC
  ARM: sun8i: a83t: h8homlet-v2: Enable PMIC part of AXP818 PMIC
  ARM: sun8i: a83t: h8homlet-v2: Enable AC100 combo chip in AXP818 PMIC

Quentin Schulz (1):
  mfd: axp20x: use correct platform device id for many PEK

 Documentation/devicetree/bindings/mfd/axp20x.txt   | 50 +++++++++++++++++++---
 .../boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts  | 35 +++++++++++++++
 arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts   | 35 +++++++++++++++
 arch/arm/boot/dts/sun8i-a83t.dtsi                  | 23 ++++++++++
 drivers/mfd/axp20x-rsb.c                           |  1 +
 drivers/mfd/axp20x.c                               | 32 +++++++++++---
 include/linux/mfd/axp20x.h                         | 29 +++++++++++++
 7 files changed, 195 insertions(+), 10 deletions(-)

-- 
2.13.3

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v2 1/9] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-08-07 15:43   ` Lee Jones
  2017-07-26  8:28 ` [PATCH v2 2/9] dt-bindings: mfd: axp20x: Introduce bindings for AXP813 Chen-Yu Tsai
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, 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>
Acked-by: Rob Herring <robh@kernel.org>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.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.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 2/9] dt-bindings: mfd: axp20x: Introduce bindings for AXP813
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
  2017-07-26  8:28 ` [PATCH v2 1/9] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-08-07 15:43   ` Lee Jones
  2017-07-26  8:28 ` [PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC Chen-Yu Tsai
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, 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>
Acked-by: Rob Herring <robh@kernel.org>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.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..9455503b0299 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.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
  2017-07-26  8:28 ` [PATCH v2 1/9] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
  2017-07-26  8:28 ` [PATCH v2 2/9] dt-bindings: mfd: axp20x: Introduce bindings for AXP813 Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-08-07 15:43   ` Lee Jones
  2017-07-26  8:28 ` [PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK Chen-Yu Tsai
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, 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>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.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.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2017-07-26  8:28 ` [PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-08-07 15:43   ` Lee Jones
  2017-07-26  8:28 ` [PATCH v2 5/9] ARM: sun8i: a83t: Add device node and pinmux setting for RSB controller Chen-Yu Tsai
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, Maxime Ripard
  Cc: Quentin Schulz, linux-kernel, devicetree, linux-arm-kernel,
	linux-sunxi, Chen-Yu Tsai

From: Quentin Schulz <quentin.schulz@free-electrons.com>

According to their datasheets, the AXP221, AXP223, AXP288, AXP803,
AXP809 and AXP813 PEK have different values for startup time bits from
the AXP20X, let's use the platform device id with the correct values.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/mfd/axp20x.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index ec4271ca065c..336de66ca408 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -677,7 +677,7 @@ static struct mfd_cell axp20x_cells[] = {
 
 static struct mfd_cell axp221_cells[] = {
 	{
-		.name		= "axp20x-pek",
+		.name		= "axp221-pek",
 		.num_resources	= ARRAY_SIZE(axp22x_pek_resources),
 		.resources	= axp22x_pek_resources,
 	}, {
@@ -702,7 +702,7 @@ static struct mfd_cell axp221_cells[] = {
 
 static struct mfd_cell axp223_cells[] = {
 	{
-		.name			= "axp20x-pek",
+		.name			= "axp221-pek",
 		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
 		.resources		= axp22x_pek_resources,
 	}, {
@@ -835,7 +835,7 @@ static struct mfd_cell axp288_cells[] = {
 		.resources = axp288_fuel_gauge_resources,
 	},
 	{
-		.name = "axp20x-pek",
+		.name = "axp221-pek",
 		.num_resources = ARRAY_SIZE(axp288_power_button_resources),
 		.resources = axp288_power_button_resources,
 	},
@@ -846,7 +846,7 @@ static struct mfd_cell axp288_cells[] = {
 
 static struct mfd_cell axp803_cells[] = {
 	{
-		.name			= "axp20x-pek",
+		.name			= "axp221-pek",
 		.num_resources		= ARRAY_SIZE(axp803_pek_resources),
 		.resources		= axp803_pek_resources,
 	},
@@ -862,7 +862,7 @@ static struct mfd_cell axp806_cells[] = {
 
 static struct mfd_cell axp809_cells[] = {
 	{
-		.name			= "axp20x-pek",
+		.name			= "axp221-pek",
 		.num_resources		= ARRAY_SIZE(axp809_pek_resources),
 		.resources		= axp809_pek_resources,
 	}, {
@@ -873,7 +873,7 @@ static struct mfd_cell axp809_cells[] = {
 
 static struct mfd_cell axp813_cells[] = {
 	{
-		.name			= "axp20x-pek",
+		.name			= "axp221-pek",
 		.num_resources		= ARRAY_SIZE(axp803_pek_resources),
 		.resources		= axp803_pek_resources,
 	}
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 5/9] ARM: sun8i: a83t: Add device node and pinmux setting for RSB controller
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
                   ` (3 preceding siblings ...)
  2017-07-26  8:28 ` [PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-07-26  8:28 ` [PATCH v2 6/9] ARM: sun8i: a83t: cubietruck-plus: Enable PMIC part of AXP818 PMIC Chen-Yu Tsai
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, 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 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index d9b4372dbdf3..61304761e8f6 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -47,6 +47,7 @@
 #include <dt-bindings/clock/sun8i-a83t-ccu.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/reset/sun8i-a83t-ccu.h>
+#include <dt-bindings/reset/sun8i-r-ccu.h>
 
 / {
 	interrupt-parent = <&gic>;
@@ -379,6 +380,28 @@
 			#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-a83t-rsb",
+				     "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.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 6/9] ARM: sun8i: a83t: cubietruck-plus: Enable PMIC part of AXP818 PMIC
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
                   ` (4 preceding siblings ...)
  2017-07-26  8:28 ` [PATCH v2 5/9] ARM: sun8i: a83t: Add device node and pinmux setting for RSB controller Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-07-26  8:28 ` [PATCH v2 7/9] ARM: sun8i: a83t: cubietruck-plus: Enable AC100 combo chip in " Chen-Yu Tsai
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, 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 a device node for the
PMIC die to the Cubietruck Plus device tree. Since the AXP813 and
AXP818 are virtually identical, this patch uses the compatible string
for the former as a fallback.

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 163ddf8868b5..d88a22ac6222 100644
--- a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
@@ -129,6 +129,17 @@
 	status = "okay";
 };
 
+&r_rsb {
+	status = "okay";
+
+	axp81x: pmic@3a3 {
+		compatible = "x-powers,axp818", "x-powers,axp813";
+		reg = <0x3a3>;
+		interrupt-parent = <&r_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
 &spdif {
 	status = "okay";
 };
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 7/9] ARM: sun8i: a83t: cubietruck-plus: Enable AC100 combo chip in AXP818 PMIC
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
                   ` (5 preceding siblings ...)
  2017-07-26  8:28 ` [PATCH v2 6/9] ARM: sun8i: a83t: cubietruck-plus: Enable PMIC part of AXP818 PMIC Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-07-26  8:28 ` [PATCH v2 8/9] ARM: sun8i: a83t: h8homlet-v2: Enable PMIC part of " Chen-Yu Tsai
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, 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 the device nodes for the AC100 chip to the Cubietruck
Plus device tree.

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 d88a22ac6222..f583e5b9a1c8 100644
--- a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
@@ -138,6 +138,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.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 8/9] ARM: sun8i: a83t: h8homlet-v2: Enable PMIC part of AXP818 PMIC
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
                   ` (6 preceding siblings ...)
  2017-07-26  8:28 ` [PATCH v2 7/9] ARM: sun8i: a83t: cubietruck-plus: Enable AC100 combo chip in " Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-07-26  8:28 ` [PATCH v2 9/9] ARM: sun8i: a83t: h8homlet-v2: Enable AC100 combo chip in " Chen-Yu Tsai
  2017-07-26  8:32 ` [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Maxime Ripard
  9 siblings, 0 replies; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, 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 a device node for the
PMIC die to the h8homlet-v2 device tree. Since the AXP813 and AXP818
are virtually identical, this patch uses the compatible string for
the former as a fallback.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts b/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
index 7afbaa4eea8d..7e92baa63f1c 100644
--- a/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
@@ -78,6 +78,17 @@
 	status = "okay";
 };
 
+&r_rsb {
+	status = "okay";
+
+	axp81x: pmic@3a3 {
+		compatible = "x-powers,axp818", "x-powers,axp813";
+		reg = <0x3a3>;
+		interrupt-parent = <&r_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pb_pins>;
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 9/9] ARM: sun8i: a83t: h8homlet-v2: Enable AC100 combo chip in AXP818 PMIC
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
                   ` (7 preceding siblings ...)
  2017-07-26  8:28 ` [PATCH v2 8/9] ARM: sun8i: a83t: h8homlet-v2: Enable PMIC part of " Chen-Yu Tsai
@ 2017-07-26  8:28 ` Chen-Yu Tsai
  2017-07-26  8:32 ` [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Maxime Ripard
  9 siblings, 0 replies; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-07-26  8:28 UTC (permalink / raw)
  To: Lee Jones, 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 the device nodes for the AC100 chip to the h8homlet-v2
device tree.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 .../boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts  | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts b/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
index 7e92baa63f1c..e0055180d29f 100644
--- a/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
@@ -87,6 +87,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";
+		};
+	};
 };
 
 &uart0 {
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813
  2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
                   ` (8 preceding siblings ...)
  2017-07-26  8:28 ` [PATCH v2 9/9] ARM: sun8i: a83t: h8homlet-v2: Enable AC100 combo chip in " Chen-Yu Tsai
@ 2017-07-26  8:32 ` Maxime Ripard
  2017-08-08  4:05   ` Chen-Yu Tsai
  9 siblings, 1 reply; 16+ messages in thread
From: Maxime Ripard @ 2017-07-26  8:32 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, linux-kernel, devicetree, linux-arm-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

On Wed, Jul 26, 2017 at 04:28:23PM +0800, Chen-Yu Tsai wrote:
> Hi everyone,
> 
> This is v2 of my AXP813 support series. The device tree patches are
> based on my A83T MMC support series. These will go through the sunxi
> tree. The dt-binding and mfd patches are based on v4.13-rc1. These
> will go through Lee's mfd tree.
> 
> Changes since v1:
> 
>   - Provided relative path for ac100.txt in dt-bindings/mfd/axp20x.txt
> 
>   - Added Rob's acks to dt-binding patches
> 
>   - Added Quentin's "mfd: axp20x: use correct platform device id for
>     many PEK" patch to this series. This patch depends on mfd changes
>     in this series. It is included so Lee can take them together in
>     one go.
> 
>   - Added Lee's mfd-acks to mfd patches
> 
>   - Added axp818 compatible with axp813 fallback. The two chips are
>     identical except for the markings. The added compatible matches
>     what is actually on the board, to avoid confusing readers.
> 
>   - Fixed up device tree patches to mention which board is changed
> 
>   - Added device tree patches for the H8 homlet

For the whole serie,
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/9] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips
  2017-07-26  8:28 ` [PATCH v2 1/9] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
@ 2017-08-07 15:43   ` Lee Jones
  0 siblings, 0 replies; 16+ messages in thread
From: Lee Jones @ 2017-08-07 15:43 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, linux-kernel, devicetree, linux-arm-kernel, linux-sunxi

On Wed, 26 Jul 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>
> Acked-by: Rob Herring <robh@kernel.org>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

> 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] 16+ messages in thread

* Re: [PATCH v2 2/9] dt-bindings: mfd: axp20x: Introduce bindings for AXP813
  2017-07-26  8:28 ` [PATCH v2 2/9] dt-bindings: mfd: axp20x: Introduce bindings for AXP813 Chen-Yu Tsai
@ 2017-08-07 15:43   ` Lee Jones
  0 siblings, 0 replies; 16+ messages in thread
From: Lee Jones @ 2017-08-07 15:43 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, linux-kernel, devicetree, linux-arm-kernel, linux-sunxi

On Wed, 26 Jul 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>
> Acked-by: Rob Herring <robh@kernel.org>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 49 +++++++++++++++++++++---
>  1 file changed, 44 insertions(+), 5 deletions(-)

Applied, thanks.

> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 211a100c6b20..9455503b0299 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 {

-- 
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] 16+ messages in thread

* Re: [PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC
  2017-07-26  8:28 ` [PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC Chen-Yu Tsai
@ 2017-08-07 15:43   ` Lee Jones
  0 siblings, 0 replies; 16+ messages in thread
From: Lee Jones @ 2017-08-07 15:43 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, linux-kernel, devicetree, linux-arm-kernel, linux-sunxi

On Wed, 26 Jul 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>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/axp20x-rsb.c   |  1 +
>  drivers/mfd/axp20x.c       | 22 ++++++++++++++++++++++
>  include/linux/mfd/axp20x.h | 29 +++++++++++++++++++++++++++++
>  3 files changed, 52 insertions(+)

Applied, thanks.

> 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] 16+ messages in thread

* Re: [PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK
  2017-07-26  8:28 ` [PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK Chen-Yu Tsai
@ 2017-08-07 15:43   ` Lee Jones
  0 siblings, 0 replies; 16+ messages in thread
From: Lee Jones @ 2017-08-07 15:43 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Quentin Schulz, linux-kernel, devicetree,
	linux-arm-kernel, linux-sunxi

On Wed, 26 Jul 2017, Chen-Yu Tsai wrote:

> From: Quentin Schulz <quentin.schulz@free-electrons.com>
> 
> According to their datasheets, the AXP221, AXP223, AXP288, AXP803,
> AXP809 and AXP813 PEK have different values for startup time bits from
> the AXP20X, let's use the platform device id with the correct values.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  drivers/mfd/axp20x.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index ec4271ca065c..336de66ca408 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -677,7 +677,7 @@ static struct mfd_cell axp20x_cells[] = {
>  
>  static struct mfd_cell axp221_cells[] = {
>  	{
> -		.name		= "axp20x-pek",
> +		.name		= "axp221-pek",
>  		.num_resources	= ARRAY_SIZE(axp22x_pek_resources),
>  		.resources	= axp22x_pek_resources,
>  	}, {
> @@ -702,7 +702,7 @@ static struct mfd_cell axp221_cells[] = {
>  
>  static struct mfd_cell axp223_cells[] = {
>  	{
> -		.name			= "axp20x-pek",
> +		.name			= "axp221-pek",
>  		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
>  		.resources		= axp22x_pek_resources,
>  	}, {
> @@ -835,7 +835,7 @@ static struct mfd_cell axp288_cells[] = {
>  		.resources = axp288_fuel_gauge_resources,
>  	},
>  	{
> -		.name = "axp20x-pek",
> +		.name = "axp221-pek",
>  		.num_resources = ARRAY_SIZE(axp288_power_button_resources),
>  		.resources = axp288_power_button_resources,
>  	},
> @@ -846,7 +846,7 @@ static struct mfd_cell axp288_cells[] = {
>  
>  static struct mfd_cell axp803_cells[] = {
>  	{
> -		.name			= "axp20x-pek",
> +		.name			= "axp221-pek",
>  		.num_resources		= ARRAY_SIZE(axp803_pek_resources),
>  		.resources		= axp803_pek_resources,
>  	},
> @@ -862,7 +862,7 @@ static struct mfd_cell axp806_cells[] = {
>  
>  static struct mfd_cell axp809_cells[] = {
>  	{
> -		.name			= "axp20x-pek",
> +		.name			= "axp221-pek",
>  		.num_resources		= ARRAY_SIZE(axp809_pek_resources),
>  		.resources		= axp809_pek_resources,
>  	}, {
> @@ -873,7 +873,7 @@ static struct mfd_cell axp809_cells[] = {
>  
>  static struct mfd_cell axp813_cells[] = {
>  	{
> -		.name			= "axp20x-pek",
> +		.name			= "axp221-pek",
>  		.num_resources		= ARRAY_SIZE(axp803_pek_resources),
>  		.resources		= axp803_pek_resources,
>  	}

-- 
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] 16+ messages in thread

* Re: [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813
  2017-07-26  8:32 ` [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Maxime Ripard
@ 2017-08-08  4:05   ` Chen-Yu Tsai
  0 siblings, 0 replies; 16+ messages in thread
From: Chen-Yu Tsai @ 2017-08-08  4:05 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Lee Jones, linux-kernel, devicetree,
	linux-arm-kernel, linux-sunxi

On Wed, Jul 26, 2017 at 4:32 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Wed, Jul 26, 2017 at 04:28:23PM +0800, Chen-Yu Tsai wrote:
>> Hi everyone,
>>
>> This is v2 of my AXP813 support series. The device tree patches are
>> based on my A83T MMC support series. These will go through the sunxi
>> tree. The dt-binding and mfd patches are based on v4.13-rc1. These
>> will go through Lee's mfd tree.
>>
>> Changes since v1:
>>
>>   - Provided relative path for ac100.txt in dt-bindings/mfd/axp20x.txt
>>
>>   - Added Rob's acks to dt-binding patches
>>
>>   - Added Quentin's "mfd: axp20x: use correct platform device id for
>>     many PEK" patch to this series. This patch depends on mfd changes
>>     in this series. It is included so Lee can take them together in
>>     one go.
>>
>>   - Added Lee's mfd-acks to mfd patches
>>
>>   - Added axp818 compatible with axp813 fallback. The two chips are
>>     identical except for the markings. The added compatible matches
>>     what is actually on the board, to avoid confusing readers.
>>
>>   - Fixed up device tree patches to mention which board is changed
>>
>>   - Added device tree patches for the H8 homlet
>
> For the whole serie,
> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied the dts patches for 4.14.

ChenYu

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-08-08  4:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26  8:28 [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai
2017-07-26  8:28 ` [PATCH v2 1/9] dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips Chen-Yu Tsai
2017-08-07 15:43   ` Lee Jones
2017-07-26  8:28 ` [PATCH v2 2/9] dt-bindings: mfd: axp20x: Introduce bindings for AXP813 Chen-Yu Tsai
2017-08-07 15:43   ` Lee Jones
2017-07-26  8:28 ` [PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC Chen-Yu Tsai
2017-08-07 15:43   ` Lee Jones
2017-07-26  8:28 ` [PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK Chen-Yu Tsai
2017-08-07 15:43   ` Lee Jones
2017-07-26  8:28 ` [PATCH v2 5/9] ARM: sun8i: a83t: Add device node and pinmux setting for RSB controller Chen-Yu Tsai
2017-07-26  8:28 ` [PATCH v2 6/9] ARM: sun8i: a83t: cubietruck-plus: Enable PMIC part of AXP818 PMIC Chen-Yu Tsai
2017-07-26  8:28 ` [PATCH v2 7/9] ARM: sun8i: a83t: cubietruck-plus: Enable AC100 combo chip in " Chen-Yu Tsai
2017-07-26  8:28 ` [PATCH v2 8/9] ARM: sun8i: a83t: h8homlet-v2: Enable PMIC part of " Chen-Yu Tsai
2017-07-26  8:28 ` [PATCH v2 9/9] ARM: sun8i: a83t: h8homlet-v2: Enable AC100 combo chip in " Chen-Yu Tsai
2017-07-26  8:32 ` [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Maxime Ripard
2017-08-08  4:05   ` Chen-Yu Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).