Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1696883 > unrolled thread

[PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813

Started byChen-Yu Tsai <wens@csie.org>
First post2017-07-26 10:40 +0200
Last post2017-07-26 10:40 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Chen-Yu Tsai <wens@csie.org> - 2017-07-26 10:40 +0200
    [PATCH v2 9/9] ARM: sun8i: a83t: h8homlet-v2: Enable AC100 combo chip in AXP818 PMIC Chen-Yu Tsai <wens@csie.org> - 2017-07-26 10:40 +0200
    Re: [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813 Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-26 10:40 +0200
    [PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC Chen-Yu Tsai <wens@csie.org> - 2017-07-26 10:40 +0200
    [PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK Chen-Yu Tsai <wens@csie.org> - 2017-07-26 10:40 +0200

#1696883 — [PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813

FromChen-Yu Tsai <wens@csie.org>
Date2017-07-26 10:40 +0200
Subject[PATCH v2 0/9] mfd: axp20x: Add basic support for AXP813
Message-ID<u7pRE-6lO-9@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1696886 — [PATCH v2 9/9] ARM: sun8i: a83t: h8homlet-v2: Enable AC100 combo chip in AXP818 PMIC

FromChen-Yu Tsai <wens@csie.org>
Date2017-07-26 10:40 +0200
Subject[PATCH v2 9/9] ARM: sun8i: a83t: h8homlet-v2: Enable AC100 combo chip in AXP818 PMIC
Message-ID<u7q1k-6pF-19@gated-at.bofh.it>
In reply to#1696883
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

[toc] | [prev] | [next] | [standalone]


#1696889

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2017-07-26 10:40 +0200
Message-ID<u7q1k-6pF-21@gated-at.bofh.it>
In reply to#1696883

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [prev] | [next] | [standalone]


#1696890 — [PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC

FromChen-Yu Tsai <wens@csie.org>
Date2017-07-26 10:40 +0200
Subject[PATCH v2 3/9] mfd: axp20x: Add support for AXP813 PMIC
Message-ID<u7q1k-6pF-23@gated-at.bofh.it>
In reply to#1696883
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

[toc] | [prev] | [next] | [standalone]


#1696893 — [PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK

FromChen-Yu Tsai <wens@csie.org>
Date2017-07-26 10:40 +0200
Subject[PATCH v2 4/9] mfd: axp20x: use correct platform device id for many PEK
Message-ID<u7q1k-6pF-33@gated-at.bofh.it>
In reply to#1696883
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web