All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/12] mfd: axp20x: add AXP221 PMIC support
@ 2015-03-10 11:59 ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

Hi everyone,

This is v5 of the AXP221 series. I've taken over the work from Boris.
This version is based on v4.0-rc1, plus "mfd: AXP20x: Add bindings
documentation" which was posted a few weeks ago. I've worked on this
series for some time, so the changelog might not be completely accurate.

The AXP221 is a member of X-Powers' AXP PMIC family. They share the
same basic functionality and structure. The series adds system poweroff,
power button and regulator support for the AXP221. When Reduced Serial
Bus (RSB) support is introduced, the same code can be reused (except
for the probe interface) for the AXP223, which has the same core and
a different external host interface.

The p2wi controller dts patches have no dependency, and can go in
Maxime's tree.

The regulator bits depend on the mfd patches, which introduce new enums
and register definitions. The regulator dts patches should also be merged
_after_ the regulator bits, as the original axp20x regulator driver did
not check for supported variants. Maybe Lee and Mark can work out a shared
branch, or have Lee take all the driver bits?


Regards
ChenYu


Changes since v4:

  - Rebased onto v4.0-rc1 and axp20x bindings v10

  - Dropped regulator set registration patches

  - Group regmap ranges/tables by AXP variant

  - Fix AXP221 interrupt numbers to match datasheet

  - Handle AXP variants when setting DC-DC regulator work mode

  - Add "switch" type regulator DC1SW, which is a secondary output
    of DCDC1 with a separate on/off switch.

  - Add AXP221 to DT bindings


Boris BREZILLON (4):
  ARM: dts: sun6i: add p2wi controller node to dtsi
  mfd: axp20x: add AXP22x PMIC support
  regulator: axp20x: prepare support for multiple AXP chip families
  regulator: axp20x: add support for AXP22X regulators

Chen-Yu Tsai (8):
  ARM: dts: sun6i: hummingbird: Enable P2WI controller
  mfd: axp20x: update DT bindings with AXP22x compatibles
  ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
  mfd: axp20x: Add AXP22x regulator information to DT bindings
  mfd: axp20x: Enable AXP22X regulators
  ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
  ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
  ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module

 Documentation/devicetree/bindings/mfd/axp20x.txt |  34 +++-
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts      |  91 ++++++++-
 arch/arm/boot/dts/sun6i-a31.dtsi                 |  29 +++
 drivers/mfd/axp20x.c                             | 100 ++++++++++
 drivers/regulator/axp20x-regulator.c             | 239 ++++++++++++++++++-----
 include/linux/mfd/axp20x.h                       |  86 ++++++++
 6 files changed, 526 insertions(+), 53 deletions(-)

-- 
2.1.4


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

* [PATCH v5 00/12] mfd: axp20x: add AXP221 PMIC support
@ 2015-03-10 11:59 ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

Hi everyone,

This is v5 of the AXP221 series. I've taken over the work from Boris.
This version is based on v4.0-rc1, plus "mfd: AXP20x: Add bindings
documentation" which was posted a few weeks ago. I've worked on this
series for some time, so the changelog might not be completely accurate.

The AXP221 is a member of X-Powers' AXP PMIC family. They share the
same basic functionality and structure. The series adds system poweroff,
power button and regulator support for the AXP221. When Reduced Serial
Bus (RSB) support is introduced, the same code can be reused (except
for the probe interface) for the AXP223, which has the same core and
a different external host interface.

The p2wi controller dts patches have no dependency, and can go in
Maxime's tree.

The regulator bits depend on the mfd patches, which introduce new enums
and register definitions. The regulator dts patches should also be merged
_after_ the regulator bits, as the original axp20x regulator driver did
not check for supported variants. Maybe Lee and Mark can work out a shared
branch, or have Lee take all the driver bits?


Regards
ChenYu


Changes since v4:

  - Rebased onto v4.0-rc1 and axp20x bindings v10

  - Dropped regulator set registration patches

  - Group regmap ranges/tables by AXP variant

  - Fix AXP221 interrupt numbers to match datasheet

  - Handle AXP variants when setting DC-DC regulator work mode

  - Add "switch" type regulator DC1SW, which is a secondary output
    of DCDC1 with a separate on/off switch.

  - Add AXP221 to DT bindings


Boris BREZILLON (4):
  ARM: dts: sun6i: add p2wi controller node to dtsi
  mfd: axp20x: add AXP22x PMIC support
  regulator: axp20x: prepare support for multiple AXP chip families
  regulator: axp20x: add support for AXP22X regulators

Chen-Yu Tsai (8):
  ARM: dts: sun6i: hummingbird: Enable P2WI controller
  mfd: axp20x: update DT bindings with AXP22x compatibles
  ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
  mfd: axp20x: Add AXP22x regulator information to DT bindings
  mfd: axp20x: Enable AXP22X regulators
  ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
  ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
  ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module

 Documentation/devicetree/bindings/mfd/axp20x.txt |  34 +++-
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts      |  91 ++++++++-
 arch/arm/boot/dts/sun6i-a31.dtsi                 |  29 +++
 drivers/mfd/axp20x.c                             | 100 ++++++++++
 drivers/regulator/axp20x-regulator.c             | 239 ++++++++++++++++++-----
 include/linux/mfd/axp20x.h                       |  86 ++++++++
 6 files changed, 526 insertions(+), 53 deletions(-)

-- 
2.1.4

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

* [PATCH v5 00/12] mfd: axp20x: add AXP221 PMIC support
@ 2015-03-10 11:59 ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

Hi everyone,

This is v5 of the AXP221 series. I've taken over the work from Boris.
This version is based on v4.0-rc1, plus "mfd: AXP20x: Add bindings
documentation" which was posted a few weeks ago. I've worked on this
series for some time, so the changelog might not be completely accurate.

The AXP221 is a member of X-Powers' AXP PMIC family. They share the
same basic functionality and structure. The series adds system poweroff,
power button and regulator support for the AXP221. When Reduced Serial
Bus (RSB) support is introduced, the same code can be reused (except
for the probe interface) for the AXP223, which has the same core and
a different external host interface.

The p2wi controller dts patches have no dependency, and can go in
Maxime's tree.

The regulator bits depend on the mfd patches, which introduce new enums
and register definitions. The regulator dts patches should also be merged
_after_ the regulator bits, as the original axp20x regulator driver did
not check for supported variants. Maybe Lee and Mark can work out a shared
branch, or have Lee take all the driver bits?


Regards
ChenYu


Changes since v4:

  - Rebased onto v4.0-rc1 and axp20x bindings v10

  - Dropped regulator set registration patches

  - Group regmap ranges/tables by AXP variant

  - Fix AXP221 interrupt numbers to match datasheet

  - Handle AXP variants when setting DC-DC regulator work mode

  - Add "switch" type regulator DC1SW, which is a secondary output
    of DCDC1 with a separate on/off switch.

  - Add AXP221 to DT bindings


Boris BREZILLON (4):
  ARM: dts: sun6i: add p2wi controller node to dtsi
  mfd: axp20x: add AXP22x PMIC support
  regulator: axp20x: prepare support for multiple AXP chip families
  regulator: axp20x: add support for AXP22X regulators

Chen-Yu Tsai (8):
  ARM: dts: sun6i: hummingbird: Enable P2WI controller
  mfd: axp20x: update DT bindings with AXP22x compatibles
  ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
  mfd: axp20x: Add AXP22x regulator information to DT bindings
  mfd: axp20x: Enable AXP22X regulators
  ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
  ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
  ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module

 Documentation/devicetree/bindings/mfd/axp20x.txt |  34 +++-
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts      |  91 ++++++++-
 arch/arm/boot/dts/sun6i-a31.dtsi                 |  29 +++
 drivers/mfd/axp20x.c                             | 100 ++++++++++
 drivers/regulator/axp20x-regulator.c             | 239 ++++++++++++++++++-----
 include/linux/mfd/axp20x.h                       |  86 ++++++++
 6 files changed, 526 insertions(+), 53 deletions(-)

-- 
2.1.4

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

* [PATCH v5 01/12] ARM: dts: sun6i: add p2wi controller node to dtsi
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi, Chen-Yu Tsai

From: Boris BREZILLON <boris.brezillon@free-electrons.com>

The p2wi controller has only one possible pinmux setting. Use it by
default in the dtsi, instead of having to set it in each board's dts.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
[wens@csie.org: reformat commit title; rename p2wi pins and use as default]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index fa2f403ccf28..92abea20b946 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -973,6 +973,27 @@
 				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
+
+			p2wi_pins: p2wi {
+				allwinner,pins = "PL0", "PL1";
+				allwinner,function = "s_p2wi";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+		};
+
+		p2wi: i2c@01f03400 {
+			compatible = "allwinner,sun6i-a31-p2wi";
+			reg = <0x01f03400 0x400>;
+			interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&apb0_gates 3>;
+			clock-frequency = <100000>;
+			resets = <&apb0_rst 3>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&p2wi_pins>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
 		};
 	};
 };
-- 
2.1.4


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

* [PATCH v5 01/12] ARM: dts: sun6i: add p2wi controller node to dtsi
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Boris BREZILLON,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Chen-Yu Tsai

From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

The p2wi controller has only one possible pinmux setting. Use it by
default in the dtsi, instead of having to set it in each board's dts.

Signed-off-by: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
[wens-jdAy2FN1RRM@public.gmane.org: reformat commit title; rename p2wi pins and use as default]
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index fa2f403ccf28..92abea20b946 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -973,6 +973,27 @@
 				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
+
+			p2wi_pins: p2wi {
+				allwinner,pins = "PL0", "PL1";
+				allwinner,function = "s_p2wi";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+		};
+
+		p2wi: i2c@01f03400 {
+			compatible = "allwinner,sun6i-a31-p2wi";
+			reg = <0x01f03400 0x400>;
+			interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&apb0_gates 3>;
+			clock-frequency = <100000>;
+			resets = <&apb0_rst 3>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&p2wi_pins>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
 		};
 	};
 };
-- 
2.1.4

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

* [PATCH v5 01/12] ARM: dts: sun6i: add p2wi controller node to dtsi
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

From: Boris BREZILLON <boris.brezillon@free-electrons.com>

The p2wi controller has only one possible pinmux setting. Use it by
default in the dtsi, instead of having to set it in each board's dts.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
[wens at csie.org: reformat commit title; rename p2wi pins and use as default]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index fa2f403ccf28..92abea20b946 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -973,6 +973,27 @@
 				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
+
+			p2wi_pins: p2wi {
+				allwinner,pins = "PL0", "PL1";
+				allwinner,function = "s_p2wi";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+		};
+
+		p2wi: i2c at 01f03400 {
+			compatible = "allwinner,sun6i-a31-p2wi";
+			reg = <0x01f03400 0x400>;
+			interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&apb0_gates 3>;
+			clock-frequency = <100000>;
+			resets = <&apb0_rst 3>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&p2wi_pins>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
 		};
 	};
 };
-- 
2.1.4

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

* [PATCH v5 02/12] ARM: dts: sun6i: hummingbird: Enable P2WI controller
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

The Hummingbird A31 has an AXP221 PMIC hooked up to the P2WI controller.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 65ddaf4c72d2..533bedc5dd95 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -140,6 +140,10 @@
 	};
 };
 
+&p2wi {
+	status = "okay";
+};
+
 &reg_usb1_vbus {
 	gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
 	status = "okay";
-- 
2.1.4


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

* [PATCH v5 02/12] ARM: dts: sun6i: hummingbird: Enable P2WI controller
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

The Hummingbird A31 has an AXP221 PMIC hooked up to the P2WI controller.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 65ddaf4c72d2..533bedc5dd95 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -140,6 +140,10 @@
 	};
 };
 
+&p2wi {
+	status = "okay";
+};
+
 &reg_usb1_vbus {
 	gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
 	status = "okay";
-- 
2.1.4

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

* [PATCH v5 02/12] ARM: dts: sun6i: hummingbird: Enable P2WI controller
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

The Hummingbird A31 has an AXP221 PMIC hooked up to the P2WI controller.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 65ddaf4c72d2..533bedc5dd95 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -140,6 +140,10 @@
 	};
 };
 
+&p2wi {
+	status = "okay";
+};
+
 &reg_usb1_vbus {
 	gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
 	status = "okay";
-- 
2.1.4

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

* [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi, Chen-Yu Tsai

From: Boris BREZILLON <boris.brezillon@free-electrons.com>

Add support for the AXP22x PMIC devices to the existing AXP20x driver.
This includes the AXP221 and AXP223, which are identical except for
the external data bus. Only AXP221 is added for now. AXP223 will be
added after it's Reduced Serial Bus (RSB) interface is supported.

AXP22x defines a new set of registers, power supplies and regulators,
but most of the API is similar to the AXP20x ones.

A new irq chip definition is used, even though the available interrupts
on AXP22x is a subset of those on AXP20x. This is done so the interrupt
numbers match those on the datasheet.

This patch only enables the interrupts, system power-off function, and PEK
sub-device. The regulator driver must first support different variants
before we enable it from the mfd driver.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
[wens@csie.org: fix interrupts and move regulators to separate patch]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index b1b580a88654..0ec27d5023df 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -32,6 +32,7 @@
 static const char const *axp20x_model_names[] = {
 	"AXP202",
 	"AXP209",
+	"AXP221",
 	"AXP288",
 };
 
@@ -54,6 +55,25 @@ static const struct regmap_access_table axp20x_volatile_table = {
 	.n_yes_ranges	= ARRAY_SIZE(axp20x_volatile_ranges),
 };
 
+static const struct regmap_range axp22x_writeable_ranges[] = {
+	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
+	regmap_reg_range(AXP20X_DCDC_MODE, AXP22X_BATLOW_THRES1),
+};
+
+static const struct regmap_range axp22x_volatile_ranges[] = {
+	regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE),
+};
+
+static const struct regmap_access_table axp22x_writeable_table = {
+	.yes_ranges	= axp22x_writeable_ranges,
+	.n_yes_ranges	= ARRAY_SIZE(axp22x_writeable_ranges),
+};
+
+static const struct regmap_access_table axp22x_volatile_table = {
+	.yes_ranges	= axp22x_volatile_ranges,
+	.n_yes_ranges	= ARRAY_SIZE(axp22x_volatile_ranges),
+};
+
 static const struct regmap_range axp288_writeable_ranges[] = {
 	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ6_STATE),
 	regmap_reg_range(AXP20X_DCDC_MODE, AXP288_FG_TUNE5),
@@ -87,6 +107,20 @@ static struct resource axp20x_pek_resources[] = {
 	},
 };
 
+static struct resource axp22x_pek_resources[] = {
+	{
+		.name   = "PEK_DBR",
+		.start  = AXP22X_IRQ_PEK_RIS_EDGE,
+		.end    = AXP22X_IRQ_PEK_RIS_EDGE,
+		.flags  = IORESOURCE_IRQ,
+	}, {
+		.name   = "PEK_DBF",
+		.start  = AXP22X_IRQ_PEK_FAL_EDGE,
+		.end    = AXP22X_IRQ_PEK_FAL_EDGE,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
 static struct resource axp288_battery_resources[] = {
 	{
 		.start = AXP288_IRQ_QWBTU,
@@ -129,6 +163,15 @@ static const struct regmap_config axp20x_regmap_config = {
 	.cache_type	= REGCACHE_RBTREE,
 };
 
+static const struct regmap_config axp22x_regmap_config = {
+	.reg_bits	= 8,
+	.val_bits	= 8,
+	.wr_table	= &axp22x_writeable_table,
+	.volatile_table	= &axp22x_volatile_table,
+	.max_register	= AXP22X_BATLOW_THRES1,
+	.cache_type	= REGCACHE_RBTREE,
+};
+
 static const struct regmap_config axp288_regmap_config = {
 	.reg_bits	= 8,
 	.val_bits	= 8,
@@ -181,6 +224,34 @@ static const struct regmap_irq axp20x_regmap_irqs[] = {
 	INIT_REGMAP_IRQ(AXP20X, GPIO0_INPUT,		4, 0),
 };
 
+static const struct regmap_irq axp22x_regmap_irqs[] = {
+	INIT_REGMAP_IRQ(AXP22X, ACIN_OVER_V,		0, 7),
+	INIT_REGMAP_IRQ(AXP22X, ACIN_PLUGIN,		0, 6),
+	INIT_REGMAP_IRQ(AXP22X, ACIN_REMOVAL,	        0, 5),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_OVER_V,		0, 4),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_PLUGIN,		0, 3),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_REMOVAL,	        0, 2),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_V_LOW,		0, 1),
+	INIT_REGMAP_IRQ(AXP22X, BATT_PLUGIN,		1, 7),
+	INIT_REGMAP_IRQ(AXP22X, BATT_REMOVAL,	        1, 6),
+	INIT_REGMAP_IRQ(AXP22X, BATT_ENT_ACT_MODE,	1, 5),
+	INIT_REGMAP_IRQ(AXP22X, BATT_EXIT_ACT_MODE,	1, 4),
+	INIT_REGMAP_IRQ(AXP22X, CHARG,		        1, 3),
+	INIT_REGMAP_IRQ(AXP22X, CHARG_DONE,		1, 2),
+	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_HIGH,	        1, 1),
+	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_LOW,	        1, 0),
+	INIT_REGMAP_IRQ(AXP22X, DIE_TEMP_HIGH,	        2, 7),
+	INIT_REGMAP_IRQ(AXP22X, PEK_SHORT,		2, 1),
+	INIT_REGMAP_IRQ(AXP22X, PEK_LONG,		2, 0),
+	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL1,	        3, 1),
+	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL2,	        3, 0),
+	INIT_REGMAP_IRQ(AXP22X, TIMER,		        4, 7),
+	INIT_REGMAP_IRQ(AXP22X, PEK_RIS_EDGE,	        4, 6),
+	INIT_REGMAP_IRQ(AXP22X, PEK_FAL_EDGE,	        4, 5),
+	INIT_REGMAP_IRQ(AXP22X, GPIO1_INPUT,		4, 1),
+	INIT_REGMAP_IRQ(AXP22X, GPIO0_INPUT,		4, 0),
+};
+
 /* some IRQs are compatible with axp20x models */
 static const struct regmap_irq axp288_regmap_irqs[] = {
 	INIT_REGMAP_IRQ(AXP288, VBUS_FALL,              0, 2),
@@ -224,6 +295,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
 static const struct of_device_id axp20x_of_match[] = {
 	{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
 	{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
+	{ .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, axp20x_of_match);
@@ -258,6 +330,18 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
 
 };
 
+static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
+	.name			= "axp22x_irq_chip",
+	.status_base		= AXP20X_IRQ1_STATE,
+	.ack_base		= AXP20X_IRQ1_STATE,
+	.mask_base		= AXP20X_IRQ1_EN,
+	.mask_invert		= true,
+	.init_ack_masked	= true,
+	.irqs			= axp22x_regmap_irqs,
+	.num_irqs		= ARRAY_SIZE(axp22x_regmap_irqs),
+	.num_regs		= 5,
+};
+
 static const struct regmap_irq_chip axp288_regmap_irq_chip = {
 	.name			= "axp288_irq_chip",
 	.status_base		= AXP20X_IRQ1_STATE,
@@ -281,6 +365,14 @@ static struct mfd_cell axp20x_cells[] = {
 	},
 };
 
+static struct mfd_cell axp22x_cells[] = {
+	{
+		.name			= "axp20x-pek",
+		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
+		.resources		= axp22x_pek_resources,
+	},
+};
+
 static struct resource axp288_adc_resources[] = {
 	{
 		.name  = "GPADC",
@@ -398,6 +490,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
 		axp20x->regmap_cfg = &axp20x_regmap_config;
 		axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
 		break;
+	case AXP221_ID:
+		axp20x->nr_cells = ARRAY_SIZE(axp22x_cells);
+		axp20x->cells = axp22x_cells;
+		axp20x->regmap_cfg = &axp22x_regmap_config;
+		axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
+		break;
 	case AXP288_ID:
 		axp20x->cells = axp288_cells;
 		axp20x->nr_cells = ARRAY_SIZE(axp288_cells);
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index dfabd6db7ddf..95568eb798c3 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -14,6 +14,7 @@
 enum {
 	AXP202_ID = 0,
 	AXP209_ID,
+	AXP221_ID,
 	AXP288_ID,
 	NR_AXP20X_VARIANTS,
 };
@@ -45,6 +46,28 @@ enum {
 #define AXP20X_V_LTF_DISCHRG		0x3c
 #define AXP20X_V_HTF_DISCHRG		0x3d
 
+#define AXP22X_PWR_OUT_CTRL1		0x10
+#define AXP22X_PWR_OUT_CTRL2		0x12
+#define AXP22X_PWR_OUT_CTRL3		0x13
+#define AXP22X_DLDO1_V_OUT		0x15
+#define AXP22X_DLDO2_V_OUT		0x16
+#define AXP22X_DLDO3_V_OUT		0x17
+#define AXP22X_DLDO4_V_OUT		0x18
+#define AXP22X_ELDO1_V_OUT		0x19
+#define AXP22X_ELDO2_V_OUT		0x1a
+#define AXP22X_ELDO3_V_OUT		0x1b
+#define AXP22X_DC5LDO_V_OUT		0x1c
+#define AXP22X_DCDC1_V_OUT		0x21
+#define AXP22X_DCDC2_V_OUT		0x22
+#define AXP22X_DCDC3_V_OUT		0x23
+#define AXP22X_DCDC4_V_OUT		0x24
+#define AXP22X_DCDC5_V_OUT		0x25
+#define AXP22X_DCDC23_V_RAMP_CTRL	0x27
+#define AXP22X_ALDO1_V_OUT		0x28
+#define AXP22X_ALDO2_V_OUT		0x29
+#define AXP22X_ALDO3_V_OUT		0x2a
+#define AXP22X_CHRG_CTRL3		0x35
+
 /* Interrupt */
 #define AXP20X_IRQ1_EN			0x40
 #define AXP20X_IRQ2_EN			0x41
@@ -100,6 +123,9 @@ enum {
 #define AXP20X_VBUS_MON			0x8b
 #define AXP20X_OVER_TMP			0x8f
 
+#define AXP22X_PWREN_CTRL1		0x8c
+#define AXP22X_PWREN_CTRL2		0x8d
+
 /* GPIO */
 #define AXP20X_GPIO0_CTRL		0x90
 #define AXP20X_LDO5_V_OUT		0x91
@@ -108,6 +134,11 @@ enum {
 #define AXP20X_GPIO20_SS		0x94
 #define AXP20X_GPIO3_CTRL		0x95
 
+#define AXP22X_LDO_IO0_V_OUT		0x91
+#define AXP22X_LDO_IO1_V_OUT		0x93
+#define AXP22X_GPIO_STATE		0x94
+#define AXP22X_GPIO_PULL_DOWN		0x95
+
 /* Battery */
 #define AXP20X_CHRG_CC_31_24		0xb0
 #define AXP20X_CHRG_CC_23_16		0xb1
@@ -120,6 +151,9 @@ enum {
 #define AXP20X_CC_CTRL			0xb8
 #define AXP20X_FG_RES			0xb9
 
+/* AXP22X specific registers */
+#define AXP22X_BATLOW_THRES1		0xe6
+
 /* AXP288 specific registers */
 #define AXP288_PMIC_ADC_H               0x56
 #define AXP288_PMIC_ADC_L               0x57
@@ -158,6 +192,30 @@ enum {
 	AXP20X_REG_ID_MAX,
 };
 
+enum {
+	AXP22X_DCDC1 = 0,
+	AXP22X_DCDC2,
+	AXP22X_DCDC3,
+	AXP22X_DCDC4,
+	AXP22X_DCDC5,
+	AXP22X_DC1SW,
+	AXP22X_DC5LDO,
+	AXP22X_ALDO1,
+	AXP22X_ALDO2,
+	AXP22X_ALDO3,
+	AXP22X_ELDO1,
+	AXP22X_ELDO2,
+	AXP22X_ELDO3,
+	AXP22X_DLDO1,
+	AXP22X_DLDO2,
+	AXP22X_DLDO3,
+	AXP22X_DLDO4,
+	AXP22X_RTC_LDO,
+	AXP22X_LDO_IO0,
+	AXP22X_LDO_IO1,
+	AXP22X_REG_ID_MAX,
+};
+
 /* IRQs */
 enum {
 	AXP20X_IRQ_ACIN_OVER_V = 1,
@@ -199,6 +257,34 @@ enum {
 	AXP20X_IRQ_GPIO0_INPUT,
 };
 
+enum axp22x_irqs {
+	AXP22X_IRQ_ACIN_OVER_V = 1,
+	AXP22X_IRQ_ACIN_PLUGIN,
+	AXP22X_IRQ_ACIN_REMOVAL,
+	AXP22X_IRQ_VBUS_OVER_V,
+	AXP22X_IRQ_VBUS_PLUGIN,
+	AXP22X_IRQ_VBUS_REMOVAL,
+	AXP22X_IRQ_VBUS_V_LOW,
+	AXP22X_IRQ_BATT_PLUGIN,
+	AXP22X_IRQ_BATT_REMOVAL,
+	AXP22X_IRQ_BATT_ENT_ACT_MODE,
+	AXP22X_IRQ_BATT_EXIT_ACT_MODE,
+	AXP22X_IRQ_CHARG,
+	AXP22X_IRQ_CHARG_DONE,
+	AXP22X_IRQ_BATT_TEMP_HIGH,
+	AXP22X_IRQ_BATT_TEMP_LOW,
+	AXP22X_IRQ_DIE_TEMP_HIGH,
+	AXP22X_IRQ_PEK_SHORT,
+	AXP22X_IRQ_PEK_LONG,
+	AXP22X_IRQ_LOW_PWR_LVL1,
+	AXP22X_IRQ_LOW_PWR_LVL2,
+	AXP22X_IRQ_TIMER,
+	AXP22X_IRQ_PEK_RIS_EDGE,
+	AXP22X_IRQ_PEK_FAL_EDGE,
+	AXP22X_IRQ_GPIO1_INPUT,
+	AXP22X_IRQ_GPIO0_INPUT,
+};
+
 enum axp288_irqs {
 	AXP288_IRQ_VBUS_FALL     = 2,
 	AXP288_IRQ_VBUS_RISE,
-- 
2.1.4


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

* [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Boris BREZILLON,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Chen-Yu Tsai

From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

Add support for the AXP22x PMIC devices to the existing AXP20x driver.
This includes the AXP221 and AXP223, which are identical except for
the external data bus. Only AXP221 is added for now. AXP223 will be
added after it's Reduced Serial Bus (RSB) interface is supported.

AXP22x defines a new set of registers, power supplies and regulators,
but most of the API is similar to the AXP20x ones.

A new irq chip definition is used, even though the available interrupts
on AXP22x is a subset of those on AXP20x. This is done so the interrupt
numbers match those on the datasheet.

This patch only enables the interrupts, system power-off function, and PEK
sub-device. The regulator driver must first support different variants
before we enable it from the mfd driver.

Signed-off-by: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
[wens-jdAy2FN1RRM@public.gmane.org: fix interrupts and move regulators to separate patch]
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index b1b580a88654..0ec27d5023df 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -32,6 +32,7 @@
 static const char const *axp20x_model_names[] = {
 	"AXP202",
 	"AXP209",
+	"AXP221",
 	"AXP288",
 };
 
@@ -54,6 +55,25 @@ static const struct regmap_access_table axp20x_volatile_table = {
 	.n_yes_ranges	= ARRAY_SIZE(axp20x_volatile_ranges),
 };
 
+static const struct regmap_range axp22x_writeable_ranges[] = {
+	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
+	regmap_reg_range(AXP20X_DCDC_MODE, AXP22X_BATLOW_THRES1),
+};
+
+static const struct regmap_range axp22x_volatile_ranges[] = {
+	regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE),
+};
+
+static const struct regmap_access_table axp22x_writeable_table = {
+	.yes_ranges	= axp22x_writeable_ranges,
+	.n_yes_ranges	= ARRAY_SIZE(axp22x_writeable_ranges),
+};
+
+static const struct regmap_access_table axp22x_volatile_table = {
+	.yes_ranges	= axp22x_volatile_ranges,
+	.n_yes_ranges	= ARRAY_SIZE(axp22x_volatile_ranges),
+};
+
 static const struct regmap_range axp288_writeable_ranges[] = {
 	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ6_STATE),
 	regmap_reg_range(AXP20X_DCDC_MODE, AXP288_FG_TUNE5),
@@ -87,6 +107,20 @@ static struct resource axp20x_pek_resources[] = {
 	},
 };
 
+static struct resource axp22x_pek_resources[] = {
+	{
+		.name   = "PEK_DBR",
+		.start  = AXP22X_IRQ_PEK_RIS_EDGE,
+		.end    = AXP22X_IRQ_PEK_RIS_EDGE,
+		.flags  = IORESOURCE_IRQ,
+	}, {
+		.name   = "PEK_DBF",
+		.start  = AXP22X_IRQ_PEK_FAL_EDGE,
+		.end    = AXP22X_IRQ_PEK_FAL_EDGE,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
 static struct resource axp288_battery_resources[] = {
 	{
 		.start = AXP288_IRQ_QWBTU,
@@ -129,6 +163,15 @@ static const struct regmap_config axp20x_regmap_config = {
 	.cache_type	= REGCACHE_RBTREE,
 };
 
+static const struct regmap_config axp22x_regmap_config = {
+	.reg_bits	= 8,
+	.val_bits	= 8,
+	.wr_table	= &axp22x_writeable_table,
+	.volatile_table	= &axp22x_volatile_table,
+	.max_register	= AXP22X_BATLOW_THRES1,
+	.cache_type	= REGCACHE_RBTREE,
+};
+
 static const struct regmap_config axp288_regmap_config = {
 	.reg_bits	= 8,
 	.val_bits	= 8,
@@ -181,6 +224,34 @@ static const struct regmap_irq axp20x_regmap_irqs[] = {
 	INIT_REGMAP_IRQ(AXP20X, GPIO0_INPUT,		4, 0),
 };
 
+static const struct regmap_irq axp22x_regmap_irqs[] = {
+	INIT_REGMAP_IRQ(AXP22X, ACIN_OVER_V,		0, 7),
+	INIT_REGMAP_IRQ(AXP22X, ACIN_PLUGIN,		0, 6),
+	INIT_REGMAP_IRQ(AXP22X, ACIN_REMOVAL,	        0, 5),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_OVER_V,		0, 4),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_PLUGIN,		0, 3),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_REMOVAL,	        0, 2),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_V_LOW,		0, 1),
+	INIT_REGMAP_IRQ(AXP22X, BATT_PLUGIN,		1, 7),
+	INIT_REGMAP_IRQ(AXP22X, BATT_REMOVAL,	        1, 6),
+	INIT_REGMAP_IRQ(AXP22X, BATT_ENT_ACT_MODE,	1, 5),
+	INIT_REGMAP_IRQ(AXP22X, BATT_EXIT_ACT_MODE,	1, 4),
+	INIT_REGMAP_IRQ(AXP22X, CHARG,		        1, 3),
+	INIT_REGMAP_IRQ(AXP22X, CHARG_DONE,		1, 2),
+	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_HIGH,	        1, 1),
+	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_LOW,	        1, 0),
+	INIT_REGMAP_IRQ(AXP22X, DIE_TEMP_HIGH,	        2, 7),
+	INIT_REGMAP_IRQ(AXP22X, PEK_SHORT,		2, 1),
+	INIT_REGMAP_IRQ(AXP22X, PEK_LONG,		2, 0),
+	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL1,	        3, 1),
+	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL2,	        3, 0),
+	INIT_REGMAP_IRQ(AXP22X, TIMER,		        4, 7),
+	INIT_REGMAP_IRQ(AXP22X, PEK_RIS_EDGE,	        4, 6),
+	INIT_REGMAP_IRQ(AXP22X, PEK_FAL_EDGE,	        4, 5),
+	INIT_REGMAP_IRQ(AXP22X, GPIO1_INPUT,		4, 1),
+	INIT_REGMAP_IRQ(AXP22X, GPIO0_INPUT,		4, 0),
+};
+
 /* some IRQs are compatible with axp20x models */
 static const struct regmap_irq axp288_regmap_irqs[] = {
 	INIT_REGMAP_IRQ(AXP288, VBUS_FALL,              0, 2),
@@ -224,6 +295,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
 static const struct of_device_id axp20x_of_match[] = {
 	{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
 	{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
+	{ .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, axp20x_of_match);
@@ -258,6 +330,18 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
 
 };
 
+static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
+	.name			= "axp22x_irq_chip",
+	.status_base		= AXP20X_IRQ1_STATE,
+	.ack_base		= AXP20X_IRQ1_STATE,
+	.mask_base		= AXP20X_IRQ1_EN,
+	.mask_invert		= true,
+	.init_ack_masked	= true,
+	.irqs			= axp22x_regmap_irqs,
+	.num_irqs		= ARRAY_SIZE(axp22x_regmap_irqs),
+	.num_regs		= 5,
+};
+
 static const struct regmap_irq_chip axp288_regmap_irq_chip = {
 	.name			= "axp288_irq_chip",
 	.status_base		= AXP20X_IRQ1_STATE,
@@ -281,6 +365,14 @@ static struct mfd_cell axp20x_cells[] = {
 	},
 };
 
+static struct mfd_cell axp22x_cells[] = {
+	{
+		.name			= "axp20x-pek",
+		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
+		.resources		= axp22x_pek_resources,
+	},
+};
+
 static struct resource axp288_adc_resources[] = {
 	{
 		.name  = "GPADC",
@@ -398,6 +490,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
 		axp20x->regmap_cfg = &axp20x_regmap_config;
 		axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
 		break;
+	case AXP221_ID:
+		axp20x->nr_cells = ARRAY_SIZE(axp22x_cells);
+		axp20x->cells = axp22x_cells;
+		axp20x->regmap_cfg = &axp22x_regmap_config;
+		axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
+		break;
 	case AXP288_ID:
 		axp20x->cells = axp288_cells;
 		axp20x->nr_cells = ARRAY_SIZE(axp288_cells);
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index dfabd6db7ddf..95568eb798c3 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -14,6 +14,7 @@
 enum {
 	AXP202_ID = 0,
 	AXP209_ID,
+	AXP221_ID,
 	AXP288_ID,
 	NR_AXP20X_VARIANTS,
 };
@@ -45,6 +46,28 @@ enum {
 #define AXP20X_V_LTF_DISCHRG		0x3c
 #define AXP20X_V_HTF_DISCHRG		0x3d
 
+#define AXP22X_PWR_OUT_CTRL1		0x10
+#define AXP22X_PWR_OUT_CTRL2		0x12
+#define AXP22X_PWR_OUT_CTRL3		0x13
+#define AXP22X_DLDO1_V_OUT		0x15
+#define AXP22X_DLDO2_V_OUT		0x16
+#define AXP22X_DLDO3_V_OUT		0x17
+#define AXP22X_DLDO4_V_OUT		0x18
+#define AXP22X_ELDO1_V_OUT		0x19
+#define AXP22X_ELDO2_V_OUT		0x1a
+#define AXP22X_ELDO3_V_OUT		0x1b
+#define AXP22X_DC5LDO_V_OUT		0x1c
+#define AXP22X_DCDC1_V_OUT		0x21
+#define AXP22X_DCDC2_V_OUT		0x22
+#define AXP22X_DCDC3_V_OUT		0x23
+#define AXP22X_DCDC4_V_OUT		0x24
+#define AXP22X_DCDC5_V_OUT		0x25
+#define AXP22X_DCDC23_V_RAMP_CTRL	0x27
+#define AXP22X_ALDO1_V_OUT		0x28
+#define AXP22X_ALDO2_V_OUT		0x29
+#define AXP22X_ALDO3_V_OUT		0x2a
+#define AXP22X_CHRG_CTRL3		0x35
+
 /* Interrupt */
 #define AXP20X_IRQ1_EN			0x40
 #define AXP20X_IRQ2_EN			0x41
@@ -100,6 +123,9 @@ enum {
 #define AXP20X_VBUS_MON			0x8b
 #define AXP20X_OVER_TMP			0x8f
 
+#define AXP22X_PWREN_CTRL1		0x8c
+#define AXP22X_PWREN_CTRL2		0x8d
+
 /* GPIO */
 #define AXP20X_GPIO0_CTRL		0x90
 #define AXP20X_LDO5_V_OUT		0x91
@@ -108,6 +134,11 @@ enum {
 #define AXP20X_GPIO20_SS		0x94
 #define AXP20X_GPIO3_CTRL		0x95
 
+#define AXP22X_LDO_IO0_V_OUT		0x91
+#define AXP22X_LDO_IO1_V_OUT		0x93
+#define AXP22X_GPIO_STATE		0x94
+#define AXP22X_GPIO_PULL_DOWN		0x95
+
 /* Battery */
 #define AXP20X_CHRG_CC_31_24		0xb0
 #define AXP20X_CHRG_CC_23_16		0xb1
@@ -120,6 +151,9 @@ enum {
 #define AXP20X_CC_CTRL			0xb8
 #define AXP20X_FG_RES			0xb9
 
+/* AXP22X specific registers */
+#define AXP22X_BATLOW_THRES1		0xe6
+
 /* AXP288 specific registers */
 #define AXP288_PMIC_ADC_H               0x56
 #define AXP288_PMIC_ADC_L               0x57
@@ -158,6 +192,30 @@ enum {
 	AXP20X_REG_ID_MAX,
 };
 
+enum {
+	AXP22X_DCDC1 = 0,
+	AXP22X_DCDC2,
+	AXP22X_DCDC3,
+	AXP22X_DCDC4,
+	AXP22X_DCDC5,
+	AXP22X_DC1SW,
+	AXP22X_DC5LDO,
+	AXP22X_ALDO1,
+	AXP22X_ALDO2,
+	AXP22X_ALDO3,
+	AXP22X_ELDO1,
+	AXP22X_ELDO2,
+	AXP22X_ELDO3,
+	AXP22X_DLDO1,
+	AXP22X_DLDO2,
+	AXP22X_DLDO3,
+	AXP22X_DLDO4,
+	AXP22X_RTC_LDO,
+	AXP22X_LDO_IO0,
+	AXP22X_LDO_IO1,
+	AXP22X_REG_ID_MAX,
+};
+
 /* IRQs */
 enum {
 	AXP20X_IRQ_ACIN_OVER_V = 1,
@@ -199,6 +257,34 @@ enum {
 	AXP20X_IRQ_GPIO0_INPUT,
 };
 
+enum axp22x_irqs {
+	AXP22X_IRQ_ACIN_OVER_V = 1,
+	AXP22X_IRQ_ACIN_PLUGIN,
+	AXP22X_IRQ_ACIN_REMOVAL,
+	AXP22X_IRQ_VBUS_OVER_V,
+	AXP22X_IRQ_VBUS_PLUGIN,
+	AXP22X_IRQ_VBUS_REMOVAL,
+	AXP22X_IRQ_VBUS_V_LOW,
+	AXP22X_IRQ_BATT_PLUGIN,
+	AXP22X_IRQ_BATT_REMOVAL,
+	AXP22X_IRQ_BATT_ENT_ACT_MODE,
+	AXP22X_IRQ_BATT_EXIT_ACT_MODE,
+	AXP22X_IRQ_CHARG,
+	AXP22X_IRQ_CHARG_DONE,
+	AXP22X_IRQ_BATT_TEMP_HIGH,
+	AXP22X_IRQ_BATT_TEMP_LOW,
+	AXP22X_IRQ_DIE_TEMP_HIGH,
+	AXP22X_IRQ_PEK_SHORT,
+	AXP22X_IRQ_PEK_LONG,
+	AXP22X_IRQ_LOW_PWR_LVL1,
+	AXP22X_IRQ_LOW_PWR_LVL2,
+	AXP22X_IRQ_TIMER,
+	AXP22X_IRQ_PEK_RIS_EDGE,
+	AXP22X_IRQ_PEK_FAL_EDGE,
+	AXP22X_IRQ_GPIO1_INPUT,
+	AXP22X_IRQ_GPIO0_INPUT,
+};
+
 enum axp288_irqs {
 	AXP288_IRQ_VBUS_FALL     = 2,
 	AXP288_IRQ_VBUS_RISE,
-- 
2.1.4

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

* [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

From: Boris BREZILLON <boris.brezillon@free-electrons.com>

Add support for the AXP22x PMIC devices to the existing AXP20x driver.
This includes the AXP221 and AXP223, which are identical except for
the external data bus. Only AXP221 is added for now. AXP223 will be
added after it's Reduced Serial Bus (RSB) interface is supported.

AXP22x defines a new set of registers, power supplies and regulators,
but most of the API is similar to the AXP20x ones.

A new irq chip definition is used, even though the available interrupts
on AXP22x is a subset of those on AXP20x. This is done so the interrupt
numbers match those on the datasheet.

This patch only enables the interrupts, system power-off function, and PEK
sub-device. The regulator driver must first support different variants
before we enable it from the mfd driver.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
[wens at csie.org: fix interrupts and move regulators to separate patch]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index b1b580a88654..0ec27d5023df 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -32,6 +32,7 @@
 static const char const *axp20x_model_names[] = {
 	"AXP202",
 	"AXP209",
+	"AXP221",
 	"AXP288",
 };
 
@@ -54,6 +55,25 @@ static const struct regmap_access_table axp20x_volatile_table = {
 	.n_yes_ranges	= ARRAY_SIZE(axp20x_volatile_ranges),
 };
 
+static const struct regmap_range axp22x_writeable_ranges[] = {
+	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
+	regmap_reg_range(AXP20X_DCDC_MODE, AXP22X_BATLOW_THRES1),
+};
+
+static const struct regmap_range axp22x_volatile_ranges[] = {
+	regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE),
+};
+
+static const struct regmap_access_table axp22x_writeable_table = {
+	.yes_ranges	= axp22x_writeable_ranges,
+	.n_yes_ranges	= ARRAY_SIZE(axp22x_writeable_ranges),
+};
+
+static const struct regmap_access_table axp22x_volatile_table = {
+	.yes_ranges	= axp22x_volatile_ranges,
+	.n_yes_ranges	= ARRAY_SIZE(axp22x_volatile_ranges),
+};
+
 static const struct regmap_range axp288_writeable_ranges[] = {
 	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ6_STATE),
 	regmap_reg_range(AXP20X_DCDC_MODE, AXP288_FG_TUNE5),
@@ -87,6 +107,20 @@ static struct resource axp20x_pek_resources[] = {
 	},
 };
 
+static struct resource axp22x_pek_resources[] = {
+	{
+		.name   = "PEK_DBR",
+		.start  = AXP22X_IRQ_PEK_RIS_EDGE,
+		.end    = AXP22X_IRQ_PEK_RIS_EDGE,
+		.flags  = IORESOURCE_IRQ,
+	}, {
+		.name   = "PEK_DBF",
+		.start  = AXP22X_IRQ_PEK_FAL_EDGE,
+		.end    = AXP22X_IRQ_PEK_FAL_EDGE,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
 static struct resource axp288_battery_resources[] = {
 	{
 		.start = AXP288_IRQ_QWBTU,
@@ -129,6 +163,15 @@ static const struct regmap_config axp20x_regmap_config = {
 	.cache_type	= REGCACHE_RBTREE,
 };
 
+static const struct regmap_config axp22x_regmap_config = {
+	.reg_bits	= 8,
+	.val_bits	= 8,
+	.wr_table	= &axp22x_writeable_table,
+	.volatile_table	= &axp22x_volatile_table,
+	.max_register	= AXP22X_BATLOW_THRES1,
+	.cache_type	= REGCACHE_RBTREE,
+};
+
 static const struct regmap_config axp288_regmap_config = {
 	.reg_bits	= 8,
 	.val_bits	= 8,
@@ -181,6 +224,34 @@ static const struct regmap_irq axp20x_regmap_irqs[] = {
 	INIT_REGMAP_IRQ(AXP20X, GPIO0_INPUT,		4, 0),
 };
 
+static const struct regmap_irq axp22x_regmap_irqs[] = {
+	INIT_REGMAP_IRQ(AXP22X, ACIN_OVER_V,		0, 7),
+	INIT_REGMAP_IRQ(AXP22X, ACIN_PLUGIN,		0, 6),
+	INIT_REGMAP_IRQ(AXP22X, ACIN_REMOVAL,	        0, 5),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_OVER_V,		0, 4),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_PLUGIN,		0, 3),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_REMOVAL,	        0, 2),
+	INIT_REGMAP_IRQ(AXP22X, VBUS_V_LOW,		0, 1),
+	INIT_REGMAP_IRQ(AXP22X, BATT_PLUGIN,		1, 7),
+	INIT_REGMAP_IRQ(AXP22X, BATT_REMOVAL,	        1, 6),
+	INIT_REGMAP_IRQ(AXP22X, BATT_ENT_ACT_MODE,	1, 5),
+	INIT_REGMAP_IRQ(AXP22X, BATT_EXIT_ACT_MODE,	1, 4),
+	INIT_REGMAP_IRQ(AXP22X, CHARG,		        1, 3),
+	INIT_REGMAP_IRQ(AXP22X, CHARG_DONE,		1, 2),
+	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_HIGH,	        1, 1),
+	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_LOW,	        1, 0),
+	INIT_REGMAP_IRQ(AXP22X, DIE_TEMP_HIGH,	        2, 7),
+	INIT_REGMAP_IRQ(AXP22X, PEK_SHORT,		2, 1),
+	INIT_REGMAP_IRQ(AXP22X, PEK_LONG,		2, 0),
+	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL1,	        3, 1),
+	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL2,	        3, 0),
+	INIT_REGMAP_IRQ(AXP22X, TIMER,		        4, 7),
+	INIT_REGMAP_IRQ(AXP22X, PEK_RIS_EDGE,	        4, 6),
+	INIT_REGMAP_IRQ(AXP22X, PEK_FAL_EDGE,	        4, 5),
+	INIT_REGMAP_IRQ(AXP22X, GPIO1_INPUT,		4, 1),
+	INIT_REGMAP_IRQ(AXP22X, GPIO0_INPUT,		4, 0),
+};
+
 /* some IRQs are compatible with axp20x models */
 static const struct regmap_irq axp288_regmap_irqs[] = {
 	INIT_REGMAP_IRQ(AXP288, VBUS_FALL,              0, 2),
@@ -224,6 +295,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
 static const struct of_device_id axp20x_of_match[] = {
 	{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
 	{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
+	{ .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, axp20x_of_match);
@@ -258,6 +330,18 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
 
 };
 
+static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
+	.name			= "axp22x_irq_chip",
+	.status_base		= AXP20X_IRQ1_STATE,
+	.ack_base		= AXP20X_IRQ1_STATE,
+	.mask_base		= AXP20X_IRQ1_EN,
+	.mask_invert		= true,
+	.init_ack_masked	= true,
+	.irqs			= axp22x_regmap_irqs,
+	.num_irqs		= ARRAY_SIZE(axp22x_regmap_irqs),
+	.num_regs		= 5,
+};
+
 static const struct regmap_irq_chip axp288_regmap_irq_chip = {
 	.name			= "axp288_irq_chip",
 	.status_base		= AXP20X_IRQ1_STATE,
@@ -281,6 +365,14 @@ static struct mfd_cell axp20x_cells[] = {
 	},
 };
 
+static struct mfd_cell axp22x_cells[] = {
+	{
+		.name			= "axp20x-pek",
+		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
+		.resources		= axp22x_pek_resources,
+	},
+};
+
 static struct resource axp288_adc_resources[] = {
 	{
 		.name  = "GPADC",
@@ -398,6 +490,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
 		axp20x->regmap_cfg = &axp20x_regmap_config;
 		axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
 		break;
+	case AXP221_ID:
+		axp20x->nr_cells = ARRAY_SIZE(axp22x_cells);
+		axp20x->cells = axp22x_cells;
+		axp20x->regmap_cfg = &axp22x_regmap_config;
+		axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
+		break;
 	case AXP288_ID:
 		axp20x->cells = axp288_cells;
 		axp20x->nr_cells = ARRAY_SIZE(axp288_cells);
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index dfabd6db7ddf..95568eb798c3 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -14,6 +14,7 @@
 enum {
 	AXP202_ID = 0,
 	AXP209_ID,
+	AXP221_ID,
 	AXP288_ID,
 	NR_AXP20X_VARIANTS,
 };
@@ -45,6 +46,28 @@ enum {
 #define AXP20X_V_LTF_DISCHRG		0x3c
 #define AXP20X_V_HTF_DISCHRG		0x3d
 
+#define AXP22X_PWR_OUT_CTRL1		0x10
+#define AXP22X_PWR_OUT_CTRL2		0x12
+#define AXP22X_PWR_OUT_CTRL3		0x13
+#define AXP22X_DLDO1_V_OUT		0x15
+#define AXP22X_DLDO2_V_OUT		0x16
+#define AXP22X_DLDO3_V_OUT		0x17
+#define AXP22X_DLDO4_V_OUT		0x18
+#define AXP22X_ELDO1_V_OUT		0x19
+#define AXP22X_ELDO2_V_OUT		0x1a
+#define AXP22X_ELDO3_V_OUT		0x1b
+#define AXP22X_DC5LDO_V_OUT		0x1c
+#define AXP22X_DCDC1_V_OUT		0x21
+#define AXP22X_DCDC2_V_OUT		0x22
+#define AXP22X_DCDC3_V_OUT		0x23
+#define AXP22X_DCDC4_V_OUT		0x24
+#define AXP22X_DCDC5_V_OUT		0x25
+#define AXP22X_DCDC23_V_RAMP_CTRL	0x27
+#define AXP22X_ALDO1_V_OUT		0x28
+#define AXP22X_ALDO2_V_OUT		0x29
+#define AXP22X_ALDO3_V_OUT		0x2a
+#define AXP22X_CHRG_CTRL3		0x35
+
 /* Interrupt */
 #define AXP20X_IRQ1_EN			0x40
 #define AXP20X_IRQ2_EN			0x41
@@ -100,6 +123,9 @@ enum {
 #define AXP20X_VBUS_MON			0x8b
 #define AXP20X_OVER_TMP			0x8f
 
+#define AXP22X_PWREN_CTRL1		0x8c
+#define AXP22X_PWREN_CTRL2		0x8d
+
 /* GPIO */
 #define AXP20X_GPIO0_CTRL		0x90
 #define AXP20X_LDO5_V_OUT		0x91
@@ -108,6 +134,11 @@ enum {
 #define AXP20X_GPIO20_SS		0x94
 #define AXP20X_GPIO3_CTRL		0x95
 
+#define AXP22X_LDO_IO0_V_OUT		0x91
+#define AXP22X_LDO_IO1_V_OUT		0x93
+#define AXP22X_GPIO_STATE		0x94
+#define AXP22X_GPIO_PULL_DOWN		0x95
+
 /* Battery */
 #define AXP20X_CHRG_CC_31_24		0xb0
 #define AXP20X_CHRG_CC_23_16		0xb1
@@ -120,6 +151,9 @@ enum {
 #define AXP20X_CC_CTRL			0xb8
 #define AXP20X_FG_RES			0xb9
 
+/* AXP22X specific registers */
+#define AXP22X_BATLOW_THRES1		0xe6
+
 /* AXP288 specific registers */
 #define AXP288_PMIC_ADC_H               0x56
 #define AXP288_PMIC_ADC_L               0x57
@@ -158,6 +192,30 @@ enum {
 	AXP20X_REG_ID_MAX,
 };
 
+enum {
+	AXP22X_DCDC1 = 0,
+	AXP22X_DCDC2,
+	AXP22X_DCDC3,
+	AXP22X_DCDC4,
+	AXP22X_DCDC5,
+	AXP22X_DC1SW,
+	AXP22X_DC5LDO,
+	AXP22X_ALDO1,
+	AXP22X_ALDO2,
+	AXP22X_ALDO3,
+	AXP22X_ELDO1,
+	AXP22X_ELDO2,
+	AXP22X_ELDO3,
+	AXP22X_DLDO1,
+	AXP22X_DLDO2,
+	AXP22X_DLDO3,
+	AXP22X_DLDO4,
+	AXP22X_RTC_LDO,
+	AXP22X_LDO_IO0,
+	AXP22X_LDO_IO1,
+	AXP22X_REG_ID_MAX,
+};
+
 /* IRQs */
 enum {
 	AXP20X_IRQ_ACIN_OVER_V = 1,
@@ -199,6 +257,34 @@ enum {
 	AXP20X_IRQ_GPIO0_INPUT,
 };
 
+enum axp22x_irqs {
+	AXP22X_IRQ_ACIN_OVER_V = 1,
+	AXP22X_IRQ_ACIN_PLUGIN,
+	AXP22X_IRQ_ACIN_REMOVAL,
+	AXP22X_IRQ_VBUS_OVER_V,
+	AXP22X_IRQ_VBUS_PLUGIN,
+	AXP22X_IRQ_VBUS_REMOVAL,
+	AXP22X_IRQ_VBUS_V_LOW,
+	AXP22X_IRQ_BATT_PLUGIN,
+	AXP22X_IRQ_BATT_REMOVAL,
+	AXP22X_IRQ_BATT_ENT_ACT_MODE,
+	AXP22X_IRQ_BATT_EXIT_ACT_MODE,
+	AXP22X_IRQ_CHARG,
+	AXP22X_IRQ_CHARG_DONE,
+	AXP22X_IRQ_BATT_TEMP_HIGH,
+	AXP22X_IRQ_BATT_TEMP_LOW,
+	AXP22X_IRQ_DIE_TEMP_HIGH,
+	AXP22X_IRQ_PEK_SHORT,
+	AXP22X_IRQ_PEK_LONG,
+	AXP22X_IRQ_LOW_PWR_LVL1,
+	AXP22X_IRQ_LOW_PWR_LVL2,
+	AXP22X_IRQ_TIMER,
+	AXP22X_IRQ_PEK_RIS_EDGE,
+	AXP22X_IRQ_PEK_FAL_EDGE,
+	AXP22X_IRQ_GPIO1_INPUT,
+	AXP22X_IRQ_GPIO0_INPUT,
+};
+
 enum axp288_irqs {
 	AXP288_IRQ_VBUS_FALL     = 2,
 	AXP288_IRQ_VBUS_RISE,
-- 
2.1.4

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

* [PATCH v5 04/12] mfd: axp20x: update DT bindings with AXP22x compatibles
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

Add AXP221 to the list of supported devices.

Also replace any mention of AXP20x in the document with a
generic "PMIC".

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 98685f291a72..3914a3f91ff6 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -1,15 +1,16 @@
-AXP202/AXP209 device tree bindings
+AXP family PMIC device tree bindings
 
 The axp20x family current members :
 axp202 (X-Powers)
 axp209 (X-Powers)
+axp221 (X-Powers)
 
 Required properties:
-- compatible: "x-powers,axp202" or "x-powers,axp209"
+- compatible: "x-powers,axp202", "x-powers,axp209", "x-powers,axp221"
 - reg: The I2C slave address for the AXP chip
 - interrupt-parent: The parent interrupt controller
 - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
-- interrupt-controller: axp20x has its own internal IRQs
+- interrupt-controller: The PMIC has its own internal IRQs
 - #interrupt-cells: Should be set to 1
 
 Optional properties:
-- 
2.1.4


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

* [PATCH v5 04/12] mfd: axp20x: update DT bindings with AXP22x compatibles
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

Add AXP221 to the list of supported devices.

Also replace any mention of AXP20x in the document with a
generic "PMIC".

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 98685f291a72..3914a3f91ff6 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -1,15 +1,16 @@
-AXP202/AXP209 device tree bindings
+AXP family PMIC device tree bindings
 
 The axp20x family current members :
 axp202 (X-Powers)
 axp209 (X-Powers)
+axp221 (X-Powers)
 
 Required properties:
-- compatible: "x-powers,axp202" or "x-powers,axp209"
+- compatible: "x-powers,axp202", "x-powers,axp209", "x-powers,axp221"
 - reg: The I2C slave address for the AXP chip
 - interrupt-parent: The parent interrupt controller
 - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
-- interrupt-controller: axp20x has its own internal IRQs
+- interrupt-controller: The PMIC has its own internal IRQs
 - #interrupt-cells: Should be set to 1
 
 Optional properties:
-- 
2.1.4

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

* [PATCH v5 04/12] mfd: axp20x: update DT bindings with AXP22x compatibles
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

Add AXP221 to the list of supported devices.

Also replace any mention of AXP20x in the document with a
generic "PMIC".

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 98685f291a72..3914a3f91ff6 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -1,15 +1,16 @@
-AXP202/AXP209 device tree bindings
+AXP family PMIC device tree bindings
 
 The axp20x family current members :
 axp202 (X-Powers)
 axp209 (X-Powers)
+axp221 (X-Powers)
 
 Required properties:
-- compatible: "x-powers,axp202" or "x-powers,axp209"
+- compatible: "x-powers,axp202", "x-powers,axp209", "x-powers,axp221"
 - reg: The I2C slave address for the AXP chip
 - interrupt-parent: The parent interrupt controller
 - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
-- interrupt-controller: axp20x has its own internal IRQs
+- interrupt-controller: The PMIC has its own internal IRQs
 - #interrupt-cells: Should be set to 1
 
 Optional properties:
-- 
2.1.4

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

* [PATCH v5 05/12] ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

The Hummingbird A31 has an AXP221 PMIC hooked up to the
P2WI controller.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 533bedc5dd95..486ffc69ac96 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -142,6 +142,15 @@
 
 &p2wi {
 	status = "okay";
+
+	axp221: pmic@68 {
+		compatible = "x-powers,axp221";
+		reg = <0x68>;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
 };
 
 &reg_usb1_vbus {
-- 
2.1.4


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

* [PATCH v5 05/12] ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

The Hummingbird A31 has an AXP221 PMIC hooked up to the
P2WI controller.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 533bedc5dd95..486ffc69ac96 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -142,6 +142,15 @@
 
 &p2wi {
 	status = "okay";
+
+	axp221: pmic@68 {
+		compatible = "x-powers,axp221";
+		reg = <0x68>;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
 };
 
 &reg_usb1_vbus {
-- 
2.1.4

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

* [PATCH v5 05/12] ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

The Hummingbird A31 has an AXP221 PMIC hooked up to the
P2WI controller.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 533bedc5dd95..486ffc69ac96 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -142,6 +142,15 @@
 
 &p2wi {
 	status = "okay";
+
+	axp221: pmic at 68 {
+		compatible = "x-powers,axp221";
+		reg = <0x68>;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
 };
 
 &reg_usb1_vbus {
-- 
2.1.4

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

* [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi, Chen-Yu Tsai

From: Boris BREZILLON <boris.brezillon@free-electrons.com>

Rework the AXP20X_ macros and probe function to support the several chip
families, so that each family can define it's own set of regulators.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
[wens@csie.org: Support different DC-DC work frequency ranges]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---

I realize this patch and the next set off a whole bunch of alarms with
lines longer than 80 characters, but I really don't want to introduce
a whole bunch of whitespace changes together.

---
 drivers/regulator/axp20x-regulator.c | 143 +++++++++++++++++++++++------------
 1 file changed, 94 insertions(+), 49 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index e4331f5e5d7d..50ae0b5f2c0c 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -32,15 +32,15 @@
 
 #define AXP20X_FREQ_DCDC_MASK		0x0f
 
-#define AXP20X_DESC_IO(_id, _match, _supply, _min, _max, _step, _vreg, _vmask,	\
-		       _ereg, _emask, _enable_val, _disable_val)		\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_IO(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		    _vmask, _ereg, _emask, _enable_val, _disable_val)		\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_min) * 1000,				\
@@ -54,15 +54,15 @@
 		.ops		= &axp20x_ops,					\
 	}
 
-#define AXP20X_DESC(_id, _match, _supply, _min, _max, _step, _vreg, _vmask,	\
-		    _ereg, _emask)						\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		 _vmask, _ereg, _emask) 					\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_min) * 1000,				\
@@ -74,29 +74,29 @@
 		.ops		= &axp20x_ops,					\
 	}
 
-#define AXP20X_DESC_FIXED(_id, _match, _supply, _volt)				\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_FIXED(_family, _id, _match, _supply, _volt)			\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= 1,						\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_volt) * 1000,				\
 		.ops		= &axp20x_ops_fixed				\
 	}
 
-#define AXP20X_DESC_TABLE(_id, _match, _supply, _table, _vreg, _vmask, _ereg,	\
-			  _emask)						\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_TABLE(_family, _id, _match, _supply, _table, _vreg, _vmask,	\
+		       _ereg, _emask)						\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= ARRAY_SIZE(_table),				\
 		.owner		= THIS_MODULE,					\
 		.vsel_reg	= (_vreg),					\
@@ -136,37 +136,57 @@ static struct regulator_ops axp20x_ops = {
 };
 
 static const struct regulator_desc axp20x_regulators[] = {
-	AXP20X_DESC(DCDC2, "dcdc2", "vin2", 700, 2275, 25, AXP20X_DCDC2_V_OUT,
-		    0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
-	AXP20X_DESC(DCDC3, "dcdc3", "vin3", 700, 3500, 25, AXP20X_DCDC3_V_OUT,
-		    0x7f, AXP20X_PWR_OUT_CTRL, 0x02),
-	AXP20X_DESC_FIXED(LDO1, "ldo1", "acin", 1300),
-	AXP20X_DESC(LDO2, "ldo2", "ldo24in", 1800, 3300, 100,
-		    AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04),
-	AXP20X_DESC(LDO3, "ldo3", "ldo3in", 700, 3500, 25, AXP20X_LDO3_V_OUT,
-		    0x7f, AXP20X_PWR_OUT_CTRL, 0x40),
-	AXP20X_DESC_TABLE(LDO4, "ldo4", "ldo24in", axp20x_ldo4_data,
-			  AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL, 0x08),
-	AXP20X_DESC_IO(LDO5, "ldo5", "ldo5in", 1800, 3300, 100,
-		       AXP20X_LDO5_V_OUT, 0xf0, AXP20X_GPIO0_CTRL, 0x07,
-		       AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
+	AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
+		 AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
+	AXP_DESC(AXP20X, DCDC3, "dcdc3", "vin3", 700, 3500, 25,
+		 AXP20X_DCDC3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x02),
+	AXP_DESC_FIXED(AXP20X, LDO1, "ldo1", "acin", 1300),
+	AXP_DESC(AXP20X, LDO2, "ldo2", "ldo24in", 1800, 3300, 100,
+		 AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04),
+	AXP_DESC(AXP20X, LDO3, "ldo3", "ldo3in", 700, 3500, 25,
+		 AXP20X_LDO3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x40),
+	AXP_DESC_TABLE(AXP20X, LDO4, "ldo4", "ldo24in", axp20x_ldo4_data,
+		       AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL, 0x08),
+	AXP_DESC_IO(AXP20X, LDO5, "ldo5", "ldo5in", 1800, 3300, 100,
+		    AXP20X_LDO5_V_OUT, 0xf0, AXP20X_GPIO0_CTRL, 0x07,
+		    AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
 };
 
 static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 {
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
+	u32 min, max, def, step;
+
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		min = 750;
+		max = 1875;
+		def = 1500;
+		step = 75;
+		break;
+	default:
+		dev_err(&pdev->dev,
+			"Setting DCDC frequency for unsupported AXP variant\n");
+		return -EINVAL;
+	}
+
+	if (dcdcfreq == 0)
+		dcdcfreq = def;
 
-	if (dcdcfreq < 750) {
-		dcdcfreq = 750;
-		dev_warn(&pdev->dev, "DCDC frequency too low. Set to 750kHz\n");
+	if (dcdcfreq < min) {
+		dcdcfreq = min;
+		dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n",
+			 min);
 	}
 
-	if (dcdcfreq > 1875) {
-		dcdcfreq = 1875;
-		dev_warn(&pdev->dev, "DCDC frequency too high. Set to 1875kHz\n");
+	if (dcdcfreq > max) {
+		dcdcfreq = max;
+		dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n",
+			 max);
 	}
 
-	dcdcfreq = (dcdcfreq - 750) / 75;
+	dcdcfreq = (dcdcfreq - min) / step;
 
 	return regmap_update_bits(axp20x->regmap, AXP20X_DCDC_FREQ,
 				  AXP20X_FREQ_DCDC_MASK, dcdcfreq);
@@ -176,7 +196,7 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 {
 	struct device_node *np, *regulators;
 	int ret;
-	u32 dcdcfreq;
+	u32 dcdcfreq = 0;
 
 	np = of_node_get(pdev->dev.parent->of_node);
 	if (!np)
@@ -186,7 +206,6 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 	if (!regulators) {
 		dev_warn(&pdev->dev, "regulators node not found\n");
 	} else {
-		dcdcfreq = 1500;
 		of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq);
 		ret = axp20x_set_dcdc_freq(pdev, dcdcfreq);
 		if (ret < 0) {
@@ -202,15 +221,27 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 
 static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 workmode)
 {
-	unsigned int mask = AXP20X_WORKMODE_DCDC2_MASK;
+	struct axp20x_dev *axp20x = rdev_get_drvdata(rdev);
+	unsigned int mask;
 
-	if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3))
-		return -EINVAL;
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3))
+			return -EINVAL;
+
+		mask = AXP20X_WORKMODE_DCDC2_MASK;
+		if (id == AXP20X_DCDC3)
+			mask = AXP20X_WORKMODE_DCDC3_MASK;
 
-	if (id == AXP20X_DCDC3)
-		mask = AXP20X_WORKMODE_DCDC3_MASK;
+		workmode <<= ffs(mask) - 1;
+		break;
 
-	workmode <<= ffs(mask) - 1;
+	default:
+		/* should not happen */
+		WARN_ON(1);
+		return -EINVAL;
+	}
 
 	return regmap_update_bits(rdev->regmap, AXP20X_DCDC_MODE, mask, workmode);
 }
@@ -219,22 +250,36 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 {
 	struct regulator_dev *rdev;
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
+	const struct regulator_desc *regulators;
 	struct regulator_config config = {
 		.dev = pdev->dev.parent,
 		.regmap = axp20x->regmap,
+		.driver_data = axp20x,
 	};
-	int ret, i;
+	int ret, i, nregulators;
 	u32 workmode;
 
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		regulators = axp20x_regulators;
+		nregulators = AXP20X_REG_ID_MAX;
+		break;
+	default:
+		dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n",
+			axp20x->variant);
+		return -EINVAL;
+	}
+
 	/* This only sets the dcdc freq. Ignore any errors */
 	axp20x_regulator_parse_dt(pdev);
 
-	for (i = 0; i < AXP20X_REG_ID_MAX; i++) {
-		rdev = devm_regulator_register(&pdev->dev, &axp20x_regulators[i],
+	for (i = 0; i < nregulators; i++) {
+		rdev = devm_regulator_register(&pdev->dev, &regulators[i],
 					       &config);
 		if (IS_ERR(rdev)) {
 			dev_err(&pdev->dev, "Failed to register %s\n",
-				axp20x_regulators[i].name);
+				regulators[i].name);
 
 			return PTR_ERR(rdev);
 		}
@@ -245,7 +290,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 		if (!ret) {
 			if (axp20x_set_dcdc_workmode(rdev, i, workmode))
 				dev_err(&pdev->dev, "Failed to set workmode on %s\n",
-					axp20x_regulators[i].name);
+					rdev->desc->name);
 		}
 	}
 
-- 
2.1.4


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

* [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Boris BREZILLON,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Chen-Yu Tsai

From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

Rework the AXP20X_ macros and probe function to support the several chip
families, so that each family can define it's own set of regulators.

Signed-off-by: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
[wens-jdAy2FN1RRM@public.gmane.org: Support different DC-DC work frequency ranges]
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---

I realize this patch and the next set off a whole bunch of alarms with
lines longer than 80 characters, but I really don't want to introduce
a whole bunch of whitespace changes together.

---
 drivers/regulator/axp20x-regulator.c | 143 +++++++++++++++++++++++------------
 1 file changed, 94 insertions(+), 49 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index e4331f5e5d7d..50ae0b5f2c0c 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -32,15 +32,15 @@
 
 #define AXP20X_FREQ_DCDC_MASK		0x0f
 
-#define AXP20X_DESC_IO(_id, _match, _supply, _min, _max, _step, _vreg, _vmask,	\
-		       _ereg, _emask, _enable_val, _disable_val)		\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_IO(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		    _vmask, _ereg, _emask, _enable_val, _disable_val)		\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_min) * 1000,				\
@@ -54,15 +54,15 @@
 		.ops		= &axp20x_ops,					\
 	}
 
-#define AXP20X_DESC(_id, _match, _supply, _min, _max, _step, _vreg, _vmask,	\
-		    _ereg, _emask)						\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		 _vmask, _ereg, _emask) 					\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_min) * 1000,				\
@@ -74,29 +74,29 @@
 		.ops		= &axp20x_ops,					\
 	}
 
-#define AXP20X_DESC_FIXED(_id, _match, _supply, _volt)				\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_FIXED(_family, _id, _match, _supply, _volt)			\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= 1,						\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_volt) * 1000,				\
 		.ops		= &axp20x_ops_fixed				\
 	}
 
-#define AXP20X_DESC_TABLE(_id, _match, _supply, _table, _vreg, _vmask, _ereg,	\
-			  _emask)						\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_TABLE(_family, _id, _match, _supply, _table, _vreg, _vmask,	\
+		       _ereg, _emask)						\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= ARRAY_SIZE(_table),				\
 		.owner		= THIS_MODULE,					\
 		.vsel_reg	= (_vreg),					\
@@ -136,37 +136,57 @@ static struct regulator_ops axp20x_ops = {
 };
 
 static const struct regulator_desc axp20x_regulators[] = {
-	AXP20X_DESC(DCDC2, "dcdc2", "vin2", 700, 2275, 25, AXP20X_DCDC2_V_OUT,
-		    0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
-	AXP20X_DESC(DCDC3, "dcdc3", "vin3", 700, 3500, 25, AXP20X_DCDC3_V_OUT,
-		    0x7f, AXP20X_PWR_OUT_CTRL, 0x02),
-	AXP20X_DESC_FIXED(LDO1, "ldo1", "acin", 1300),
-	AXP20X_DESC(LDO2, "ldo2", "ldo24in", 1800, 3300, 100,
-		    AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04),
-	AXP20X_DESC(LDO3, "ldo3", "ldo3in", 700, 3500, 25, AXP20X_LDO3_V_OUT,
-		    0x7f, AXP20X_PWR_OUT_CTRL, 0x40),
-	AXP20X_DESC_TABLE(LDO4, "ldo4", "ldo24in", axp20x_ldo4_data,
-			  AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL, 0x08),
-	AXP20X_DESC_IO(LDO5, "ldo5", "ldo5in", 1800, 3300, 100,
-		       AXP20X_LDO5_V_OUT, 0xf0, AXP20X_GPIO0_CTRL, 0x07,
-		       AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
+	AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
+		 AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
+	AXP_DESC(AXP20X, DCDC3, "dcdc3", "vin3", 700, 3500, 25,
+		 AXP20X_DCDC3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x02),
+	AXP_DESC_FIXED(AXP20X, LDO1, "ldo1", "acin", 1300),
+	AXP_DESC(AXP20X, LDO2, "ldo2", "ldo24in", 1800, 3300, 100,
+		 AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04),
+	AXP_DESC(AXP20X, LDO3, "ldo3", "ldo3in", 700, 3500, 25,
+		 AXP20X_LDO3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x40),
+	AXP_DESC_TABLE(AXP20X, LDO4, "ldo4", "ldo24in", axp20x_ldo4_data,
+		       AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL, 0x08),
+	AXP_DESC_IO(AXP20X, LDO5, "ldo5", "ldo5in", 1800, 3300, 100,
+		    AXP20X_LDO5_V_OUT, 0xf0, AXP20X_GPIO0_CTRL, 0x07,
+		    AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
 };
 
 static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 {
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
+	u32 min, max, def, step;
+
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		min = 750;
+		max = 1875;
+		def = 1500;
+		step = 75;
+		break;
+	default:
+		dev_err(&pdev->dev,
+			"Setting DCDC frequency for unsupported AXP variant\n");
+		return -EINVAL;
+	}
+
+	if (dcdcfreq == 0)
+		dcdcfreq = def;
 
-	if (dcdcfreq < 750) {
-		dcdcfreq = 750;
-		dev_warn(&pdev->dev, "DCDC frequency too low. Set to 750kHz\n");
+	if (dcdcfreq < min) {
+		dcdcfreq = min;
+		dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n",
+			 min);
 	}
 
-	if (dcdcfreq > 1875) {
-		dcdcfreq = 1875;
-		dev_warn(&pdev->dev, "DCDC frequency too high. Set to 1875kHz\n");
+	if (dcdcfreq > max) {
+		dcdcfreq = max;
+		dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n",
+			 max);
 	}
 
-	dcdcfreq = (dcdcfreq - 750) / 75;
+	dcdcfreq = (dcdcfreq - min) / step;
 
 	return regmap_update_bits(axp20x->regmap, AXP20X_DCDC_FREQ,
 				  AXP20X_FREQ_DCDC_MASK, dcdcfreq);
@@ -176,7 +196,7 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 {
 	struct device_node *np, *regulators;
 	int ret;
-	u32 dcdcfreq;
+	u32 dcdcfreq = 0;
 
 	np = of_node_get(pdev->dev.parent->of_node);
 	if (!np)
@@ -186,7 +206,6 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 	if (!regulators) {
 		dev_warn(&pdev->dev, "regulators node not found\n");
 	} else {
-		dcdcfreq = 1500;
 		of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq);
 		ret = axp20x_set_dcdc_freq(pdev, dcdcfreq);
 		if (ret < 0) {
@@ -202,15 +221,27 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 
 static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 workmode)
 {
-	unsigned int mask = AXP20X_WORKMODE_DCDC2_MASK;
+	struct axp20x_dev *axp20x = rdev_get_drvdata(rdev);
+	unsigned int mask;
 
-	if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3))
-		return -EINVAL;
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3))
+			return -EINVAL;
+
+		mask = AXP20X_WORKMODE_DCDC2_MASK;
+		if (id == AXP20X_DCDC3)
+			mask = AXP20X_WORKMODE_DCDC3_MASK;
 
-	if (id == AXP20X_DCDC3)
-		mask = AXP20X_WORKMODE_DCDC3_MASK;
+		workmode <<= ffs(mask) - 1;
+		break;
 
-	workmode <<= ffs(mask) - 1;
+	default:
+		/* should not happen */
+		WARN_ON(1);
+		return -EINVAL;
+	}
 
 	return regmap_update_bits(rdev->regmap, AXP20X_DCDC_MODE, mask, workmode);
 }
@@ -219,22 +250,36 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 {
 	struct regulator_dev *rdev;
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
+	const struct regulator_desc *regulators;
 	struct regulator_config config = {
 		.dev = pdev->dev.parent,
 		.regmap = axp20x->regmap,
+		.driver_data = axp20x,
 	};
-	int ret, i;
+	int ret, i, nregulators;
 	u32 workmode;
 
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		regulators = axp20x_regulators;
+		nregulators = AXP20X_REG_ID_MAX;
+		break;
+	default:
+		dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n",
+			axp20x->variant);
+		return -EINVAL;
+	}
+
 	/* This only sets the dcdc freq. Ignore any errors */
 	axp20x_regulator_parse_dt(pdev);
 
-	for (i = 0; i < AXP20X_REG_ID_MAX; i++) {
-		rdev = devm_regulator_register(&pdev->dev, &axp20x_regulators[i],
+	for (i = 0; i < nregulators; i++) {
+		rdev = devm_regulator_register(&pdev->dev, &regulators[i],
 					       &config);
 		if (IS_ERR(rdev)) {
 			dev_err(&pdev->dev, "Failed to register %s\n",
-				axp20x_regulators[i].name);
+				regulators[i].name);
 
 			return PTR_ERR(rdev);
 		}
@@ -245,7 +290,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 		if (!ret) {
 			if (axp20x_set_dcdc_workmode(rdev, i, workmode))
 				dev_err(&pdev->dev, "Failed to set workmode on %s\n",
-					axp20x_regulators[i].name);
+					rdev->desc->name);
 		}
 	}
 
-- 
2.1.4

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

* [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

From: Boris BREZILLON <boris.brezillon@free-electrons.com>

Rework the AXP20X_ macros and probe function to support the several chip
families, so that each family can define it's own set of regulators.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
[wens at csie.org: Support different DC-DC work frequency ranges]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---

I realize this patch and the next set off a whole bunch of alarms with
lines longer than 80 characters, but I really don't want to introduce
a whole bunch of whitespace changes together.

---
 drivers/regulator/axp20x-regulator.c | 143 +++++++++++++++++++++++------------
 1 file changed, 94 insertions(+), 49 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index e4331f5e5d7d..50ae0b5f2c0c 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -32,15 +32,15 @@
 
 #define AXP20X_FREQ_DCDC_MASK		0x0f
 
-#define AXP20X_DESC_IO(_id, _match, _supply, _min, _max, _step, _vreg, _vmask,	\
-		       _ereg, _emask, _enable_val, _disable_val)		\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_IO(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		    _vmask, _ereg, _emask, _enable_val, _disable_val)		\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_min) * 1000,				\
@@ -54,15 +54,15 @@
 		.ops		= &axp20x_ops,					\
 	}
 
-#define AXP20X_DESC(_id, _match, _supply, _min, _max, _step, _vreg, _vmask,	\
-		    _ereg, _emask)						\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		 _vmask, _ereg, _emask) 					\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_min) * 1000,				\
@@ -74,29 +74,29 @@
 		.ops		= &axp20x_ops,					\
 	}
 
-#define AXP20X_DESC_FIXED(_id, _match, _supply, _volt)				\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_FIXED(_family, _id, _match, _supply, _volt)			\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= 1,						\
 		.owner		= THIS_MODULE,					\
 		.min_uV		= (_volt) * 1000,				\
 		.ops		= &axp20x_ops_fixed				\
 	}
 
-#define AXP20X_DESC_TABLE(_id, _match, _supply, _table, _vreg, _vmask, _ereg,	\
-			  _emask)						\
-	[AXP20X_##_id] = {							\
+#define AXP_DESC_TABLE(_family, _id, _match, _supply, _table, _vreg, _vmask,	\
+		       _ereg, _emask)						\
+	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
 		.of_match	= of_match_ptr(_match),				\
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
-		.id		= AXP20X_##_id,					\
+		.id		= _family##_##_id,				\
 		.n_voltages	= ARRAY_SIZE(_table),				\
 		.owner		= THIS_MODULE,					\
 		.vsel_reg	= (_vreg),					\
@@ -136,37 +136,57 @@ static struct regulator_ops axp20x_ops = {
 };
 
 static const struct regulator_desc axp20x_regulators[] = {
-	AXP20X_DESC(DCDC2, "dcdc2", "vin2", 700, 2275, 25, AXP20X_DCDC2_V_OUT,
-		    0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
-	AXP20X_DESC(DCDC3, "dcdc3", "vin3", 700, 3500, 25, AXP20X_DCDC3_V_OUT,
-		    0x7f, AXP20X_PWR_OUT_CTRL, 0x02),
-	AXP20X_DESC_FIXED(LDO1, "ldo1", "acin", 1300),
-	AXP20X_DESC(LDO2, "ldo2", "ldo24in", 1800, 3300, 100,
-		    AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04),
-	AXP20X_DESC(LDO3, "ldo3", "ldo3in", 700, 3500, 25, AXP20X_LDO3_V_OUT,
-		    0x7f, AXP20X_PWR_OUT_CTRL, 0x40),
-	AXP20X_DESC_TABLE(LDO4, "ldo4", "ldo24in", axp20x_ldo4_data,
-			  AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL, 0x08),
-	AXP20X_DESC_IO(LDO5, "ldo5", "ldo5in", 1800, 3300, 100,
-		       AXP20X_LDO5_V_OUT, 0xf0, AXP20X_GPIO0_CTRL, 0x07,
-		       AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
+	AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
+		 AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
+	AXP_DESC(AXP20X, DCDC3, "dcdc3", "vin3", 700, 3500, 25,
+		 AXP20X_DCDC3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x02),
+	AXP_DESC_FIXED(AXP20X, LDO1, "ldo1", "acin", 1300),
+	AXP_DESC(AXP20X, LDO2, "ldo2", "ldo24in", 1800, 3300, 100,
+		 AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04),
+	AXP_DESC(AXP20X, LDO3, "ldo3", "ldo3in", 700, 3500, 25,
+		 AXP20X_LDO3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x40),
+	AXP_DESC_TABLE(AXP20X, LDO4, "ldo4", "ldo24in", axp20x_ldo4_data,
+		       AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL, 0x08),
+	AXP_DESC_IO(AXP20X, LDO5, "ldo5", "ldo5in", 1800, 3300, 100,
+		    AXP20X_LDO5_V_OUT, 0xf0, AXP20X_GPIO0_CTRL, 0x07,
+		    AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
 };
 
 static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 {
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
+	u32 min, max, def, step;
+
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		min = 750;
+		max = 1875;
+		def = 1500;
+		step = 75;
+		break;
+	default:
+		dev_err(&pdev->dev,
+			"Setting DCDC frequency for unsupported AXP variant\n");
+		return -EINVAL;
+	}
+
+	if (dcdcfreq == 0)
+		dcdcfreq = def;
 
-	if (dcdcfreq < 750) {
-		dcdcfreq = 750;
-		dev_warn(&pdev->dev, "DCDC frequency too low. Set to 750kHz\n");
+	if (dcdcfreq < min) {
+		dcdcfreq = min;
+		dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n",
+			 min);
 	}
 
-	if (dcdcfreq > 1875) {
-		dcdcfreq = 1875;
-		dev_warn(&pdev->dev, "DCDC frequency too high. Set to 1875kHz\n");
+	if (dcdcfreq > max) {
+		dcdcfreq = max;
+		dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n",
+			 max);
 	}
 
-	dcdcfreq = (dcdcfreq - 750) / 75;
+	dcdcfreq = (dcdcfreq - min) / step;
 
 	return regmap_update_bits(axp20x->regmap, AXP20X_DCDC_FREQ,
 				  AXP20X_FREQ_DCDC_MASK, dcdcfreq);
@@ -176,7 +196,7 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 {
 	struct device_node *np, *regulators;
 	int ret;
-	u32 dcdcfreq;
+	u32 dcdcfreq = 0;
 
 	np = of_node_get(pdev->dev.parent->of_node);
 	if (!np)
@@ -186,7 +206,6 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 	if (!regulators) {
 		dev_warn(&pdev->dev, "regulators node not found\n");
 	} else {
-		dcdcfreq = 1500;
 		of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq);
 		ret = axp20x_set_dcdc_freq(pdev, dcdcfreq);
 		if (ret < 0) {
@@ -202,15 +221,27 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 
 static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 workmode)
 {
-	unsigned int mask = AXP20X_WORKMODE_DCDC2_MASK;
+	struct axp20x_dev *axp20x = rdev_get_drvdata(rdev);
+	unsigned int mask;
 
-	if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3))
-		return -EINVAL;
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3))
+			return -EINVAL;
+
+		mask = AXP20X_WORKMODE_DCDC2_MASK;
+		if (id == AXP20X_DCDC3)
+			mask = AXP20X_WORKMODE_DCDC3_MASK;
 
-	if (id == AXP20X_DCDC3)
-		mask = AXP20X_WORKMODE_DCDC3_MASK;
+		workmode <<= ffs(mask) - 1;
+		break;
 
-	workmode <<= ffs(mask) - 1;
+	default:
+		/* should not happen */
+		WARN_ON(1);
+		return -EINVAL;
+	}
 
 	return regmap_update_bits(rdev->regmap, AXP20X_DCDC_MODE, mask, workmode);
 }
@@ -219,22 +250,36 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 {
 	struct regulator_dev *rdev;
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
+	const struct regulator_desc *regulators;
 	struct regulator_config config = {
 		.dev = pdev->dev.parent,
 		.regmap = axp20x->regmap,
+		.driver_data = axp20x,
 	};
-	int ret, i;
+	int ret, i, nregulators;
 	u32 workmode;
 
+	switch (axp20x->variant) {
+	case AXP202_ID:
+	case AXP209_ID:
+		regulators = axp20x_regulators;
+		nregulators = AXP20X_REG_ID_MAX;
+		break;
+	default:
+		dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n",
+			axp20x->variant);
+		return -EINVAL;
+	}
+
 	/* This only sets the dcdc freq. Ignore any errors */
 	axp20x_regulator_parse_dt(pdev);
 
-	for (i = 0; i < AXP20X_REG_ID_MAX; i++) {
-		rdev = devm_regulator_register(&pdev->dev, &axp20x_regulators[i],
+	for (i = 0; i < nregulators; i++) {
+		rdev = devm_regulator_register(&pdev->dev, &regulators[i],
 					       &config);
 		if (IS_ERR(rdev)) {
 			dev_err(&pdev->dev, "Failed to register %s\n",
-				axp20x_regulators[i].name);
+				regulators[i].name);
 
 			return PTR_ERR(rdev);
 		}
@@ -245,7 +290,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 		if (!ret) {
 			if (axp20x_set_dcdc_workmode(rdev, i, workmode))
 				dev_err(&pdev->dev, "Failed to set workmode on %s\n",
-					axp20x_regulators[i].name);
+					rdev->desc->name);
 		}
 	}
 
-- 
2.1.4

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

* [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi, Chen-Yu Tsai

From: Boris BREZILLON <boris.brezillon@free-electrons.com>

Add AXP22X regulator definitions and variant id associations.
This introduces a new "switch" type output for one of the regulators.
It is a switchable secondary output of one regulator, with the same
voltage level as the primary output.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
[wens@csie.org: Moved variant choosing to multi family support patch]
[wens@csie.org: Add dc-dc work frequency range]
[wens@csie.org: Add "switch" type output regulator DC1SW]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/regulator/axp20x-regulator.c | 96 ++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 50ae0b5f2c0c..646829132b59 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -27,8 +27,12 @@
 #define AXP20X_IO_ENABLED		0x03
 #define AXP20X_IO_DISABLED		0x07
 
+#define AXP22X_IO_ENABLED		0x04
+#define AXP22X_IO_DISABLED		0x03
+
 #define AXP20X_WORKMODE_DCDC2_MASK	BIT(2)
 #define AXP20X_WORKMODE_DCDC3_MASK	BIT(1)
+#define AXP22X_WORKMODE_DCDCX_MASK(x)	BIT(x)
 
 #define AXP20X_FREQ_DCDC_MASK		0x0f
 
@@ -74,6 +78,26 @@
 		.ops		= &axp20x_ops,					\
 	}
 
+#define AXP_DESC_SW(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		    _vmask, _ereg, _emask) 					\
+	[_family##_##_id] = {							\
+		.name		= #_id,						\
+		.supply_name	= (_supply),					\
+		.of_match	= of_match_ptr(_match),				\
+		.regulators_node = of_match_ptr("regulators"),			\
+		.type		= REGULATOR_VOLTAGE,				\
+		.id		= _family##_##_id,				\
+		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
+		.owner		= THIS_MODULE,					\
+		.min_uV		= (_min) * 1000,				\
+		.uV_step	= (_step) * 1000,				\
+		.vsel_reg	= (_vreg),					\
+		.vsel_mask	= (_vmask),					\
+		.enable_reg	= (_ereg),					\
+		.enable_mask	= (_emask),					\
+		.ops		= &axp20x_ops_sw,				\
+	}
+
 #define AXP_DESC_FIXED(_family, _id, _match, _supply, _volt)			\
 	[_family##_##_id] = {							\
 		.name		= #_id,						\
@@ -135,6 +159,14 @@ static struct regulator_ops axp20x_ops = {
 	.is_enabled		= regulator_is_enabled_regmap,
 };
 
+static struct regulator_ops axp20x_ops_sw = {
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.list_voltage		= regulator_list_voltage_linear,
+	.enable			= regulator_enable_regmap,
+	.disable		= regulator_disable_regmap,
+	.is_enabled		= regulator_is_enabled_regmap,
+};
+
 static const struct regulator_desc axp20x_regulators[] = {
 	AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
 		 AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
@@ -152,6 +184,52 @@ static const struct regulator_desc axp20x_regulators[] = {
 		    AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
 };
 
+static const struct regulator_desc axp22x_regulators[] = {
+	AXP_DESC(AXP22X, DCDC1, "dcdc1", "vin1", 1600, 3400, 100,
+		 AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(1)),
+	AXP_DESC(AXP22X, DCDC2, "dcdc2", "vin2", 600, 1540, 20,
+		 AXP22X_DCDC2_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(2)),
+	AXP_DESC(AXP22X, DCDC3, "dcdc3", "vin3", 600, 1860, 20,
+		 AXP22X_DCDC3_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(3)),
+	AXP_DESC(AXP22X, DCDC4, "dcdc4", "vin4", 600, 1540, 20,
+		 AXP22X_DCDC4_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(3)),
+	AXP_DESC(AXP22X, DCDC5, "dcdc5", "vin5", 1000, 2550, 50,
+		 AXP22X_DCDC5_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(4)),
+	/* secondary switchable output of DCDC1 */
+	AXP_DESC_SW(AXP22X, DC1SW, "dc1sw", "dcdc1", 1600, 3400, 100,
+		    AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(7)),
+	/* LDO regulator internally chained to DCDC5 */
+	AXP_DESC(AXP22X, DC5LDO, "dc5ldo", "dcdc5", 700, 1400, 100,
+		 AXP22X_DC5LDO_V_OUT, 0x7, AXP22X_PWR_OUT_CTRL1, BIT(0)),
+	AXP_DESC(AXP22X, ALDO1, "aldo1", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(6)),
+	AXP_DESC(AXP22X, ALDO2, "aldo2", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(7)),
+	AXP_DESC(AXP22X, ALDO3, "aldo3", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(7)),
+	AXP_DESC(AXP22X, DLDO1, "dldo1", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(3)),
+	AXP_DESC(AXP22X, DLDO2, "dldo2", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(4)),
+	AXP_DESC(AXP22X, DLDO3, "dldo3", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(5)),
+	AXP_DESC(AXP22X, DLDO4, "dldo4", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO4_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(6)),
+	AXP_DESC(AXP22X, ELDO1, "eldo1", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(0)),
+	AXP_DESC(AXP22X, ELDO2, "eldo2", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)),
+	AXP_DESC(AXP22X, ELDO3, "eldo3", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)),
+	AXP_DESC_IO(AXP22X, LDO_IO0, "ldo_io0", "ips", 1800, 3300, 100,
+		    AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07,
+		    AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
+	AXP_DESC_IO(AXP22X, LDO_IO1, "ldo_io1", "ips", 1800, 3300, 100,
+		    AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07,
+		    AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
+	AXP_DESC_FIXED(AXP22X, RTC_LDO, "rtc_ldo", "ips", 3000),
+};
+
 static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 {
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
@@ -165,6 +243,12 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 		def = 1500;
 		step = 75;
 		break;
+	case AXP221_ID:
+		min = 1800;
+		max = 4050;
+		def = 3000;
+		step = 150;
+		break;
 	default:
 		dev_err(&pdev->dev,
 			"Setting DCDC frequency for unsupported AXP variant\n");
@@ -237,6 +321,14 @@ static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 work
 		workmode <<= ffs(mask) - 1;
 		break;
 
+	case AXP221_ID:
+		if (id < AXP22X_DCDC1 || id > AXP22X_DCDC5)
+			return -EINVAL;
+
+		mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP22X_DCDC1);
+		workmode <<= id - AXP22X_DCDC1;
+		break;
+
 	default:
 		/* should not happen */
 		WARN_ON(1);
@@ -265,6 +357,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 		regulators = axp20x_regulators;
 		nregulators = AXP20X_REG_ID_MAX;
 		break;
+	case AXP221_ID:
+		regulators = axp22x_regulators;
+		nregulators = AXP22X_REG_ID_MAX;
+		break;
 	default:
 		dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n",
 			axp20x->variant);
-- 
2.1.4


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

* [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Boris BREZILLON,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Chen-Yu Tsai

From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

Add AXP22X regulator definitions and variant id associations.
This introduces a new "switch" type output for one of the regulators.
It is a switchable secondary output of one regulator, with the same
voltage level as the primary output.

Signed-off-by: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
[wens-jdAy2FN1RRM@public.gmane.org: Moved variant choosing to multi family support patch]
[wens-jdAy2FN1RRM@public.gmane.org: Add dc-dc work frequency range]
[wens-jdAy2FN1RRM@public.gmane.org: Add "switch" type output regulator DC1SW]
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 drivers/regulator/axp20x-regulator.c | 96 ++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 50ae0b5f2c0c..646829132b59 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -27,8 +27,12 @@
 #define AXP20X_IO_ENABLED		0x03
 #define AXP20X_IO_DISABLED		0x07
 
+#define AXP22X_IO_ENABLED		0x04
+#define AXP22X_IO_DISABLED		0x03
+
 #define AXP20X_WORKMODE_DCDC2_MASK	BIT(2)
 #define AXP20X_WORKMODE_DCDC3_MASK	BIT(1)
+#define AXP22X_WORKMODE_DCDCX_MASK(x)	BIT(x)
 
 #define AXP20X_FREQ_DCDC_MASK		0x0f
 
@@ -74,6 +78,26 @@
 		.ops		= &axp20x_ops,					\
 	}
 
+#define AXP_DESC_SW(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		    _vmask, _ereg, _emask) 					\
+	[_family##_##_id] = {							\
+		.name		= #_id,						\
+		.supply_name	= (_supply),					\
+		.of_match	= of_match_ptr(_match),				\
+		.regulators_node = of_match_ptr("regulators"),			\
+		.type		= REGULATOR_VOLTAGE,				\
+		.id		= _family##_##_id,				\
+		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
+		.owner		= THIS_MODULE,					\
+		.min_uV		= (_min) * 1000,				\
+		.uV_step	= (_step) * 1000,				\
+		.vsel_reg	= (_vreg),					\
+		.vsel_mask	= (_vmask),					\
+		.enable_reg	= (_ereg),					\
+		.enable_mask	= (_emask),					\
+		.ops		= &axp20x_ops_sw,				\
+	}
+
 #define AXP_DESC_FIXED(_family, _id, _match, _supply, _volt)			\
 	[_family##_##_id] = {							\
 		.name		= #_id,						\
@@ -135,6 +159,14 @@ static struct regulator_ops axp20x_ops = {
 	.is_enabled		= regulator_is_enabled_regmap,
 };
 
+static struct regulator_ops axp20x_ops_sw = {
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.list_voltage		= regulator_list_voltage_linear,
+	.enable			= regulator_enable_regmap,
+	.disable		= regulator_disable_regmap,
+	.is_enabled		= regulator_is_enabled_regmap,
+};
+
 static const struct regulator_desc axp20x_regulators[] = {
 	AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
 		 AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
@@ -152,6 +184,52 @@ static const struct regulator_desc axp20x_regulators[] = {
 		    AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
 };
 
+static const struct regulator_desc axp22x_regulators[] = {
+	AXP_DESC(AXP22X, DCDC1, "dcdc1", "vin1", 1600, 3400, 100,
+		 AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(1)),
+	AXP_DESC(AXP22X, DCDC2, "dcdc2", "vin2", 600, 1540, 20,
+		 AXP22X_DCDC2_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(2)),
+	AXP_DESC(AXP22X, DCDC3, "dcdc3", "vin3", 600, 1860, 20,
+		 AXP22X_DCDC3_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(3)),
+	AXP_DESC(AXP22X, DCDC4, "dcdc4", "vin4", 600, 1540, 20,
+		 AXP22X_DCDC4_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(3)),
+	AXP_DESC(AXP22X, DCDC5, "dcdc5", "vin5", 1000, 2550, 50,
+		 AXP22X_DCDC5_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(4)),
+	/* secondary switchable output of DCDC1 */
+	AXP_DESC_SW(AXP22X, DC1SW, "dc1sw", "dcdc1", 1600, 3400, 100,
+		    AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(7)),
+	/* LDO regulator internally chained to DCDC5 */
+	AXP_DESC(AXP22X, DC5LDO, "dc5ldo", "dcdc5", 700, 1400, 100,
+		 AXP22X_DC5LDO_V_OUT, 0x7, AXP22X_PWR_OUT_CTRL1, BIT(0)),
+	AXP_DESC(AXP22X, ALDO1, "aldo1", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(6)),
+	AXP_DESC(AXP22X, ALDO2, "aldo2", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(7)),
+	AXP_DESC(AXP22X, ALDO3, "aldo3", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(7)),
+	AXP_DESC(AXP22X, DLDO1, "dldo1", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(3)),
+	AXP_DESC(AXP22X, DLDO2, "dldo2", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(4)),
+	AXP_DESC(AXP22X, DLDO3, "dldo3", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(5)),
+	AXP_DESC(AXP22X, DLDO4, "dldo4", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO4_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(6)),
+	AXP_DESC(AXP22X, ELDO1, "eldo1", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(0)),
+	AXP_DESC(AXP22X, ELDO2, "eldo2", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)),
+	AXP_DESC(AXP22X, ELDO3, "eldo3", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)),
+	AXP_DESC_IO(AXP22X, LDO_IO0, "ldo_io0", "ips", 1800, 3300, 100,
+		    AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07,
+		    AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
+	AXP_DESC_IO(AXP22X, LDO_IO1, "ldo_io1", "ips", 1800, 3300, 100,
+		    AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07,
+		    AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
+	AXP_DESC_FIXED(AXP22X, RTC_LDO, "rtc_ldo", "ips", 3000),
+};
+
 static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 {
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
@@ -165,6 +243,12 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 		def = 1500;
 		step = 75;
 		break;
+	case AXP221_ID:
+		min = 1800;
+		max = 4050;
+		def = 3000;
+		step = 150;
+		break;
 	default:
 		dev_err(&pdev->dev,
 			"Setting DCDC frequency for unsupported AXP variant\n");
@@ -237,6 +321,14 @@ static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 work
 		workmode <<= ffs(mask) - 1;
 		break;
 
+	case AXP221_ID:
+		if (id < AXP22X_DCDC1 || id > AXP22X_DCDC5)
+			return -EINVAL;
+
+		mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP22X_DCDC1);
+		workmode <<= id - AXP22X_DCDC1;
+		break;
+
 	default:
 		/* should not happen */
 		WARN_ON(1);
@@ -265,6 +357,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 		regulators = axp20x_regulators;
 		nregulators = AXP20X_REG_ID_MAX;
 		break;
+	case AXP221_ID:
+		regulators = axp22x_regulators;
+		nregulators = AXP22X_REG_ID_MAX;
+		break;
 	default:
 		dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n",
 			axp20x->variant);
-- 
2.1.4

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

* [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

From: Boris BREZILLON <boris.brezillon@free-electrons.com>

Add AXP22X regulator definitions and variant id associations.
This introduces a new "switch" type output for one of the regulators.
It is a switchable secondary output of one regulator, with the same
voltage level as the primary output.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
[wens at csie.org: Moved variant choosing to multi family support patch]
[wens at csie.org: Add dc-dc work frequency range]
[wens at csie.org: Add "switch" type output regulator DC1SW]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/regulator/axp20x-regulator.c | 96 ++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 50ae0b5f2c0c..646829132b59 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -27,8 +27,12 @@
 #define AXP20X_IO_ENABLED		0x03
 #define AXP20X_IO_DISABLED		0x07
 
+#define AXP22X_IO_ENABLED		0x04
+#define AXP22X_IO_DISABLED		0x03
+
 #define AXP20X_WORKMODE_DCDC2_MASK	BIT(2)
 #define AXP20X_WORKMODE_DCDC3_MASK	BIT(1)
+#define AXP22X_WORKMODE_DCDCX_MASK(x)	BIT(x)
 
 #define AXP20X_FREQ_DCDC_MASK		0x0f
 
@@ -74,6 +78,26 @@
 		.ops		= &axp20x_ops,					\
 	}
 
+#define AXP_DESC_SW(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
+		    _vmask, _ereg, _emask) 					\
+	[_family##_##_id] = {							\
+		.name		= #_id,						\
+		.supply_name	= (_supply),					\
+		.of_match	= of_match_ptr(_match),				\
+		.regulators_node = of_match_ptr("regulators"),			\
+		.type		= REGULATOR_VOLTAGE,				\
+		.id		= _family##_##_id,				\
+		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
+		.owner		= THIS_MODULE,					\
+		.min_uV		= (_min) * 1000,				\
+		.uV_step	= (_step) * 1000,				\
+		.vsel_reg	= (_vreg),					\
+		.vsel_mask	= (_vmask),					\
+		.enable_reg	= (_ereg),					\
+		.enable_mask	= (_emask),					\
+		.ops		= &axp20x_ops_sw,				\
+	}
+
 #define AXP_DESC_FIXED(_family, _id, _match, _supply, _volt)			\
 	[_family##_##_id] = {							\
 		.name		= #_id,						\
@@ -135,6 +159,14 @@ static struct regulator_ops axp20x_ops = {
 	.is_enabled		= regulator_is_enabled_regmap,
 };
 
+static struct regulator_ops axp20x_ops_sw = {
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.list_voltage		= regulator_list_voltage_linear,
+	.enable			= regulator_enable_regmap,
+	.disable		= regulator_disable_regmap,
+	.is_enabled		= regulator_is_enabled_regmap,
+};
+
 static const struct regulator_desc axp20x_regulators[] = {
 	AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
 		 AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
@@ -152,6 +184,52 @@ static const struct regulator_desc axp20x_regulators[] = {
 		    AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
 };
 
+static const struct regulator_desc axp22x_regulators[] = {
+	AXP_DESC(AXP22X, DCDC1, "dcdc1", "vin1", 1600, 3400, 100,
+		 AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(1)),
+	AXP_DESC(AXP22X, DCDC2, "dcdc2", "vin2", 600, 1540, 20,
+		 AXP22X_DCDC2_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(2)),
+	AXP_DESC(AXP22X, DCDC3, "dcdc3", "vin3", 600, 1860, 20,
+		 AXP22X_DCDC3_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(3)),
+	AXP_DESC(AXP22X, DCDC4, "dcdc4", "vin4", 600, 1540, 20,
+		 AXP22X_DCDC4_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(3)),
+	AXP_DESC(AXP22X, DCDC5, "dcdc5", "vin5", 1000, 2550, 50,
+		 AXP22X_DCDC5_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(4)),
+	/* secondary switchable output of DCDC1 */
+	AXP_DESC_SW(AXP22X, DC1SW, "dc1sw", "dcdc1", 1600, 3400, 100,
+		    AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(7)),
+	/* LDO regulator internally chained to DCDC5 */
+	AXP_DESC(AXP22X, DC5LDO, "dc5ldo", "dcdc5", 700, 1400, 100,
+		 AXP22X_DC5LDO_V_OUT, 0x7, AXP22X_PWR_OUT_CTRL1, BIT(0)),
+	AXP_DESC(AXP22X, ALDO1, "aldo1", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(6)),
+	AXP_DESC(AXP22X, ALDO2, "aldo2", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(7)),
+	AXP_DESC(AXP22X, ALDO3, "aldo3", "aldoin", 700, 3300, 100,
+		 AXP22X_ALDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(7)),
+	AXP_DESC(AXP22X, DLDO1, "dldo1", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(3)),
+	AXP_DESC(AXP22X, DLDO2, "dldo2", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(4)),
+	AXP_DESC(AXP22X, DLDO3, "dldo3", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(5)),
+	AXP_DESC(AXP22X, DLDO4, "dldo4", "dldoin", 700, 3300, 100,
+		 AXP22X_DLDO4_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(6)),
+	AXP_DESC(AXP22X, ELDO1, "eldo1", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(0)),
+	AXP_DESC(AXP22X, ELDO2, "eldo2", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)),
+	AXP_DESC(AXP22X, ELDO3, "eldo3", "eldoin", 700, 3300, 100,
+		 AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)),
+	AXP_DESC_IO(AXP22X, LDO_IO0, "ldo_io0", "ips", 1800, 3300, 100,
+		    AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07,
+		    AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
+	AXP_DESC_IO(AXP22X, LDO_IO1, "ldo_io1", "ips", 1800, 3300, 100,
+		    AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07,
+		    AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
+	AXP_DESC_FIXED(AXP22X, RTC_LDO, "rtc_ldo", "ips", 3000),
+};
+
 static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 {
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
@@ -165,6 +243,12 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
 		def = 1500;
 		step = 75;
 		break;
+	case AXP221_ID:
+		min = 1800;
+		max = 4050;
+		def = 3000;
+		step = 150;
+		break;
 	default:
 		dev_err(&pdev->dev,
 			"Setting DCDC frequency for unsupported AXP variant\n");
@@ -237,6 +321,14 @@ static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 work
 		workmode <<= ffs(mask) - 1;
 		break;
 
+	case AXP221_ID:
+		if (id < AXP22X_DCDC1 || id > AXP22X_DCDC5)
+			return -EINVAL;
+
+		mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP22X_DCDC1);
+		workmode <<= id - AXP22X_DCDC1;
+		break;
+
 	default:
 		/* should not happen */
 		WARN_ON(1);
@@ -265,6 +357,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 		regulators = axp20x_regulators;
 		nregulators = AXP20X_REG_ID_MAX;
 		break;
+	case AXP221_ID:
+		regulators = axp22x_regulators;
+		nregulators = AXP22X_REG_ID_MAX;
+		break;
 	default:
 		dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n",
 			axp20x->variant);
-- 
2.1.4

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

* [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

Add the list of regulators for AXP22x to the DT bindings.
This includes the names and supply names.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 3914a3f91ff6..0fc2f1f35cef 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -49,6 +49,33 @@ LDO3		: LDO		: ldo3in-supply
 LDO4		: LDO		: ldo24in-supply	: shared supply
 LDO5		: LDO		: ldo5in-supply
 
+
+AXP221 regulators, type, and corresponding input supply names:
+
+Regulator	  Type		  Supply Name		  Notes
+---------	  ----		  -----------		  -----
+DCDC1		: DC-DC buck	: vin1-supply
+DCDC2		: DC-DC buck	: vin2-supply
+DCDC3		: DC-DC	buck	: vin3-supply
+DCDC4		: DC-DC	buck	: vin4-supply
+DCDC5		: DC-DC	buck	: vin5-supply
+DC1SW		: On/Off Switch	: dcdc1-supply		: DCDC1 secondary output
+DC5LDO		: LDO		: dcdc5-supply		: input from DCDC5
+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
+LDO_IO0		: LDO		: ips-supply		: GPIO 0
+LDO_IO1		: LDO		: ips-supply		: GPIO 1
+RTC_LDO		: LDO		: ips-supply		: always on
+
+
 Example:
 
 axp209: pmic@34 {
-- 
2.1.4


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

* [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

Add the list of regulators for AXP22x to the DT bindings.
This includes the names and supply names.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 3914a3f91ff6..0fc2f1f35cef 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -49,6 +49,33 @@ LDO3		: LDO		: ldo3in-supply
 LDO4		: LDO		: ldo24in-supply	: shared supply
 LDO5		: LDO		: ldo5in-supply
 
+
+AXP221 regulators, type, and corresponding input supply names:
+
+Regulator	  Type		  Supply Name		  Notes
+---------	  ----		  -----------		  -----
+DCDC1		: DC-DC buck	: vin1-supply
+DCDC2		: DC-DC buck	: vin2-supply
+DCDC3		: DC-DC	buck	: vin3-supply
+DCDC4		: DC-DC	buck	: vin4-supply
+DCDC5		: DC-DC	buck	: vin5-supply
+DC1SW		: On/Off Switch	: dcdc1-supply		: DCDC1 secondary output
+DC5LDO		: LDO		: dcdc5-supply		: input from DCDC5
+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
+LDO_IO0		: LDO		: ips-supply		: GPIO 0
+LDO_IO1		: LDO		: ips-supply		: GPIO 1
+RTC_LDO		: LDO		: ips-supply		: always on
+
+
 Example:
 
 axp209: pmic@34 {
-- 
2.1.4

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

* [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

Add the list of regulators for AXP22x to the DT bindings.
This includes the names and supply names.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 3914a3f91ff6..0fc2f1f35cef 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -49,6 +49,33 @@ LDO3		: LDO		: ldo3in-supply
 LDO4		: LDO		: ldo24in-supply	: shared supply
 LDO5		: LDO		: ldo5in-supply
 
+
+AXP221 regulators, type, and corresponding input supply names:
+
+Regulator	  Type		  Supply Name		  Notes
+---------	  ----		  -----------		  -----
+DCDC1		: DC-DC buck	: vin1-supply
+DCDC2		: DC-DC buck	: vin2-supply
+DCDC3		: DC-DC	buck	: vin3-supply
+DCDC4		: DC-DC	buck	: vin4-supply
+DCDC5		: DC-DC	buck	: vin5-supply
+DC1SW		: On/Off Switch	: dcdc1-supply		: DCDC1 secondary output
+DC5LDO		: LDO		: dcdc5-supply		: input from DCDC5
+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
+LDO_IO0		: LDO		: ips-supply		: GPIO 0
+LDO_IO1		: LDO		: ips-supply		: GPIO 1
+RTC_LDO		: LDO		: ips-supply		: always on
+
+
 Example:
 
 axp209: pmic at 34 {
-- 
2.1.4

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

* [PATCH v5 09/12] mfd: axp20x: Enable AXP22X regulators
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

Now that the axp20x-regulators driver supports different variants of the
AXP family, we can enable regulator support for AXP22X without the risk
of incorrectly configuring regulators.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/mfd/axp20x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 0ec27d5023df..8d2dbb7eb588 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -370,6 +370,8 @@ static struct mfd_cell axp22x_cells[] = {
 		.name			= "axp20x-pek",
 		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
 		.resources		= axp22x_pek_resources,
+	}, {
+		.name			= "axp20x-regulator",
 	},
 };
 
-- 
2.1.4


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

* [PATCH v5 09/12] mfd: axp20x: Enable AXP22X regulators
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

Now that the axp20x-regulators driver supports different variants of the
AXP family, we can enable regulator support for AXP22X without the risk
of incorrectly configuring regulators.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 drivers/mfd/axp20x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 0ec27d5023df..8d2dbb7eb588 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -370,6 +370,8 @@ static struct mfd_cell axp22x_cells[] = {
 		.name			= "axp20x-pek",
 		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
 		.resources		= axp22x_pek_resources,
+	}, {
+		.name			= "axp20x-regulator",
 	},
 };
 
-- 
2.1.4

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

* [PATCH v5 09/12] mfd: axp20x: Enable AXP22X regulators
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the axp20x-regulators driver supports different variants of the
AXP family, we can enable regulator support for AXP22X without the risk
of incorrectly configuring regulators.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/mfd/axp20x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 0ec27d5023df..8d2dbb7eb588 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -370,6 +370,8 @@ static struct mfd_cell axp22x_cells[] = {
 		.name			= "axp20x-pek",
 		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
 		.resources		= axp22x_pek_resources,
+	}, {
+		.name			= "axp20x-regulator",
 	},
 };
 
-- 
2.1.4

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

* [PATCH v5 10/12] ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

This patch adds the AXP221 regulators. Only the ones directly used
on the board are added.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 56 ++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 486ffc69ac96..d13c88c6509a 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -115,7 +115,7 @@
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
-	vmmc-supply = <&reg_vcc3v0>;
+	vmmc-supply = <&vcc_3v0>;
 	bus-width = <4>;
 	cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
 	cd-inverted;
@@ -150,6 +150,60 @@
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 		interrupt-controller;
 		#interrupt-cells = <1>;
+		dcdc1-supply = <&vcc_3v0>;
+		dcdc5-supply = <&vcc_dram>;
+
+		regulators {
+			x-powers,dcdc-freq = <3000>;
+
+			vcc_3v0: dcdc1 {
+				regulator-always-on;
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-name = "vcc-3v0";
+			};
+
+			vdd_cpu: dcdc2 {
+				regulator-always-on;
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1320000>;
+				regulator-name = "vdd-cpu";
+			};
+
+			vdd_gpu: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1320000>;
+				regulator-name = "vdd-gpu";
+			};
+
+			vdd_sys_dll: dcdc4 {
+				regulator-always-on;
+				regulator-min-microvolt = <1100000>;
+				regulator-max-microvolt = <1100000>;
+				regulator-name = "vdd-sys-dll";
+			};
+
+			vcc_dram: dcdc5 {
+				regulator-always-on;
+				regulator-min-microvolt = <1500000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-name = "vcc-dram";
+			};
+
+			vcc_wifi: aldo1 {
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc_wifi";
+			};
+
+			avcc: aldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-name = "avcc";
+			};
+		};
 	};
 };
 
-- 
2.1.4


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

* [PATCH v5 10/12] ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

This patch adds the AXP221 regulators. Only the ones directly used
on the board are added.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 56 ++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 486ffc69ac96..d13c88c6509a 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -115,7 +115,7 @@
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
-	vmmc-supply = <&reg_vcc3v0>;
+	vmmc-supply = <&vcc_3v0>;
 	bus-width = <4>;
 	cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
 	cd-inverted;
@@ -150,6 +150,60 @@
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 		interrupt-controller;
 		#interrupt-cells = <1>;
+		dcdc1-supply = <&vcc_3v0>;
+		dcdc5-supply = <&vcc_dram>;
+
+		regulators {
+			x-powers,dcdc-freq = <3000>;
+
+			vcc_3v0: dcdc1 {
+				regulator-always-on;
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-name = "vcc-3v0";
+			};
+
+			vdd_cpu: dcdc2 {
+				regulator-always-on;
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1320000>;
+				regulator-name = "vdd-cpu";
+			};
+
+			vdd_gpu: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1320000>;
+				regulator-name = "vdd-gpu";
+			};
+
+			vdd_sys_dll: dcdc4 {
+				regulator-always-on;
+				regulator-min-microvolt = <1100000>;
+				regulator-max-microvolt = <1100000>;
+				regulator-name = "vdd-sys-dll";
+			};
+
+			vcc_dram: dcdc5 {
+				regulator-always-on;
+				regulator-min-microvolt = <1500000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-name = "vcc-dram";
+			};
+
+			vcc_wifi: aldo1 {
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc_wifi";
+			};
+
+			avcc: aldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-name = "avcc";
+			};
+		};
 	};
 };
 
-- 
2.1.4

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

* [PATCH v5 10/12] ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds the AXP221 regulators. Only the ones directly used
on the board are added.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 56 ++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 486ffc69ac96..d13c88c6509a 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -115,7 +115,7 @@
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
-	vmmc-supply = <&reg_vcc3v0>;
+	vmmc-supply = <&vcc_3v0>;
 	bus-width = <4>;
 	cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
 	cd-inverted;
@@ -150,6 +150,60 @@
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 		interrupt-controller;
 		#interrupt-cells = <1>;
+		dcdc1-supply = <&vcc_3v0>;
+		dcdc5-supply = <&vcc_dram>;
+
+		regulators {
+			x-powers,dcdc-freq = <3000>;
+
+			vcc_3v0: dcdc1 {
+				regulator-always-on;
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-name = "vcc-3v0";
+			};
+
+			vdd_cpu: dcdc2 {
+				regulator-always-on;
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1320000>;
+				regulator-name = "vdd-cpu";
+			};
+
+			vdd_gpu: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1320000>;
+				regulator-name = "vdd-gpu";
+			};
+
+			vdd_sys_dll: dcdc4 {
+				regulator-always-on;
+				regulator-min-microvolt = <1100000>;
+				regulator-max-microvolt = <1100000>;
+				regulator-name = "vdd-sys-dll";
+			};
+
+			vcc_dram: dcdc5 {
+				regulator-always-on;
+				regulator-min-microvolt = <1500000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-name = "vcc-dram";
+			};
+
+			vcc_wifi: aldo1 {
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc_wifi";
+			};
+
+			avcc: aldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-name = "avcc";
+			};
+		};
 	};
 };
 
-- 
2.1.4

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

* [PATCH v5 11/12] ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

mmc1 is used to connect to the WiFi chip on the Hummingbird A31.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 92abea20b946..39d87a901b46 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -581,6 +581,14 @@
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
+			mmc1_pins_a: mmc1@0 {
+				allwinner,pins = "PG0", "PG1", "PG2", "PG3",
+						 "PG4", "PG5";
+				allwinner,function = "mmc1";
+				allwinner,drive = <2>;
+				allwinner,pull = <0>;
+			};
+
 			gmac_pins_mii_a: gmac_mii@0 {
 				allwinner,pins = "PA0", "PA1", "PA2", "PA3",
 						"PA8", "PA9", "PA11",
-- 
2.1.4


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

* [PATCH v5 11/12] ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

mmc1 is used to connect to the WiFi chip on the Hummingbird A31.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 92abea20b946..39d87a901b46 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -581,6 +581,14 @@
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
+			mmc1_pins_a: mmc1@0 {
+				allwinner,pins = "PG0", "PG1", "PG2", "PG3",
+						 "PG4", "PG5";
+				allwinner,function = "mmc1";
+				allwinner,drive = <2>;
+				allwinner,pull = <0>;
+			};
+
 			gmac_pins_mii_a: gmac_mii@0 {
 				allwinner,pins = "PA0", "PA1", "PA2", "PA3",
 						"PA8", "PA9", "PA11",
-- 
2.1.4

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

* [PATCH v5 11/12] ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

mmc1 is used to connect to the WiFi chip on the Hummingbird A31.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 92abea20b946..39d87a901b46 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -581,6 +581,14 @@
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
+			mmc1_pins_a: mmc1 at 0 {
+				allwinner,pins = "PG0", "PG1", "PG2", "PG3",
+						 "PG4", "PG5";
+				allwinner,function = "mmc1";
+				allwinner,drive = <2>;
+				allwinner,pull = <0>;
+			};
+
 			gmac_pins_mii_a: gmac_mii at 0 {
 				allwinner,pins = "PA0", "PA1", "PA2", "PA3",
 						"PA8", "PA9", "PA11",
-- 
2.1.4

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Add basic support for the WiFi module
  2015-03-10 11:59 ` Chen-Yu Tsai
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  -1 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel

The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
The IC also takes a power enable signal via GPIO.

The WiFi module supports out-of-band interrupt signaling via GPIO,
but this is not supported in this patch.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index d13c88c6509a..25a3ef49bb71 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -61,6 +61,11 @@
 	chosen {
 		bootargs = "earlyprintk console=ttyS0,115200";
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 */
+	};
 };
 
 &ehci0 {
@@ -127,6 +132,16 @@
 	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
+	vmmc-supply = <&vcc_wifi>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
@@ -138,6 +153,13 @@
 		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 	};
+
+	wifi_reset_pin_hummingbird: wifi_reset_pin@0 {
+		allwinner,pins = "PG10";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
 };
 
 &p2wi {
-- 
2.1.4


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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Add basic support for the WiFi module
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
The IC also takes a power enable signal via GPIO.

The WiFi module supports out-of-band interrupt signaling via GPIO,
but this is not supported in this patch.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index d13c88c6509a..25a3ef49bb71 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -61,6 +61,11 @@
 	chosen {
 		bootargs = "earlyprintk console=ttyS0,115200";
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 */
+	};
 };
 
 &ehci0 {
@@ -127,6 +132,16 @@
 	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
+	vmmc-supply = <&vcc_wifi>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
@@ -138,6 +153,13 @@
 		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 	};
+
+	wifi_reset_pin_hummingbird: wifi_reset_pin at 0 {
+		allwinner,pins = "PG10";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
 };
 
 &p2wi {
-- 
2.1.4

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
The IC also takes a power enable signal via GPIO. This is supported
with the new power sequencing bindings.

The WiFi module supports out-of-band interrupt signaling via GPIO,
but this is buggy and not enabled yet.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index d13c88c6509a..25a3ef49bb71 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -61,6 +61,11 @@
 	chosen {
 		bootargs = "earlyprintk console=ttyS0,115200";
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 */
+	};
 };
 
 &ehci0 {
@@ -127,6 +132,16 @@
 	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
+	vmmc-supply = <&vcc_wifi>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
@@ -138,6 +153,13 @@
 		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 	};
+
+	wifi_reset_pin_hummingbird: wifi_reset_pin@0 {
+		allwinner,pins = "PG10";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
 };
 
 &p2wi {
-- 
2.1.4


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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
The IC also takes a power enable signal via GPIO. This is supported
with the new power sequencing bindings.

The WiFi module supports out-of-band interrupt signaling via GPIO,
but this is buggy and not enabled yet.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index d13c88c6509a..25a3ef49bb71 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -61,6 +61,11 @@
 	chosen {
 		bootargs = "earlyprintk console=ttyS0,115200";
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 */
+	};
 };
 
 &ehci0 {
@@ -127,6 +132,16 @@
 	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
+	vmmc-supply = <&vcc_wifi>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
@@ -138,6 +153,13 @@
 		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 	};
+
+	wifi_reset_pin_hummingbird: wifi_reset_pin@0 {
+		allwinner,pins = "PG10";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
 };
 
 &p2wi {
-- 
2.1.4

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-10 11:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-10 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
The IC also takes a power enable signal via GPIO. This is supported
with the new power sequencing bindings.

The WiFi module supports out-of-band interrupt signaling via GPIO,
but this is buggy and not enabled yet.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index d13c88c6509a..25a3ef49bb71 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -61,6 +61,11 @@
 	chosen {
 		bootargs = "earlyprintk console=ttyS0,115200";
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 */
+	};
 };
 
 &ehci0 {
@@ -127,6 +132,16 @@
 	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
+	vmmc-supply = <&vcc_wifi>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
@@ -138,6 +153,13 @@
 		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 	};
+
+	wifi_reset_pin_hummingbird: wifi_reset_pin at 0 {
+		allwinner,pins = "PG10";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
 };
 
 &p2wi {
-- 
2.1.4

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

* Re: [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families
  2015-03-10 11:59   ` Chen-Yu Tsai
@ 2015-03-10 20:04     ` Mark Brown
  -1 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:04 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Lee Jones, Samuel Ortiz, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:17PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Rework the AXP20X_ macros and probe function to support the several chip
> families, so that each family can define it's own set of regulators.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families
@ 2015-03-10 20:04     ` Mark Brown
  0 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:17PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Rework the AXP20X_ macros and probe function to support the several chip
> families, so that each family can define it's own set of regulators.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/804c2b03/attachment.sig>

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

* Re: [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators
  2015-03-10 11:59   ` Chen-Yu Tsai
@ 2015-03-10 20:04     ` Mark Brown
  -1 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:04 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Lee Jones, Samuel Ortiz, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:18PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Add AXP22X regulator definitions and variant id associations.
> This introduces a new "switch" type output for one of the regulators.
> It is a switchable secondary output of one regulator, with the same
> voltage level as the primary output.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators
@ 2015-03-10 20:04     ` Mark Brown
  0 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:18PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Add AXP22X regulator definitions and variant id associations.
> This introduces a new "switch" type output for one of the regulators.
> It is a switchable secondary output of one regulator, with the same
> voltage level as the primary output.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/beff3bf1/attachment.sig>

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

* Re: [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators
@ 2015-03-10 20:05     ` Mark Brown
  0 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:05 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Lee Jones, Samuel Ortiz, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:18PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Add AXP22X regulator definitions and variant id associations.
> This introduces a new "switch" type output for one of the regulators.
> It is a switchable secondary output of one regulator, with the same
> voltage level as the primary output.

Wait, no - sorry.  I'd missed the defines being added earlier on.
Instead:

Reviewed-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators
@ 2015-03-10 20:05     ` Mark Brown
  0 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:05 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Lee Jones, Samuel Ortiz, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

On Tue, Mar 10, 2015 at 07:59:18PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> 
> Add AXP22X regulator definitions and variant id associations.
> This introduces a new "switch" type output for one of the regulators.
> It is a switchable secondary output of one regulator, with the same
> voltage level as the primary output.

Wait, no - sorry.  I'd missed the defines being added earlier on.
Instead:

Reviewed-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators
@ 2015-03-10 20:05     ` Mark Brown
  0 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:18PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Add AXP22X regulator definitions and variant id associations.
> This introduces a new "switch" type output for one of the regulators.
> It is a switchable secondary output of one regulator, with the same
> voltage level as the primary output.

Wait, no - sorry.  I'd missed the defines being added earlier on.
Instead:

Reviewed-by: Mark Brown <broonie@kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/8e72c973/attachment-0001.sig>

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

* Re: [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families
@ 2015-03-10 20:05     ` Mark Brown
  0 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:05 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Lee Jones, Samuel Ortiz, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:17PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Rework the AXP20X_ macros and probe function to support the several chip
> families, so that each family can define it's own set of regulators.

Wait, no - sorry.  I'd missed the defines being added earlier on.
Instead:

Reviewed-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families
@ 2015-03-10 20:05     ` Mark Brown
  0 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:05 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Lee Jones, Samuel Ortiz, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

On Tue, Mar 10, 2015 at 07:59:17PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> 
> Rework the AXP20X_ macros and probe function to support the several chip
> families, so that each family can define it's own set of regulators.

Wait, no - sorry.  I'd missed the defines being added earlier on.
Instead:

Reviewed-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families
@ 2015-03-10 20:05     ` Mark Brown
  0 siblings, 0 replies; 102+ messages in thread
From: Mark Brown @ 2015-03-10 20:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:17PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Rework the AXP20X_ macros and probe function to support the several chip
> families, so that each family can define it's own set of regulators.

Wait, no - sorry.  I'd missed the defines being added earlier on.
Instead:

Reviewed-by: Mark Brown <broonie@kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/fc128817/attachment-0001.sig>

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

* Re: [PATCH v5 01/12] ARM: dts: sun6i: add p2wi controller node to dtsi
@ 2015-03-10 21:27     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:27 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:12PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> The p2wi controller has only one possible pinmux setting. Use it by
> default in the dtsi, instead of having to set it in each board's dts.
> 
> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
> [wens@csie.org: reformat commit title; rename p2wi pins and use as default]
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!

Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 01/12] ARM: dts: sun6i: add p2wi controller node to dtsi
@ 2015-03-10 21:27     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:27 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

On Tue, Mar 10, 2015 at 07:59:12PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> 
> The p2wi controller has only one possible pinmux setting. Use it by
> default in the dtsi, instead of having to set it in each board's dts.
> 
> Signed-off-by: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> [wens-jdAy2FN1RRM@public.gmane.org: reformat commit title; rename p2wi pins and use as default]
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>

Applied, thanks!

Maxime

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

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

* [PATCH v5 01/12] ARM: dts: sun6i: add p2wi controller node to dtsi
@ 2015-03-10 21:27     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:12PM +0800, Chen-Yu Tsai wrote:
> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> The p2wi controller has only one possible pinmux setting. Use it by
> default in the dtsi, instead of having to set it in each board's dts.
> 
> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
> [wens at csie.org: reformat commit title; rename p2wi pins and use as default]
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/c527473a/attachment.sig>

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

* Re: [PATCH v5 02/12] ARM: dts: sun6i: hummingbird: Enable P2WI controller
@ 2015-03-10 21:27     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:27 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:13PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AXP221 PMIC hooked up to the P2WI controller.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!

Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 02/12] ARM: dts: sun6i: hummingbird: Enable P2WI controller
@ 2015-03-10 21:27     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:27 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

On Tue, Mar 10, 2015 at 07:59:13PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AXP221 PMIC hooked up to the P2WI controller.
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>

Applied, thanks!

Maxime

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

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

* [PATCH v5 02/12] ARM: dts: sun6i: hummingbird: Enable P2WI controller
@ 2015-03-10 21:27     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:13PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AXP221 PMIC hooked up to the P2WI controller.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/8cfb464d/attachment.sig>

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

* Re: [PATCH v5 05/12] ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
@ 2015-03-10 21:28     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:28 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:16PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AXP221 PMIC hooked up to the
> P2WI controller.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 05/12] ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
@ 2015-03-10 21:28     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:28 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

On Tue, Mar 10, 2015 at 07:59:16PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AXP221 PMIC hooked up to the
> P2WI controller.
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>

Applied, thanks!
Maxime

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

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

* [PATCH v5 05/12] ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node
@ 2015-03-10 21:28     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:16PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AXP221 PMIC hooked up to the
> P2WI controller.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/e032cd45/attachment.sig>

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

* Re: [PATCH v5 10/12] ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
@ 2015-03-10 21:30     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:30 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:21PM +0800, Chen-Yu Tsai wrote:
> This patch adds the AXP221 regulators. Only the ones directly used
> on the board are added.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 10/12] ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
@ 2015-03-10 21:30     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:30 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

On Tue, Mar 10, 2015 at 07:59:21PM +0800, Chen-Yu Tsai wrote:
> This patch adds the AXP221 regulators. Only the ones directly used
> on the board are added.
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>

Applied, thanks!
Maxime

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

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

* [PATCH v5 10/12] ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes
@ 2015-03-10 21:30     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:21PM +0800, Chen-Yu Tsai wrote:
> This patch adds the AXP221 regulators. Only the ones directly used
> on the board are added.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/42afc470/attachment.sig>

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

* Re: [PATCH v5 11/12] ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
@ 2015-03-10 21:31     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:31 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:22PM +0800, Chen-Yu Tsai wrote:
> mmc1 is used to connect to the WiFi chip on the Hummingbird A31.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  arch/arm/boot/dts/sun6i-a31.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
> index 92abea20b946..39d87a901b46 100644
> --- a/arch/arm/boot/dts/sun6i-a31.dtsi
> +++ b/arch/arm/boot/dts/sun6i-a31.dtsi
> @@ -581,6 +581,14 @@
>  				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>  			};
>  
> +			mmc1_pins_a: mmc1@0 {
> +				allwinner,pins = "PG0", "PG1", "PG2", "PG3",
> +						 "PG4", "PG5";
> +				allwinner,function = "mmc1";
> +				allwinner,drive = <2>;
> +				allwinner,pull = <0>;

You should use the defines here.

Thanks!
Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 11/12] ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
@ 2015-03-10 21:31     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:31 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

On Tue, Mar 10, 2015 at 07:59:22PM +0800, Chen-Yu Tsai wrote:
> mmc1 is used to connect to the WiFi chip on the Hummingbird A31.
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
> ---
>  arch/arm/boot/dts/sun6i-a31.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
> index 92abea20b946..39d87a901b46 100644
> --- a/arch/arm/boot/dts/sun6i-a31.dtsi
> +++ b/arch/arm/boot/dts/sun6i-a31.dtsi
> @@ -581,6 +581,14 @@
>  				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>  			};
>  
> +			mmc1_pins_a: mmc1@0 {
> +				allwinner,pins = "PG0", "PG1", "PG2", "PG3",
> +						 "PG4", "PG5";
> +				allwinner,function = "mmc1";
> +				allwinner,drive = <2>;
> +				allwinner,pull = <0>;

You should use the defines here.

Thanks!
Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [PATCH v5 11/12] ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi
@ 2015-03-10 21:31     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:22PM +0800, Chen-Yu Tsai wrote:
> mmc1 is used to connect to the WiFi chip on the Hummingbird A31.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  arch/arm/boot/dts/sun6i-a31.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
> index 92abea20b946..39d87a901b46 100644
> --- a/arch/arm/boot/dts/sun6i-a31.dtsi
> +++ b/arch/arm/boot/dts/sun6i-a31.dtsi
> @@ -581,6 +581,14 @@
>  				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>  			};
>  
> +			mmc1_pins_a: mmc1 at 0 {
> +				allwinner,pins = "PG0", "PG1", "PG2", "PG3",
> +						 "PG4", "PG5";
> +				allwinner,function = "mmc1";
> +				allwinner,drive = <2>;
> +				allwinner,pull = <0>;

You should use the defines here.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/6843b583/attachment.sig>

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-10 21:32     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:32 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

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

On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> The IC also takes a power enable signal via GPIO. This is supported
> with the new power sequencing bindings.
> 
> The WiFi module supports out-of-band interrupt signaling via GPIO,
> but this is buggy and not enabled yet.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

There's two almost identical patches 12/12. Which one am I suppose to
apply?

Thanks!
Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-10 21:32     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:32 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> The IC also takes a power enable signal via GPIO. This is supported
> with the new power sequencing bindings.
> 
> The WiFi module supports out-of-band interrupt signaling via GPIO,
> but this is buggy and not enabled yet.
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>

There's two almost identical patches 12/12. Which one am I suppose to
apply?

Thanks!
Maxime

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

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-10 21:32     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-10 21:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> The IC also takes a power enable signal via GPIO. This is supported
> with the new power sequencing bindings.
> 
> The WiFi module supports out-of-band interrupt signaling via GPIO,
> but this is buggy and not enabled yet.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

There's two almost identical patches 12/12. Which one am I suppose to
apply?

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/8a6b6bbf/attachment.sig>

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
  2015-03-10 21:32     ` Maxime Ripard
@ 2015-03-11  3:11       ` Chen-Yu Tsai
  -1 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-11  3:11 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
>> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
>> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
>> The IC also takes a power enable signal via GPIO. This is supported
>> with the new power sequencing bindings.
>>
>> The WiFi module supports out-of-band interrupt signaling via GPIO,
>> but this is buggy and not enabled yet.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>
> There's two almost identical patches 12/12. Which one am I suppose to
> apply?

This one is the right one. I forgot to clear the patches after changing
the description. The "buggy" part in the description is probably not
needed. Hans explained that the SD resets have nothing to do with
interrupt handling.


ChenYu

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-11  3:11       ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-11  3:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
>> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
>> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
>> The IC also takes a power enable signal via GPIO. This is supported
>> with the new power sequencing bindings.
>>
>> The WiFi module supports out-of-band interrupt signaling via GPIO,
>> but this is buggy and not enabled yet.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>
> There's two almost identical patches 12/12. Which one am I suppose to
> apply?

This one is the right one. I forgot to clear the patches after changing
the description. The "buggy" part in the description is probably not
needed. Hans explained that the SD resets have nothing to do with
interrupt handling.


ChenYu

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-11  8:52         ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-11  8:52 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

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

On Wed, Mar 11, 2015 at 11:11:49AM +0800, Chen-Yu Tsai wrote:
> On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
> >> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> >> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> >> The IC also takes a power enable signal via GPIO. This is supported
> >> with the new power sequencing bindings.
> >>
> >> The WiFi module supports out-of-band interrupt signaling via GPIO,
> >> but this is buggy and not enabled yet.
> >>
> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> >
> > There's two almost identical patches 12/12. Which one am I suppose to
> > apply?
> 
> This one is the right one. I forgot to clear the patches after changing
> the description. The "buggy" part in the description is probably not
> needed. Hans explained that the SD resets have nothing to do with
> interrupt handling.

Just to be clear, you want the last sentence to be:

The WiFi module supports out-of-band interrupt signaling via GPIO, but
this is not enabled yet.

Right?

Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-11  8:52         ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-11  8:52 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

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

On Wed, Mar 11, 2015 at 11:11:49AM +0800, Chen-Yu Tsai wrote:
> On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
> <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
> > On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
> >> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> >> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> >> The IC also takes a power enable signal via GPIO. This is supported
> >> with the new power sequencing bindings.
> >>
> >> The WiFi module supports out-of-band interrupt signaling via GPIO,
> >> but this is buggy and not enabled yet.
> >>
> >> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
> >
> > There's two almost identical patches 12/12. Which one am I suppose to
> > apply?
> 
> This one is the right one. I forgot to clear the patches after changing
> the description. The "buggy" part in the description is probably not
> needed. Hans explained that the SD resets have nothing to do with
> interrupt handling.

Just to be clear, you want the last sentence to be:

The WiFi module supports out-of-band interrupt signaling via GPIO, but
this is not enabled yet.

Right?

Maxime

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

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-11  8:52         ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-11  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 11, 2015 at 11:11:49AM +0800, Chen-Yu Tsai wrote:
> On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
> >> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> >> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> >> The IC also takes a power enable signal via GPIO. This is supported
> >> with the new power sequencing bindings.
> >>
> >> The WiFi module supports out-of-band interrupt signaling via GPIO,
> >> but this is buggy and not enabled yet.
> >>
> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> >
> > There's two almost identical patches 12/12. Which one am I suppose to
> > apply?
> 
> This one is the right one. I forgot to clear the patches after changing
> the description. The "buggy" part in the description is probably not
> needed. Hans explained that the SD resets have nothing to do with
> interrupt handling.

Just to be clear, you want the last sentence to be:

The WiFi module supports out-of-band interrupt signaling via GPIO, but
this is not enabled yet.

Right?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150311/9748c958/attachment.sig>

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
  2015-03-11  8:52         ` Maxime Ripard
  (?)
@ 2015-03-11  9:08           ` Chen-Yu Tsai
  -1 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-11  9:08 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

On Wed, Mar 11, 2015 at 4:52 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Wed, Mar 11, 2015 at 11:11:49AM +0800, Chen-Yu Tsai wrote:
>> On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
>> >> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
>> >> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
>> >> The IC also takes a power enable signal via GPIO. This is supported
>> >> with the new power sequencing bindings.
>> >>
>> >> The WiFi module supports out-of-band interrupt signaling via GPIO,
>> >> but this is buggy and not enabled yet.
>> >>
>> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> >
>> > There's two almost identical patches 12/12. Which one am I suppose to
>> > apply?
>>
>> This one is the right one. I forgot to clear the patches after changing
>> the description. The "buggy" part in the description is probably not
>> needed. Hans explained that the SD resets have nothing to do with
>> interrupt handling.
>
> Just to be clear, you want the last sentence to be:
>
> The WiFi module supports out-of-band interrupt signaling via GPIO, but
> this is not enabled yet.
>
> Right?

That's right. Thanks.

ChenYu

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-11  9:08           ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-11  9:08 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

On Wed, Mar 11, 2015 at 4:52 PM, Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
> On Wed, Mar 11, 2015 at 11:11:49AM +0800, Chen-Yu Tsai wrote:
>> On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
>> <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>> > On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
>> >> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
>> >> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
>> >> The IC also takes a power enable signal via GPIO. This is supported
>> >> with the new power sequencing bindings.
>> >>
>> >> The WiFi module supports out-of-band interrupt signaling via GPIO,
>> >> but this is buggy and not enabled yet.
>> >>
>> >> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
>> >
>> > There's two almost identical patches 12/12. Which one am I suppose to
>> > apply?
>>
>> This one is the right one. I forgot to clear the patches after changing
>> the description. The "buggy" part in the description is probably not
>> needed. Hans explained that the SD resets have nothing to do with
>> interrupt handling.
>
> Just to be clear, you want the last sentence to be:
>
> The WiFi module supports out-of-band interrupt signaling via GPIO, but
> this is not enabled yet.
>
> Right?

That's right. Thanks.

ChenYu

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-11  9:08           ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-11  9:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 11, 2015 at 4:52 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Wed, Mar 11, 2015 at 11:11:49AM +0800, Chen-Yu Tsai wrote:
>> On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
>> >> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
>> >> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
>> >> The IC also takes a power enable signal via GPIO. This is supported
>> >> with the new power sequencing bindings.
>> >>
>> >> The WiFi module supports out-of-band interrupt signaling via GPIO,
>> >> but this is buggy and not enabled yet.
>> >>
>> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> >
>> > There's two almost identical patches 12/12. Which one am I suppose to
>> > apply?
>>
>> This one is the right one. I forgot to clear the patches after changing
>> the description. The "buggy" part in the description is probably not
>> needed. Hans explained that the SD resets have nothing to do with
>> interrupt handling.
>
> Just to be clear, you want the last sentence to be:
>
> The WiFi module supports out-of-band interrupt signaling via GPIO, but
> this is not enabled yet.
>
> Right?

That's right. Thanks.

ChenYu

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
  2015-03-11  9:08           ` Chen-Yu Tsai
@ 2015-03-11 14:28             ` Maxime Ripard
  -1 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-11 14:28 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

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

On Wed, Mar 11, 2015 at 05:08:08PM +0800, Chen-Yu Tsai wrote:
> On Wed, Mar 11, 2015 at 4:52 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Wed, Mar 11, 2015 at 11:11:49AM +0800, Chen-Yu Tsai wrote:
> >> On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
> >> <maxime.ripard@free-electrons.com> wrote:
> >> > On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
> >> >> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> >> >> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> >> >> The IC also takes a power enable signal via GPIO. This is supported
> >> >> with the new power sequencing bindings.
> >> >>
> >> >> The WiFi module supports out-of-band interrupt signaling via GPIO,
> >> >> but this is buggy and not enabled yet.
> >> >>
> >> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> >> >
> >> > There's two almost identical patches 12/12. Which one am I suppose to
> >> > apply?
> >>
> >> This one is the right one. I forgot to clear the patches after changing
> >> the description. The "buggy" part in the description is probably not
> >> needed. Hans explained that the SD resets have nothing to do with
> >> interrupt handling.
> >
> > Just to be clear, you want the last sentence to be:
> >
> > The WiFi module supports out-of-band interrupt signaling via GPIO, but
> > this is not enabled yet.
> >
> > Right?
> 
> That's right. Thanks.

Ack. I just applied it without the buggy mention.

Thanks!
Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard WiFi module
@ 2015-03-11 14:28             ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-11 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 11, 2015 at 05:08:08PM +0800, Chen-Yu Tsai wrote:
> On Wed, Mar 11, 2015 at 4:52 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Wed, Mar 11, 2015 at 11:11:49AM +0800, Chen-Yu Tsai wrote:
> >> On Wed, Mar 11, 2015 at 5:32 AM, Maxime Ripard
> >> <maxime.ripard@free-electrons.com> wrote:
> >> > On Tue, Mar 10, 2015 at 07:59:24PM +0800, Chen-Yu Tsai wrote:
> >> >> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> >> >> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> >> >> The IC also takes a power enable signal via GPIO. This is supported
> >> >> with the new power sequencing bindings.
> >> >>
> >> >> The WiFi module supports out-of-band interrupt signaling via GPIO,
> >> >> but this is buggy and not enabled yet.
> >> >>
> >> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> >> >
> >> > There's two almost identical patches 12/12. Which one am I suppose to
> >> > apply?
> >>
> >> This one is the right one. I forgot to clear the patches after changing
> >> the description. The "buggy" part in the description is probably not
> >> needed. Hans explained that the SD resets have nothing to do with
> >> interrupt handling.
> >
> > Just to be clear, you want the last sentence to be:
> >
> > The WiFi module supports out-of-band interrupt signaling via GPIO, but
> > this is not enabled yet.
> >
> > Right?
> 
> That's right. Thanks.

Ack. I just applied it without the buggy mention.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150311/1589067d/attachment.sig>

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

* Re: [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
@ 2015-03-23 11:52     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:52 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON, linux-arm-kernel, devicetree, linux-kernel,
	linux-sunxi

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Add support for the AXP22x PMIC devices to the existing AXP20x driver.
> This includes the AXP221 and AXP223, which are identical except for
> the external data bus. Only AXP221 is added for now. AXP223 will be
> added after it's Reduced Serial Bus (RSB) interface is supported.
> 
> AXP22x defines a new set of registers, power supplies and regulators,
> but most of the API is similar to the AXP20x ones.
> 
> A new irq chip definition is used, even though the available interrupts
> on AXP22x is a subset of those on AXP20x. This is done so the interrupt
> numbers match those on the datasheet.
> 
> This patch only enables the interrupts, system power-off function, and PEK
> sub-device. The regulator driver must first support different variants
> before we enable it from the mfd driver.
> 
> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
> [wens@csie.org: fix interrupts and move regulators to separate patch]
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 184 insertions(+)

For my own reference:

Acked-by: Lee Jones <lee.jones@linaro.org>

How do you wish for these patches to be managed?  Are they okay to be
sucked up individually, or do you wish for them to go through together
through a single tree?  If the latter, when which tree?

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index b1b580a88654..0ec27d5023df 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -32,6 +32,7 @@
>  static const char const *axp20x_model_names[] = {
>  	"AXP202",
>  	"AXP209",
> +	"AXP221",
>  	"AXP288",
>  };
>  
> @@ -54,6 +55,25 @@ static const struct regmap_access_table axp20x_volatile_table = {
>  	.n_yes_ranges	= ARRAY_SIZE(axp20x_volatile_ranges),
>  };
>  
> +static const struct regmap_range axp22x_writeable_ranges[] = {
> +	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
> +	regmap_reg_range(AXP20X_DCDC_MODE, AXP22X_BATLOW_THRES1),
> +};
> +
> +static const struct regmap_range axp22x_volatile_ranges[] = {
> +	regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE),
> +};
> +
> +static const struct regmap_access_table axp22x_writeable_table = {
> +	.yes_ranges	= axp22x_writeable_ranges,
> +	.n_yes_ranges	= ARRAY_SIZE(axp22x_writeable_ranges),
> +};
> +
> +static const struct regmap_access_table axp22x_volatile_table = {
> +	.yes_ranges	= axp22x_volatile_ranges,
> +	.n_yes_ranges	= ARRAY_SIZE(axp22x_volatile_ranges),
> +};
> +
>  static const struct regmap_range axp288_writeable_ranges[] = {
>  	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ6_STATE),
>  	regmap_reg_range(AXP20X_DCDC_MODE, AXP288_FG_TUNE5),
> @@ -87,6 +107,20 @@ static struct resource axp20x_pek_resources[] = {
>  	},
>  };
>  
> +static struct resource axp22x_pek_resources[] = {
> +	{
> +		.name   = "PEK_DBR",
> +		.start  = AXP22X_IRQ_PEK_RIS_EDGE,
> +		.end    = AXP22X_IRQ_PEK_RIS_EDGE,
> +		.flags  = IORESOURCE_IRQ,
> +	}, {
> +		.name   = "PEK_DBF",
> +		.start  = AXP22X_IRQ_PEK_FAL_EDGE,
> +		.end    = AXP22X_IRQ_PEK_FAL_EDGE,
> +		.flags  = IORESOURCE_IRQ,
> +	},
> +};
> +
>  static struct resource axp288_battery_resources[] = {
>  	{
>  		.start = AXP288_IRQ_QWBTU,
> @@ -129,6 +163,15 @@ static const struct regmap_config axp20x_regmap_config = {
>  	.cache_type	= REGCACHE_RBTREE,
>  };
>  
> +static const struct regmap_config axp22x_regmap_config = {
> +	.reg_bits	= 8,
> +	.val_bits	= 8,
> +	.wr_table	= &axp22x_writeable_table,
> +	.volatile_table	= &axp22x_volatile_table,
> +	.max_register	= AXP22X_BATLOW_THRES1,
> +	.cache_type	= REGCACHE_RBTREE,
> +};
> +
>  static const struct regmap_config axp288_regmap_config = {
>  	.reg_bits	= 8,
>  	.val_bits	= 8,
> @@ -181,6 +224,34 @@ static const struct regmap_irq axp20x_regmap_irqs[] = {
>  	INIT_REGMAP_IRQ(AXP20X, GPIO0_INPUT,		4, 0),
>  };
>  
> +static const struct regmap_irq axp22x_regmap_irqs[] = {
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_OVER_V,		0, 7),
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_PLUGIN,		0, 6),
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_REMOVAL,	        0, 5),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_OVER_V,		0, 4),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_PLUGIN,		0, 3),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_REMOVAL,	        0, 2),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_V_LOW,		0, 1),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_PLUGIN,		1, 7),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_REMOVAL,	        1, 6),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_ENT_ACT_MODE,	1, 5),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_EXIT_ACT_MODE,	1, 4),
> +	INIT_REGMAP_IRQ(AXP22X, CHARG,		        1, 3),
> +	INIT_REGMAP_IRQ(AXP22X, CHARG_DONE,		1, 2),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_HIGH,	        1, 1),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_LOW,	        1, 0),
> +	INIT_REGMAP_IRQ(AXP22X, DIE_TEMP_HIGH,	        2, 7),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_SHORT,		2, 1),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_LONG,		2, 0),
> +	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL1,	        3, 1),
> +	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL2,	        3, 0),
> +	INIT_REGMAP_IRQ(AXP22X, TIMER,		        4, 7),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_RIS_EDGE,	        4, 6),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_FAL_EDGE,	        4, 5),
> +	INIT_REGMAP_IRQ(AXP22X, GPIO1_INPUT,		4, 1),
> +	INIT_REGMAP_IRQ(AXP22X, GPIO0_INPUT,		4, 0),
> +};
> +
>  /* some IRQs are compatible with axp20x models */
>  static const struct regmap_irq axp288_regmap_irqs[] = {
>  	INIT_REGMAP_IRQ(AXP288, VBUS_FALL,              0, 2),
> @@ -224,6 +295,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
>  static const struct of_device_id axp20x_of_match[] = {
>  	{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
>  	{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
> +	{ .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, axp20x_of_match);
> @@ -258,6 +330,18 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
>  
>  };
>  
> +static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
> +	.name			= "axp22x_irq_chip",
> +	.status_base		= AXP20X_IRQ1_STATE,
> +	.ack_base		= AXP20X_IRQ1_STATE,
> +	.mask_base		= AXP20X_IRQ1_EN,
> +	.mask_invert		= true,
> +	.init_ack_masked	= true,
> +	.irqs			= axp22x_regmap_irqs,
> +	.num_irqs		= ARRAY_SIZE(axp22x_regmap_irqs),
> +	.num_regs		= 5,
> +};
> +
>  static const struct regmap_irq_chip axp288_regmap_irq_chip = {
>  	.name			= "axp288_irq_chip",
>  	.status_base		= AXP20X_IRQ1_STATE,
> @@ -281,6 +365,14 @@ static struct mfd_cell axp20x_cells[] = {
>  	},
>  };
>  
> +static struct mfd_cell axp22x_cells[] = {
> +	{
> +		.name			= "axp20x-pek",
> +		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
> +		.resources		= axp22x_pek_resources,
> +	},
> +};
> +
>  static struct resource axp288_adc_resources[] = {
>  	{
>  		.name  = "GPADC",
> @@ -398,6 +490,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
>  		axp20x->regmap_cfg = &axp20x_regmap_config;
>  		axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
>  		break;
> +	case AXP221_ID:
> +		axp20x->nr_cells = ARRAY_SIZE(axp22x_cells);
> +		axp20x->cells = axp22x_cells;
> +		axp20x->regmap_cfg = &axp22x_regmap_config;
> +		axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
> +		break;
>  	case AXP288_ID:
>  		axp20x->cells = axp288_cells;
>  		axp20x->nr_cells = ARRAY_SIZE(axp288_cells);
> diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
> index dfabd6db7ddf..95568eb798c3 100644
> --- a/include/linux/mfd/axp20x.h
> +++ b/include/linux/mfd/axp20x.h
> @@ -14,6 +14,7 @@
>  enum {
>  	AXP202_ID = 0,
>  	AXP209_ID,
> +	AXP221_ID,
>  	AXP288_ID,
>  	NR_AXP20X_VARIANTS,
>  };
> @@ -45,6 +46,28 @@ enum {
>  #define AXP20X_V_LTF_DISCHRG		0x3c
>  #define AXP20X_V_HTF_DISCHRG		0x3d
>  
> +#define AXP22X_PWR_OUT_CTRL1		0x10
> +#define AXP22X_PWR_OUT_CTRL2		0x12
> +#define AXP22X_PWR_OUT_CTRL3		0x13
> +#define AXP22X_DLDO1_V_OUT		0x15
> +#define AXP22X_DLDO2_V_OUT		0x16
> +#define AXP22X_DLDO3_V_OUT		0x17
> +#define AXP22X_DLDO4_V_OUT		0x18
> +#define AXP22X_ELDO1_V_OUT		0x19
> +#define AXP22X_ELDO2_V_OUT		0x1a
> +#define AXP22X_ELDO3_V_OUT		0x1b
> +#define AXP22X_DC5LDO_V_OUT		0x1c
> +#define AXP22X_DCDC1_V_OUT		0x21
> +#define AXP22X_DCDC2_V_OUT		0x22
> +#define AXP22X_DCDC3_V_OUT		0x23
> +#define AXP22X_DCDC4_V_OUT		0x24
> +#define AXP22X_DCDC5_V_OUT		0x25
> +#define AXP22X_DCDC23_V_RAMP_CTRL	0x27
> +#define AXP22X_ALDO1_V_OUT		0x28
> +#define AXP22X_ALDO2_V_OUT		0x29
> +#define AXP22X_ALDO3_V_OUT		0x2a
> +#define AXP22X_CHRG_CTRL3		0x35
> +
>  /* Interrupt */
>  #define AXP20X_IRQ1_EN			0x40
>  #define AXP20X_IRQ2_EN			0x41
> @@ -100,6 +123,9 @@ enum {
>  #define AXP20X_VBUS_MON			0x8b
>  #define AXP20X_OVER_TMP			0x8f
>  
> +#define AXP22X_PWREN_CTRL1		0x8c
> +#define AXP22X_PWREN_CTRL2		0x8d
> +
>  /* GPIO */
>  #define AXP20X_GPIO0_CTRL		0x90
>  #define AXP20X_LDO5_V_OUT		0x91
> @@ -108,6 +134,11 @@ enum {
>  #define AXP20X_GPIO20_SS		0x94
>  #define AXP20X_GPIO3_CTRL		0x95
>  
> +#define AXP22X_LDO_IO0_V_OUT		0x91
> +#define AXP22X_LDO_IO1_V_OUT		0x93
> +#define AXP22X_GPIO_STATE		0x94
> +#define AXP22X_GPIO_PULL_DOWN		0x95
> +
>  /* Battery */
>  #define AXP20X_CHRG_CC_31_24		0xb0
>  #define AXP20X_CHRG_CC_23_16		0xb1
> @@ -120,6 +151,9 @@ enum {
>  #define AXP20X_CC_CTRL			0xb8
>  #define AXP20X_FG_RES			0xb9
>  
> +/* AXP22X specific registers */
> +#define AXP22X_BATLOW_THRES1		0xe6
> +
>  /* AXP288 specific registers */
>  #define AXP288_PMIC_ADC_H               0x56
>  #define AXP288_PMIC_ADC_L               0x57
> @@ -158,6 +192,30 @@ enum {
>  	AXP20X_REG_ID_MAX,
>  };
>  
> +enum {
> +	AXP22X_DCDC1 = 0,
> +	AXP22X_DCDC2,
> +	AXP22X_DCDC3,
> +	AXP22X_DCDC4,
> +	AXP22X_DCDC5,
> +	AXP22X_DC1SW,
> +	AXP22X_DC5LDO,
> +	AXP22X_ALDO1,
> +	AXP22X_ALDO2,
> +	AXP22X_ALDO3,
> +	AXP22X_ELDO1,
> +	AXP22X_ELDO2,
> +	AXP22X_ELDO3,
> +	AXP22X_DLDO1,
> +	AXP22X_DLDO2,
> +	AXP22X_DLDO3,
> +	AXP22X_DLDO4,
> +	AXP22X_RTC_LDO,
> +	AXP22X_LDO_IO0,
> +	AXP22X_LDO_IO1,
> +	AXP22X_REG_ID_MAX,
> +};
> +
>  /* IRQs */
>  enum {
>  	AXP20X_IRQ_ACIN_OVER_V = 1,
> @@ -199,6 +257,34 @@ enum {
>  	AXP20X_IRQ_GPIO0_INPUT,
>  };
>  
> +enum axp22x_irqs {
> +	AXP22X_IRQ_ACIN_OVER_V = 1,
> +	AXP22X_IRQ_ACIN_PLUGIN,
> +	AXP22X_IRQ_ACIN_REMOVAL,
> +	AXP22X_IRQ_VBUS_OVER_V,
> +	AXP22X_IRQ_VBUS_PLUGIN,
> +	AXP22X_IRQ_VBUS_REMOVAL,
> +	AXP22X_IRQ_VBUS_V_LOW,
> +	AXP22X_IRQ_BATT_PLUGIN,
> +	AXP22X_IRQ_BATT_REMOVAL,
> +	AXP22X_IRQ_BATT_ENT_ACT_MODE,
> +	AXP22X_IRQ_BATT_EXIT_ACT_MODE,
> +	AXP22X_IRQ_CHARG,
> +	AXP22X_IRQ_CHARG_DONE,
> +	AXP22X_IRQ_BATT_TEMP_HIGH,
> +	AXP22X_IRQ_BATT_TEMP_LOW,
> +	AXP22X_IRQ_DIE_TEMP_HIGH,
> +	AXP22X_IRQ_PEK_SHORT,
> +	AXP22X_IRQ_PEK_LONG,
> +	AXP22X_IRQ_LOW_PWR_LVL1,
> +	AXP22X_IRQ_LOW_PWR_LVL2,
> +	AXP22X_IRQ_TIMER,
> +	AXP22X_IRQ_PEK_RIS_EDGE,
> +	AXP22X_IRQ_PEK_FAL_EDGE,
> +	AXP22X_IRQ_GPIO1_INPUT,
> +	AXP22X_IRQ_GPIO0_INPUT,
> +};
> +
>  enum axp288_irqs {
>  	AXP288_IRQ_VBUS_FALL     = 2,
>  	AXP288_IRQ_VBUS_RISE,

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

* Re: [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
@ 2015-03-23 11:52     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:52 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	Boris BREZILLON,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> 
> Add support for the AXP22x PMIC devices to the existing AXP20x driver.
> This includes the AXP221 and AXP223, which are identical except for
> the external data bus. Only AXP221 is added for now. AXP223 will be
> added after it's Reduced Serial Bus (RSB) interface is supported.
> 
> AXP22x defines a new set of registers, power supplies and regulators,
> but most of the API is similar to the AXP20x ones.
> 
> A new irq chip definition is used, even though the available interrupts
> on AXP22x is a subset of those on AXP20x. This is done so the interrupt
> numbers match those on the datasheet.
> 
> This patch only enables the interrupts, system power-off function, and PEK
> sub-device. The regulator driver must first support different variants
> before we enable it from the mfd driver.
> 
> Signed-off-by: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> [wens-jdAy2FN1RRM@public.gmane.org: fix interrupts and move regulators to separate patch]
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
> ---
>  drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 184 insertions(+)

For my own reference:

Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

How do you wish for these patches to be managed?  Are they okay to be
sucked up individually, or do you wish for them to go through together
through a single tree?  If the latter, when which tree?

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index b1b580a88654..0ec27d5023df 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -32,6 +32,7 @@
>  static const char const *axp20x_model_names[] = {
>  	"AXP202",
>  	"AXP209",
> +	"AXP221",
>  	"AXP288",
>  };
>  
> @@ -54,6 +55,25 @@ static const struct regmap_access_table axp20x_volatile_table = {
>  	.n_yes_ranges	= ARRAY_SIZE(axp20x_volatile_ranges),
>  };
>  
> +static const struct regmap_range axp22x_writeable_ranges[] = {
> +	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
> +	regmap_reg_range(AXP20X_DCDC_MODE, AXP22X_BATLOW_THRES1),
> +};
> +
> +static const struct regmap_range axp22x_volatile_ranges[] = {
> +	regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE),
> +};
> +
> +static const struct regmap_access_table axp22x_writeable_table = {
> +	.yes_ranges	= axp22x_writeable_ranges,
> +	.n_yes_ranges	= ARRAY_SIZE(axp22x_writeable_ranges),
> +};
> +
> +static const struct regmap_access_table axp22x_volatile_table = {
> +	.yes_ranges	= axp22x_volatile_ranges,
> +	.n_yes_ranges	= ARRAY_SIZE(axp22x_volatile_ranges),
> +};
> +
>  static const struct regmap_range axp288_writeable_ranges[] = {
>  	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ6_STATE),
>  	regmap_reg_range(AXP20X_DCDC_MODE, AXP288_FG_TUNE5),
> @@ -87,6 +107,20 @@ static struct resource axp20x_pek_resources[] = {
>  	},
>  };
>  
> +static struct resource axp22x_pek_resources[] = {
> +	{
> +		.name   = "PEK_DBR",
> +		.start  = AXP22X_IRQ_PEK_RIS_EDGE,
> +		.end    = AXP22X_IRQ_PEK_RIS_EDGE,
> +		.flags  = IORESOURCE_IRQ,
> +	}, {
> +		.name   = "PEK_DBF",
> +		.start  = AXP22X_IRQ_PEK_FAL_EDGE,
> +		.end    = AXP22X_IRQ_PEK_FAL_EDGE,
> +		.flags  = IORESOURCE_IRQ,
> +	},
> +};
> +
>  static struct resource axp288_battery_resources[] = {
>  	{
>  		.start = AXP288_IRQ_QWBTU,
> @@ -129,6 +163,15 @@ static const struct regmap_config axp20x_regmap_config = {
>  	.cache_type	= REGCACHE_RBTREE,
>  };
>  
> +static const struct regmap_config axp22x_regmap_config = {
> +	.reg_bits	= 8,
> +	.val_bits	= 8,
> +	.wr_table	= &axp22x_writeable_table,
> +	.volatile_table	= &axp22x_volatile_table,
> +	.max_register	= AXP22X_BATLOW_THRES1,
> +	.cache_type	= REGCACHE_RBTREE,
> +};
> +
>  static const struct regmap_config axp288_regmap_config = {
>  	.reg_bits	= 8,
>  	.val_bits	= 8,
> @@ -181,6 +224,34 @@ static const struct regmap_irq axp20x_regmap_irqs[] = {
>  	INIT_REGMAP_IRQ(AXP20X, GPIO0_INPUT,		4, 0),
>  };
>  
> +static const struct regmap_irq axp22x_regmap_irqs[] = {
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_OVER_V,		0, 7),
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_PLUGIN,		0, 6),
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_REMOVAL,	        0, 5),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_OVER_V,		0, 4),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_PLUGIN,		0, 3),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_REMOVAL,	        0, 2),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_V_LOW,		0, 1),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_PLUGIN,		1, 7),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_REMOVAL,	        1, 6),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_ENT_ACT_MODE,	1, 5),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_EXIT_ACT_MODE,	1, 4),
> +	INIT_REGMAP_IRQ(AXP22X, CHARG,		        1, 3),
> +	INIT_REGMAP_IRQ(AXP22X, CHARG_DONE,		1, 2),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_HIGH,	        1, 1),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_LOW,	        1, 0),
> +	INIT_REGMAP_IRQ(AXP22X, DIE_TEMP_HIGH,	        2, 7),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_SHORT,		2, 1),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_LONG,		2, 0),
> +	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL1,	        3, 1),
> +	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL2,	        3, 0),
> +	INIT_REGMAP_IRQ(AXP22X, TIMER,		        4, 7),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_RIS_EDGE,	        4, 6),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_FAL_EDGE,	        4, 5),
> +	INIT_REGMAP_IRQ(AXP22X, GPIO1_INPUT,		4, 1),
> +	INIT_REGMAP_IRQ(AXP22X, GPIO0_INPUT,		4, 0),
> +};
> +
>  /* some IRQs are compatible with axp20x models */
>  static const struct regmap_irq axp288_regmap_irqs[] = {
>  	INIT_REGMAP_IRQ(AXP288, VBUS_FALL,              0, 2),
> @@ -224,6 +295,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
>  static const struct of_device_id axp20x_of_match[] = {
>  	{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
>  	{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
> +	{ .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, axp20x_of_match);
> @@ -258,6 +330,18 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
>  
>  };
>  
> +static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
> +	.name			= "axp22x_irq_chip",
> +	.status_base		= AXP20X_IRQ1_STATE,
> +	.ack_base		= AXP20X_IRQ1_STATE,
> +	.mask_base		= AXP20X_IRQ1_EN,
> +	.mask_invert		= true,
> +	.init_ack_masked	= true,
> +	.irqs			= axp22x_regmap_irqs,
> +	.num_irqs		= ARRAY_SIZE(axp22x_regmap_irqs),
> +	.num_regs		= 5,
> +};
> +
>  static const struct regmap_irq_chip axp288_regmap_irq_chip = {
>  	.name			= "axp288_irq_chip",
>  	.status_base		= AXP20X_IRQ1_STATE,
> @@ -281,6 +365,14 @@ static struct mfd_cell axp20x_cells[] = {
>  	},
>  };
>  
> +static struct mfd_cell axp22x_cells[] = {
> +	{
> +		.name			= "axp20x-pek",
> +		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
> +		.resources		= axp22x_pek_resources,
> +	},
> +};
> +
>  static struct resource axp288_adc_resources[] = {
>  	{
>  		.name  = "GPADC",
> @@ -398,6 +490,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
>  		axp20x->regmap_cfg = &axp20x_regmap_config;
>  		axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
>  		break;
> +	case AXP221_ID:
> +		axp20x->nr_cells = ARRAY_SIZE(axp22x_cells);
> +		axp20x->cells = axp22x_cells;
> +		axp20x->regmap_cfg = &axp22x_regmap_config;
> +		axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
> +		break;
>  	case AXP288_ID:
>  		axp20x->cells = axp288_cells;
>  		axp20x->nr_cells = ARRAY_SIZE(axp288_cells);
> diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
> index dfabd6db7ddf..95568eb798c3 100644
> --- a/include/linux/mfd/axp20x.h
> +++ b/include/linux/mfd/axp20x.h
> @@ -14,6 +14,7 @@
>  enum {
>  	AXP202_ID = 0,
>  	AXP209_ID,
> +	AXP221_ID,
>  	AXP288_ID,
>  	NR_AXP20X_VARIANTS,
>  };
> @@ -45,6 +46,28 @@ enum {
>  #define AXP20X_V_LTF_DISCHRG		0x3c
>  #define AXP20X_V_HTF_DISCHRG		0x3d
>  
> +#define AXP22X_PWR_OUT_CTRL1		0x10
> +#define AXP22X_PWR_OUT_CTRL2		0x12
> +#define AXP22X_PWR_OUT_CTRL3		0x13
> +#define AXP22X_DLDO1_V_OUT		0x15
> +#define AXP22X_DLDO2_V_OUT		0x16
> +#define AXP22X_DLDO3_V_OUT		0x17
> +#define AXP22X_DLDO4_V_OUT		0x18
> +#define AXP22X_ELDO1_V_OUT		0x19
> +#define AXP22X_ELDO2_V_OUT		0x1a
> +#define AXP22X_ELDO3_V_OUT		0x1b
> +#define AXP22X_DC5LDO_V_OUT		0x1c
> +#define AXP22X_DCDC1_V_OUT		0x21
> +#define AXP22X_DCDC2_V_OUT		0x22
> +#define AXP22X_DCDC3_V_OUT		0x23
> +#define AXP22X_DCDC4_V_OUT		0x24
> +#define AXP22X_DCDC5_V_OUT		0x25
> +#define AXP22X_DCDC23_V_RAMP_CTRL	0x27
> +#define AXP22X_ALDO1_V_OUT		0x28
> +#define AXP22X_ALDO2_V_OUT		0x29
> +#define AXP22X_ALDO3_V_OUT		0x2a
> +#define AXP22X_CHRG_CTRL3		0x35
> +
>  /* Interrupt */
>  #define AXP20X_IRQ1_EN			0x40
>  #define AXP20X_IRQ2_EN			0x41
> @@ -100,6 +123,9 @@ enum {
>  #define AXP20X_VBUS_MON			0x8b
>  #define AXP20X_OVER_TMP			0x8f
>  
> +#define AXP22X_PWREN_CTRL1		0x8c
> +#define AXP22X_PWREN_CTRL2		0x8d
> +
>  /* GPIO */
>  #define AXP20X_GPIO0_CTRL		0x90
>  #define AXP20X_LDO5_V_OUT		0x91
> @@ -108,6 +134,11 @@ enum {
>  #define AXP20X_GPIO20_SS		0x94
>  #define AXP20X_GPIO3_CTRL		0x95
>  
> +#define AXP22X_LDO_IO0_V_OUT		0x91
> +#define AXP22X_LDO_IO1_V_OUT		0x93
> +#define AXP22X_GPIO_STATE		0x94
> +#define AXP22X_GPIO_PULL_DOWN		0x95
> +
>  /* Battery */
>  #define AXP20X_CHRG_CC_31_24		0xb0
>  #define AXP20X_CHRG_CC_23_16		0xb1
> @@ -120,6 +151,9 @@ enum {
>  #define AXP20X_CC_CTRL			0xb8
>  #define AXP20X_FG_RES			0xb9
>  
> +/* AXP22X specific registers */
> +#define AXP22X_BATLOW_THRES1		0xe6
> +
>  /* AXP288 specific registers */
>  #define AXP288_PMIC_ADC_H               0x56
>  #define AXP288_PMIC_ADC_L               0x57
> @@ -158,6 +192,30 @@ enum {
>  	AXP20X_REG_ID_MAX,
>  };
>  
> +enum {
> +	AXP22X_DCDC1 = 0,
> +	AXP22X_DCDC2,
> +	AXP22X_DCDC3,
> +	AXP22X_DCDC4,
> +	AXP22X_DCDC5,
> +	AXP22X_DC1SW,
> +	AXP22X_DC5LDO,
> +	AXP22X_ALDO1,
> +	AXP22X_ALDO2,
> +	AXP22X_ALDO3,
> +	AXP22X_ELDO1,
> +	AXP22X_ELDO2,
> +	AXP22X_ELDO3,
> +	AXP22X_DLDO1,
> +	AXP22X_DLDO2,
> +	AXP22X_DLDO3,
> +	AXP22X_DLDO4,
> +	AXP22X_RTC_LDO,
> +	AXP22X_LDO_IO0,
> +	AXP22X_LDO_IO1,
> +	AXP22X_REG_ID_MAX,
> +};
> +
>  /* IRQs */
>  enum {
>  	AXP20X_IRQ_ACIN_OVER_V = 1,
> @@ -199,6 +257,34 @@ enum {
>  	AXP20X_IRQ_GPIO0_INPUT,
>  };
>  
> +enum axp22x_irqs {
> +	AXP22X_IRQ_ACIN_OVER_V = 1,
> +	AXP22X_IRQ_ACIN_PLUGIN,
> +	AXP22X_IRQ_ACIN_REMOVAL,
> +	AXP22X_IRQ_VBUS_OVER_V,
> +	AXP22X_IRQ_VBUS_PLUGIN,
> +	AXP22X_IRQ_VBUS_REMOVAL,
> +	AXP22X_IRQ_VBUS_V_LOW,
> +	AXP22X_IRQ_BATT_PLUGIN,
> +	AXP22X_IRQ_BATT_REMOVAL,
> +	AXP22X_IRQ_BATT_ENT_ACT_MODE,
> +	AXP22X_IRQ_BATT_EXIT_ACT_MODE,
> +	AXP22X_IRQ_CHARG,
> +	AXP22X_IRQ_CHARG_DONE,
> +	AXP22X_IRQ_BATT_TEMP_HIGH,
> +	AXP22X_IRQ_BATT_TEMP_LOW,
> +	AXP22X_IRQ_DIE_TEMP_HIGH,
> +	AXP22X_IRQ_PEK_SHORT,
> +	AXP22X_IRQ_PEK_LONG,
> +	AXP22X_IRQ_LOW_PWR_LVL1,
> +	AXP22X_IRQ_LOW_PWR_LVL2,
> +	AXP22X_IRQ_TIMER,
> +	AXP22X_IRQ_PEK_RIS_EDGE,
> +	AXP22X_IRQ_PEK_FAL_EDGE,
> +	AXP22X_IRQ_GPIO1_INPUT,
> +	AXP22X_IRQ_GPIO0_INPUT,
> +};
> +
>  enum axp288_irqs {
>  	AXP288_IRQ_VBUS_FALL     = 2,
>  	AXP288_IRQ_VBUS_RISE,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

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

* [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
@ 2015-03-23 11:52     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Add support for the AXP22x PMIC devices to the existing AXP20x driver.
> This includes the AXP221 and AXP223, which are identical except for
> the external data bus. Only AXP221 is added for now. AXP223 will be
> added after it's Reduced Serial Bus (RSB) interface is supported.
> 
> AXP22x defines a new set of registers, power supplies and regulators,
> but most of the API is similar to the AXP20x ones.
> 
> A new irq chip definition is used, even though the available interrupts
> on AXP22x is a subset of those on AXP20x. This is done so the interrupt
> numbers match those on the datasheet.
> 
> This patch only enables the interrupts, system power-off function, and PEK
> sub-device. The regulator driver must first support different variants
> before we enable it from the mfd driver.
> 
> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
> [wens at csie.org: fix interrupts and move regulators to separate patch]
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 184 insertions(+)

For my own reference:

Acked-by: Lee Jones <lee.jones@linaro.org>

How do you wish for these patches to be managed?  Are they okay to be
sucked up individually, or do you wish for them to go through together
through a single tree?  If the latter, when which tree?

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index b1b580a88654..0ec27d5023df 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -32,6 +32,7 @@
>  static const char const *axp20x_model_names[] = {
>  	"AXP202",
>  	"AXP209",
> +	"AXP221",
>  	"AXP288",
>  };
>  
> @@ -54,6 +55,25 @@ static const struct regmap_access_table axp20x_volatile_table = {
>  	.n_yes_ranges	= ARRAY_SIZE(axp20x_volatile_ranges),
>  };
>  
> +static const struct regmap_range axp22x_writeable_ranges[] = {
> +	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
> +	regmap_reg_range(AXP20X_DCDC_MODE, AXP22X_BATLOW_THRES1),
> +};
> +
> +static const struct regmap_range axp22x_volatile_ranges[] = {
> +	regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE),
> +};
> +
> +static const struct regmap_access_table axp22x_writeable_table = {
> +	.yes_ranges	= axp22x_writeable_ranges,
> +	.n_yes_ranges	= ARRAY_SIZE(axp22x_writeable_ranges),
> +};
> +
> +static const struct regmap_access_table axp22x_volatile_table = {
> +	.yes_ranges	= axp22x_volatile_ranges,
> +	.n_yes_ranges	= ARRAY_SIZE(axp22x_volatile_ranges),
> +};
> +
>  static const struct regmap_range axp288_writeable_ranges[] = {
>  	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ6_STATE),
>  	regmap_reg_range(AXP20X_DCDC_MODE, AXP288_FG_TUNE5),
> @@ -87,6 +107,20 @@ static struct resource axp20x_pek_resources[] = {
>  	},
>  };
>  
> +static struct resource axp22x_pek_resources[] = {
> +	{
> +		.name   = "PEK_DBR",
> +		.start  = AXP22X_IRQ_PEK_RIS_EDGE,
> +		.end    = AXP22X_IRQ_PEK_RIS_EDGE,
> +		.flags  = IORESOURCE_IRQ,
> +	}, {
> +		.name   = "PEK_DBF",
> +		.start  = AXP22X_IRQ_PEK_FAL_EDGE,
> +		.end    = AXP22X_IRQ_PEK_FAL_EDGE,
> +		.flags  = IORESOURCE_IRQ,
> +	},
> +};
> +
>  static struct resource axp288_battery_resources[] = {
>  	{
>  		.start = AXP288_IRQ_QWBTU,
> @@ -129,6 +163,15 @@ static const struct regmap_config axp20x_regmap_config = {
>  	.cache_type	= REGCACHE_RBTREE,
>  };
>  
> +static const struct regmap_config axp22x_regmap_config = {
> +	.reg_bits	= 8,
> +	.val_bits	= 8,
> +	.wr_table	= &axp22x_writeable_table,
> +	.volatile_table	= &axp22x_volatile_table,
> +	.max_register	= AXP22X_BATLOW_THRES1,
> +	.cache_type	= REGCACHE_RBTREE,
> +};
> +
>  static const struct regmap_config axp288_regmap_config = {
>  	.reg_bits	= 8,
>  	.val_bits	= 8,
> @@ -181,6 +224,34 @@ static const struct regmap_irq axp20x_regmap_irqs[] = {
>  	INIT_REGMAP_IRQ(AXP20X, GPIO0_INPUT,		4, 0),
>  };
>  
> +static const struct regmap_irq axp22x_regmap_irqs[] = {
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_OVER_V,		0, 7),
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_PLUGIN,		0, 6),
> +	INIT_REGMAP_IRQ(AXP22X, ACIN_REMOVAL,	        0, 5),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_OVER_V,		0, 4),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_PLUGIN,		0, 3),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_REMOVAL,	        0, 2),
> +	INIT_REGMAP_IRQ(AXP22X, VBUS_V_LOW,		0, 1),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_PLUGIN,		1, 7),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_REMOVAL,	        1, 6),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_ENT_ACT_MODE,	1, 5),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_EXIT_ACT_MODE,	1, 4),
> +	INIT_REGMAP_IRQ(AXP22X, CHARG,		        1, 3),
> +	INIT_REGMAP_IRQ(AXP22X, CHARG_DONE,		1, 2),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_HIGH,	        1, 1),
> +	INIT_REGMAP_IRQ(AXP22X, BATT_TEMP_LOW,	        1, 0),
> +	INIT_REGMAP_IRQ(AXP22X, DIE_TEMP_HIGH,	        2, 7),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_SHORT,		2, 1),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_LONG,		2, 0),
> +	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL1,	        3, 1),
> +	INIT_REGMAP_IRQ(AXP22X, LOW_PWR_LVL2,	        3, 0),
> +	INIT_REGMAP_IRQ(AXP22X, TIMER,		        4, 7),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_RIS_EDGE,	        4, 6),
> +	INIT_REGMAP_IRQ(AXP22X, PEK_FAL_EDGE,	        4, 5),
> +	INIT_REGMAP_IRQ(AXP22X, GPIO1_INPUT,		4, 1),
> +	INIT_REGMAP_IRQ(AXP22X, GPIO0_INPUT,		4, 0),
> +};
> +
>  /* some IRQs are compatible with axp20x models */
>  static const struct regmap_irq axp288_regmap_irqs[] = {
>  	INIT_REGMAP_IRQ(AXP288, VBUS_FALL,              0, 2),
> @@ -224,6 +295,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
>  static const struct of_device_id axp20x_of_match[] = {
>  	{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
>  	{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
> +	{ .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, axp20x_of_match);
> @@ -258,6 +330,18 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
>  
>  };
>  
> +static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
> +	.name			= "axp22x_irq_chip",
> +	.status_base		= AXP20X_IRQ1_STATE,
> +	.ack_base		= AXP20X_IRQ1_STATE,
> +	.mask_base		= AXP20X_IRQ1_EN,
> +	.mask_invert		= true,
> +	.init_ack_masked	= true,
> +	.irqs			= axp22x_regmap_irqs,
> +	.num_irqs		= ARRAY_SIZE(axp22x_regmap_irqs),
> +	.num_regs		= 5,
> +};
> +
>  static const struct regmap_irq_chip axp288_regmap_irq_chip = {
>  	.name			= "axp288_irq_chip",
>  	.status_base		= AXP20X_IRQ1_STATE,
> @@ -281,6 +365,14 @@ static struct mfd_cell axp20x_cells[] = {
>  	},
>  };
>  
> +static struct mfd_cell axp22x_cells[] = {
> +	{
> +		.name			= "axp20x-pek",
> +		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
> +		.resources		= axp22x_pek_resources,
> +	},
> +};
> +
>  static struct resource axp288_adc_resources[] = {
>  	{
>  		.name  = "GPADC",
> @@ -398,6 +490,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
>  		axp20x->regmap_cfg = &axp20x_regmap_config;
>  		axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
>  		break;
> +	case AXP221_ID:
> +		axp20x->nr_cells = ARRAY_SIZE(axp22x_cells);
> +		axp20x->cells = axp22x_cells;
> +		axp20x->regmap_cfg = &axp22x_regmap_config;
> +		axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
> +		break;
>  	case AXP288_ID:
>  		axp20x->cells = axp288_cells;
>  		axp20x->nr_cells = ARRAY_SIZE(axp288_cells);
> diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
> index dfabd6db7ddf..95568eb798c3 100644
> --- a/include/linux/mfd/axp20x.h
> +++ b/include/linux/mfd/axp20x.h
> @@ -14,6 +14,7 @@
>  enum {
>  	AXP202_ID = 0,
>  	AXP209_ID,
> +	AXP221_ID,
>  	AXP288_ID,
>  	NR_AXP20X_VARIANTS,
>  };
> @@ -45,6 +46,28 @@ enum {
>  #define AXP20X_V_LTF_DISCHRG		0x3c
>  #define AXP20X_V_HTF_DISCHRG		0x3d
>  
> +#define AXP22X_PWR_OUT_CTRL1		0x10
> +#define AXP22X_PWR_OUT_CTRL2		0x12
> +#define AXP22X_PWR_OUT_CTRL3		0x13
> +#define AXP22X_DLDO1_V_OUT		0x15
> +#define AXP22X_DLDO2_V_OUT		0x16
> +#define AXP22X_DLDO3_V_OUT		0x17
> +#define AXP22X_DLDO4_V_OUT		0x18
> +#define AXP22X_ELDO1_V_OUT		0x19
> +#define AXP22X_ELDO2_V_OUT		0x1a
> +#define AXP22X_ELDO3_V_OUT		0x1b
> +#define AXP22X_DC5LDO_V_OUT		0x1c
> +#define AXP22X_DCDC1_V_OUT		0x21
> +#define AXP22X_DCDC2_V_OUT		0x22
> +#define AXP22X_DCDC3_V_OUT		0x23
> +#define AXP22X_DCDC4_V_OUT		0x24
> +#define AXP22X_DCDC5_V_OUT		0x25
> +#define AXP22X_DCDC23_V_RAMP_CTRL	0x27
> +#define AXP22X_ALDO1_V_OUT		0x28
> +#define AXP22X_ALDO2_V_OUT		0x29
> +#define AXP22X_ALDO3_V_OUT		0x2a
> +#define AXP22X_CHRG_CTRL3		0x35
> +
>  /* Interrupt */
>  #define AXP20X_IRQ1_EN			0x40
>  #define AXP20X_IRQ2_EN			0x41
> @@ -100,6 +123,9 @@ enum {
>  #define AXP20X_VBUS_MON			0x8b
>  #define AXP20X_OVER_TMP			0x8f
>  
> +#define AXP22X_PWREN_CTRL1		0x8c
> +#define AXP22X_PWREN_CTRL2		0x8d
> +
>  /* GPIO */
>  #define AXP20X_GPIO0_CTRL		0x90
>  #define AXP20X_LDO5_V_OUT		0x91
> @@ -108,6 +134,11 @@ enum {
>  #define AXP20X_GPIO20_SS		0x94
>  #define AXP20X_GPIO3_CTRL		0x95
>  
> +#define AXP22X_LDO_IO0_V_OUT		0x91
> +#define AXP22X_LDO_IO1_V_OUT		0x93
> +#define AXP22X_GPIO_STATE		0x94
> +#define AXP22X_GPIO_PULL_DOWN		0x95
> +
>  /* Battery */
>  #define AXP20X_CHRG_CC_31_24		0xb0
>  #define AXP20X_CHRG_CC_23_16		0xb1
> @@ -120,6 +151,9 @@ enum {
>  #define AXP20X_CC_CTRL			0xb8
>  #define AXP20X_FG_RES			0xb9
>  
> +/* AXP22X specific registers */
> +#define AXP22X_BATLOW_THRES1		0xe6
> +
>  /* AXP288 specific registers */
>  #define AXP288_PMIC_ADC_H               0x56
>  #define AXP288_PMIC_ADC_L               0x57
> @@ -158,6 +192,30 @@ enum {
>  	AXP20X_REG_ID_MAX,
>  };
>  
> +enum {
> +	AXP22X_DCDC1 = 0,
> +	AXP22X_DCDC2,
> +	AXP22X_DCDC3,
> +	AXP22X_DCDC4,
> +	AXP22X_DCDC5,
> +	AXP22X_DC1SW,
> +	AXP22X_DC5LDO,
> +	AXP22X_ALDO1,
> +	AXP22X_ALDO2,
> +	AXP22X_ALDO3,
> +	AXP22X_ELDO1,
> +	AXP22X_ELDO2,
> +	AXP22X_ELDO3,
> +	AXP22X_DLDO1,
> +	AXP22X_DLDO2,
> +	AXP22X_DLDO3,
> +	AXP22X_DLDO4,
> +	AXP22X_RTC_LDO,
> +	AXP22X_LDO_IO0,
> +	AXP22X_LDO_IO1,
> +	AXP22X_REG_ID_MAX,
> +};
> +
>  /* IRQs */
>  enum {
>  	AXP20X_IRQ_ACIN_OVER_V = 1,
> @@ -199,6 +257,34 @@ enum {
>  	AXP20X_IRQ_GPIO0_INPUT,
>  };
>  
> +enum axp22x_irqs {
> +	AXP22X_IRQ_ACIN_OVER_V = 1,
> +	AXP22X_IRQ_ACIN_PLUGIN,
> +	AXP22X_IRQ_ACIN_REMOVAL,
> +	AXP22X_IRQ_VBUS_OVER_V,
> +	AXP22X_IRQ_VBUS_PLUGIN,
> +	AXP22X_IRQ_VBUS_REMOVAL,
> +	AXP22X_IRQ_VBUS_V_LOW,
> +	AXP22X_IRQ_BATT_PLUGIN,
> +	AXP22X_IRQ_BATT_REMOVAL,
> +	AXP22X_IRQ_BATT_ENT_ACT_MODE,
> +	AXP22X_IRQ_BATT_EXIT_ACT_MODE,
> +	AXP22X_IRQ_CHARG,
> +	AXP22X_IRQ_CHARG_DONE,
> +	AXP22X_IRQ_BATT_TEMP_HIGH,
> +	AXP22X_IRQ_BATT_TEMP_LOW,
> +	AXP22X_IRQ_DIE_TEMP_HIGH,
> +	AXP22X_IRQ_PEK_SHORT,
> +	AXP22X_IRQ_PEK_LONG,
> +	AXP22X_IRQ_LOW_PWR_LVL1,
> +	AXP22X_IRQ_LOW_PWR_LVL2,
> +	AXP22X_IRQ_TIMER,
> +	AXP22X_IRQ_PEK_RIS_EDGE,
> +	AXP22X_IRQ_PEK_FAL_EDGE,
> +	AXP22X_IRQ_GPIO1_INPUT,
> +	AXP22X_IRQ_GPIO0_INPUT,
> +};
> +
>  enum axp288_irqs {
>  	AXP288_IRQ_VBUS_FALL     = 2,
>  	AXP288_IRQ_VBUS_RISE,

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

* Re: [PATCH v5 04/12] mfd: axp20x: update DT bindings with AXP22x compatibles
@ 2015-03-23 11:53     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:53 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Add AXP221 to the list of supported devices.
> 
> Also replace any mention of AXP20x in the document with a
> generic "PMIC".
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

For my own reference:

Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 98685f291a72..3914a3f91ff6 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -1,15 +1,16 @@
> -AXP202/AXP209 device tree bindings
> +AXP family PMIC device tree bindings
>  
>  The axp20x family current members :
>  axp202 (X-Powers)
>  axp209 (X-Powers)
> +axp221 (X-Powers)
>  
>  Required properties:
> -- compatible: "x-powers,axp202" or "x-powers,axp209"
> +- compatible: "x-powers,axp202", "x-powers,axp209", "x-powers,axp221"
>  - reg: The I2C slave address for the AXP chip
>  - interrupt-parent: The parent interrupt controller
>  - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
> -- interrupt-controller: axp20x has its own internal IRQs
> +- interrupt-controller: The PMIC has its own internal IRQs
>  - #interrupt-cells: Should be set to 1
>  
>  Optional 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] 102+ messages in thread

* Re: [PATCH v5 04/12] mfd: axp20x: update DT bindings with AXP22x compatibles
@ 2015-03-23 11:53     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:53 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Add AXP221 to the list of supported devices.
> 
> Also replace any mention of AXP20x in the document with a
> generic "PMIC".
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

For my own reference:

Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 98685f291a72..3914a3f91ff6 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -1,15 +1,16 @@
> -AXP202/AXP209 device tree bindings
> +AXP family PMIC device tree bindings
>  
>  The axp20x family current members :
>  axp202 (X-Powers)
>  axp209 (X-Powers)
> +axp221 (X-Powers)
>  
>  Required properties:
> -- compatible: "x-powers,axp202" or "x-powers,axp209"
> +- compatible: "x-powers,axp202", "x-powers,axp209", "x-powers,axp221"
>  - reg: The I2C slave address for the AXP chip
>  - interrupt-parent: The parent interrupt controller
>  - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
> -- interrupt-controller: axp20x has its own internal IRQs
> +- interrupt-controller: The PMIC has its own internal IRQs
>  - #interrupt-cells: Should be set to 1
>  
>  Optional properties:

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

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

* [PATCH v5 04/12] mfd: axp20x: update DT bindings with AXP22x compatibles
@ 2015-03-23 11:53     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Add AXP221 to the list of supported devices.
> 
> Also replace any mention of AXP20x in the document with a
> generic "PMIC".
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

For my own reference:

Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 98685f291a72..3914a3f91ff6 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -1,15 +1,16 @@
> -AXP202/AXP209 device tree bindings
> +AXP family PMIC device tree bindings
>  
>  The axp20x family current members :
>  axp202 (X-Powers)
>  axp209 (X-Powers)
> +axp221 (X-Powers)
>  
>  Required properties:
> -- compatible: "x-powers,axp202" or "x-powers,axp209"
> +- compatible: "x-powers,axp202", "x-powers,axp209", "x-powers,axp221"
>  - reg: The I2C slave address for the AXP chip
>  - interrupt-parent: The parent interrupt controller
>  - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
> -- interrupt-controller: axp20x has its own internal IRQs
> +- interrupt-controller: The PMIC has its own internal IRQs
>  - #interrupt-cells: Should be set to 1
>  
>  Optional 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] 102+ messages in thread

* Re: [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
@ 2015-03-23 11:54     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:54 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Add the list of regulators for AXP22x to the DT bindings.
> This includes the names and supply names.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 3914a3f91ff6..0fc2f1f35cef 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -49,6 +49,33 @@ LDO3		: LDO		: ldo3in-supply
>  LDO4		: LDO		: ldo24in-supply	: shared supply
>  LDO5		: LDO		: ldo5in-supply
>  
> +

Nit: I'm not keen on double line spacing.

> +AXP221 regulators, type, and corresponding input supply names:
> +
> +Regulator	  Type		  Supply Name		  Notes
> +---------	  ----		  -----------		  -----
> +DCDC1		: DC-DC buck	: vin1-supply
> +DCDC2		: DC-DC buck	: vin2-supply
> +DCDC3		: DC-DC	buck	: vin3-supply
> +DCDC4		: DC-DC	buck	: vin4-supply
> +DCDC5		: DC-DC	buck	: vin5-supply
> +DC1SW		: On/Off Switch	: dcdc1-supply		: DCDC1 secondary output
> +DC5LDO		: LDO		: dcdc5-supply		: input from DCDC5
> +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
> +LDO_IO0		: LDO		: ips-supply		: GPIO 0
> +LDO_IO1		: LDO		: ips-supply		: GPIO 1
> +RTC_LDO		: LDO		: ips-supply		: always on
> +
> +

Nit: I'm not keen on double line spacing.

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

* Re: [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
@ 2015-03-23 11:54     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:54 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Add the list of regulators for AXP22x to the DT bindings.
> This includes the names and supply names.
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 3914a3f91ff6..0fc2f1f35cef 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -49,6 +49,33 @@ LDO3		: LDO		: ldo3in-supply
>  LDO4		: LDO		: ldo24in-supply	: shared supply
>  LDO5		: LDO		: ldo5in-supply
>  
> +

Nit: I'm not keen on double line spacing.

> +AXP221 regulators, type, and corresponding input supply names:
> +
> +Regulator	  Type		  Supply Name		  Notes
> +---------	  ----		  -----------		  -----
> +DCDC1		: DC-DC buck	: vin1-supply
> +DCDC2		: DC-DC buck	: vin2-supply
> +DCDC3		: DC-DC	buck	: vin3-supply
> +DCDC4		: DC-DC	buck	: vin4-supply
> +DCDC5		: DC-DC	buck	: vin5-supply
> +DC1SW		: On/Off Switch	: dcdc1-supply		: DCDC1 secondary output
> +DC5LDO		: LDO		: dcdc5-supply		: input from DCDC5
> +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
> +LDO_IO0		: LDO		: ips-supply		: GPIO 0
> +LDO_IO1		: LDO		: ips-supply		: GPIO 1
> +RTC_LDO		: LDO		: ips-supply		: always on
> +
> +

Nit: I'm not keen on double line spacing.

>  Example:
>  
>  axp209: pmic@34 {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

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

* [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
@ 2015-03-23 11:54     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Add the list of regulators for AXP22x to the DT bindings.
> This includes the names and supply names.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 3914a3f91ff6..0fc2f1f35cef 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -49,6 +49,33 @@ LDO3		: LDO		: ldo3in-supply
>  LDO4		: LDO		: ldo24in-supply	: shared supply
>  LDO5		: LDO		: ldo5in-supply
>  
> +

Nit: I'm not keen on double line spacing.

> +AXP221 regulators, type, and corresponding input supply names:
> +
> +Regulator	  Type		  Supply Name		  Notes
> +---------	  ----		  -----------		  -----
> +DCDC1		: DC-DC buck	: vin1-supply
> +DCDC2		: DC-DC buck	: vin2-supply
> +DCDC3		: DC-DC	buck	: vin3-supply
> +DCDC4		: DC-DC	buck	: vin4-supply
> +DCDC5		: DC-DC	buck	: vin5-supply
> +DC1SW		: On/Off Switch	: dcdc1-supply		: DCDC1 secondary output
> +DC5LDO		: LDO		: dcdc5-supply		: input from DCDC5
> +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
> +LDO_IO0		: LDO		: ips-supply		: GPIO 0
> +LDO_IO1		: LDO		: ips-supply		: GPIO 1
> +RTC_LDO		: LDO		: ips-supply		: always on
> +
> +

Nit: I'm not keen on double line spacing.

>  Example:
>  
>  axp209: pmic at 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] 102+ messages in thread

* Re: [PATCH v5 09/12] mfd: axp20x: Enable AXP22X regulators
@ 2015-03-23 11:55     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:55 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Now that the axp20x-regulators driver supports different variants of the
> AXP family, we can enable regulator support for AXP22X without the risk
> of incorrectly configuring regulators.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  drivers/mfd/axp20x.c | 2 ++
>  1 file changed, 2 insertions(+)

For my own reference:

Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 0ec27d5023df..8d2dbb7eb588 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -370,6 +370,8 @@ static struct mfd_cell axp22x_cells[] = {
>  		.name			= "axp20x-pek",
>  		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
>  		.resources		= axp22x_pek_resources,
> +	}, {
> +		.name			= "axp20x-regulator",
>  	},
>  };
>  

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

* Re: [PATCH v5 09/12] mfd: axp20x: Enable AXP22X regulators
@ 2015-03-23 11:55     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:55 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Now that the axp20x-regulators driver supports different variants of the
> AXP family, we can enable regulator support for AXP22X without the risk
> of incorrectly configuring regulators.
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
> ---
>  drivers/mfd/axp20x.c | 2 ++
>  1 file changed, 2 insertions(+)

For my own reference:

Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 0ec27d5023df..8d2dbb7eb588 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -370,6 +370,8 @@ static struct mfd_cell axp22x_cells[] = {
>  		.name			= "axp20x-pek",
>  		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
>  		.resources		= axp22x_pek_resources,
> +	}, {
> +		.name			= "axp20x-regulator",
>  	},
>  };
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

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

* [PATCH v5 09/12] mfd: axp20x: Enable AXP22X regulators
@ 2015-03-23 11:55     ` Lee Jones
  0 siblings, 0 replies; 102+ messages in thread
From: Lee Jones @ 2015-03-23 11:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:

> Now that the axp20x-regulators driver supports different variants of the
> AXP family, we can enable regulator support for AXP22X without the risk
> of incorrectly configuring regulators.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  drivers/mfd/axp20x.c | 2 ++
>  1 file changed, 2 insertions(+)

For my own reference:

Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 0ec27d5023df..8d2dbb7eb588 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -370,6 +370,8 @@ static struct mfd_cell axp22x_cells[] = {
>  		.name			= "axp20x-pek",
>  		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
>  		.resources		= axp22x_pek_resources,
> +	}, {
> +		.name			= "axp20x-regulator",
>  	},
>  };
>  

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

* Re: [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
  2015-03-23 11:52     ` Lee Jones
  (?)
@ 2015-03-23 16:58       ` Chen-Yu Tsai
  -1 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-23 16:58 UTC (permalink / raw)
  To: Lee Jones
  Cc: Chen-Yu Tsai, Maxime Ripard, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring, Boris BREZILLON, linux-arm-kernel,
	devicetree, linux-kernel, linux-sunxi

Hi,

On Mon, Mar 23, 2015 at 4:52 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:
>
>> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
>>
>> Add support for the AXP22x PMIC devices to the existing AXP20x driver.
>> This includes the AXP221 and AXP223, which are identical except for
>> the external data bus. Only AXP221 is added for now. AXP223 will be
>> added after it's Reduced Serial Bus (RSB) interface is supported.
>>
>> AXP22x defines a new set of registers, power supplies and regulators,
>> but most of the API is similar to the AXP20x ones.
>>
>> A new irq chip definition is used, even though the available interrupts
>> on AXP22x is a subset of those on AXP20x. This is done so the interrupt
>> numbers match those on the datasheet.
>>
>> This patch only enables the interrupts, system power-off function, and PEK
>> sub-device. The regulator driver must first support different variants
>> before we enable it from the mfd driver.
>>
>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>> [wens@csie.org: fix interrupts and move regulators to separate patch]
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>  drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
>>  include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 184 insertions(+)
>
> For my own reference:
>
> Acked-by: Lee Jones <lee.jones@linaro.org>
>
> How do you wish for these patches to be managed?  Are they okay to be
> sucked up individually, or do you wish for them to go through together
> through a single tree?  If the latter, when which tree?

The driver code (both mfd and regulator) have compile time dependencies
which need to go through the same tree Mark already reviewed the
regulator patches, so if you could take all the mfd and regulator
patches, that would be great.

Maxime already merged some of the dt patches. I still need to fix
up one comment, but he can merge them individually.

Thanks!


Regards
ChenYu

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

* Re: [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
@ 2015-03-23 16:58       ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-23 16:58 UTC (permalink / raw)
  To: Lee Jones
  Cc: Chen-Yu Tsai, Maxime Ripard, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring, Boris BREZILLON, linux-arm-kernel,
	devicetree, linux-kernel, linux-sunxi

Hi,

On Mon, Mar 23, 2015 at 4:52 AM, Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:
>
>> From: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>>
>> Add support for the AXP22x PMIC devices to the existing AXP20x driver.
>> This includes the AXP221 and AXP223, which are identical except for
>> the external data bus. Only AXP221 is added for now. AXP223 will be
>> added after it's Reduced Serial Bus (RSB) interface is supported.
>>
>> AXP22x defines a new set of registers, power supplies and regulators,
>> but most of the API is similar to the AXP20x ones.
>>
>> A new irq chip definition is used, even though the available interrupts
>> on AXP22x is a subset of those on AXP20x. This is done so the interrupt
>> numbers match those on the datasheet.
>>
>> This patch only enables the interrupts, system power-off function, and PEK
>> sub-device. The regulator driver must first support different variants
>> before we enable it from the mfd driver.
>>
>> Signed-off-by: Boris BREZILLON <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>> [wens-jdAy2FN1RRM@public.gmane.org: fix interrupts and move regulators to separate patch]
>> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
>> ---
>>  drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
>>  include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 184 insertions(+)
>
> For my own reference:
>
> Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>
> How do you wish for these patches to be managed?  Are they okay to be
> sucked up individually, or do you wish for them to go through together
> through a single tree?  If the latter, when which tree?

The driver code (both mfd and regulator) have compile time dependencies
which need to go through the same tree Mark already reviewed the
regulator patches, so if you could take all the mfd and regulator
patches, that would be great.

Maxime already merged some of the dt patches. I still need to fix
up one comment, but he can merge them individually.

Thanks!


Regards
ChenYu

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

* [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support
@ 2015-03-23 16:58       ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-23 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, Mar 23, 2015 at 4:52 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:
>
>> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
>>
>> Add support for the AXP22x PMIC devices to the existing AXP20x driver.
>> This includes the AXP221 and AXP223, which are identical except for
>> the external data bus. Only AXP221 is added for now. AXP223 will be
>> added after it's Reduced Serial Bus (RSB) interface is supported.
>>
>> AXP22x defines a new set of registers, power supplies and regulators,
>> but most of the API is similar to the AXP20x ones.
>>
>> A new irq chip definition is used, even though the available interrupts
>> on AXP22x is a subset of those on AXP20x. This is done so the interrupt
>> numbers match those on the datasheet.
>>
>> This patch only enables the interrupts, system power-off function, and PEK
>> sub-device. The regulator driver must first support different variants
>> before we enable it from the mfd driver.
>>
>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>> [wens at csie.org: fix interrupts and move regulators to separate patch]
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>  drivers/mfd/axp20x.c       | 98 ++++++++++++++++++++++++++++++++++++++++++++++
>>  include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 184 insertions(+)
>
> For my own reference:
>
> Acked-by: Lee Jones <lee.jones@linaro.org>
>
> How do you wish for these patches to be managed?  Are they okay to be
> sucked up individually, or do you wish for them to go through together
> through a single tree?  If the latter, when which tree?

The driver code (both mfd and regulator) have compile time dependencies
which need to go through the same tree Mark already reviewed the
regulator patches, so if you could take all the mfd and regulator
patches, that would be great.

Maxime already merged some of the dt patches. I still need to fix
up one comment, but he can merge them individually.

Thanks!


Regards
ChenYu

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

* Re: [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
  2015-03-23 11:54     ` Lee Jones
  (?)
@ 2015-03-23 17:43       ` Chen-Yu Tsai
  -1 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-23 17:43 UTC (permalink / raw)
  To: Lee Jones
  Cc: Chen-Yu Tsai, Maxime Ripard, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring, linux-arm-kernel, devicetree,
	linux-kernel, linux-sunxi

On Mon, Mar 23, 2015 at 4:54 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:
>
>> Add the list of regulators for AXP22x to the DT bindings.
>> This includes the names and supply names.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>  Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
>>  1 file changed, 27 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
>> index 3914a3f91ff6..0fc2f1f35cef 100644
>> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
>> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
>> @@ -49,6 +49,33 @@ LDO3               : LDO           : ldo3in-supply
>>  LDO4         : LDO           : ldo24in-supply        : shared supply
>>  LDO5         : LDO           : ldo5in-supply
>>
>> +
>
> Nit: I'm not keen on double line spacing.
>
>> +AXP221 regulators, type, and corresponding input supply names:
>> +
>> +Regulator      Type            Supply Name             Notes
>> +---------      ----            -----------             -----
>> +DCDC1                : DC-DC buck    : vin1-supply
>> +DCDC2                : DC-DC buck    : vin2-supply
>> +DCDC3                : DC-DC buck    : vin3-supply
>> +DCDC4                : DC-DC buck    : vin4-supply
>> +DCDC5                : DC-DC buck    : vin5-supply
>> +DC1SW                : On/Off Switch : dcdc1-supply          : DCDC1 secondary output
>> +DC5LDO               : LDO           : dcdc5-supply          : input from DCDC5
>> +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
>> +LDO_IO0              : LDO           : ips-supply            : GPIO 0
>> +LDO_IO1              : LDO           : ips-supply            : GPIO 1
>> +RTC_LDO              : LDO           : ips-supply            : always on
>> +
>> +
>
> Nit: I'm not keen on double line spacing.

Ok. I can get rid of them. IMHO it makes different sections clearer though.
I assume you don't want them in the original axp20x patches either?

ChenYu

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

* Re: [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
@ 2015-03-23 17:43       ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-23 17:43 UTC (permalink / raw)
  To: Lee Jones
  Cc: Chen-Yu Tsai, Maxime Ripard, Samuel Ortiz, Mark Brown,
	Liam Girdwood, Kumar Gala, Ian Campbell, Mark Rutland,
	Pawel Moll, Rob Herring, linux-arm-kernel, devicetree,
	linux-kernel, linux-sunxi

On Mon, Mar 23, 2015 at 4:54 AM, Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:
>
>> Add the list of regulators for AXP22x to the DT bindings.
>> This includes the names and supply names.
>>
>> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
>> ---
>>  Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
>>  1 file changed, 27 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
>> index 3914a3f91ff6..0fc2f1f35cef 100644
>> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
>> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
>> @@ -49,6 +49,33 @@ LDO3               : LDO           : ldo3in-supply
>>  LDO4         : LDO           : ldo24in-supply        : shared supply
>>  LDO5         : LDO           : ldo5in-supply
>>
>> +
>
> Nit: I'm not keen on double line spacing.
>
>> +AXP221 regulators, type, and corresponding input supply names:
>> +
>> +Regulator      Type            Supply Name             Notes
>> +---------      ----            -----------             -----
>> +DCDC1                : DC-DC buck    : vin1-supply
>> +DCDC2                : DC-DC buck    : vin2-supply
>> +DCDC3                : DC-DC buck    : vin3-supply
>> +DCDC4                : DC-DC buck    : vin4-supply
>> +DCDC5                : DC-DC buck    : vin5-supply
>> +DC1SW                : On/Off Switch : dcdc1-supply          : DCDC1 secondary output
>> +DC5LDO               : LDO           : dcdc5-supply          : input from DCDC5
>> +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
>> +LDO_IO0              : LDO           : ips-supply            : GPIO 0
>> +LDO_IO1              : LDO           : ips-supply            : GPIO 1
>> +RTC_LDO              : LDO           : ips-supply            : always on
>> +
>> +
>
> Nit: I'm not keen on double line spacing.

Ok. I can get rid of them. IMHO it makes different sections clearer though.
I assume you don't want them in the original axp20x patches either?

ChenYu

>>  Example:
>>
>>  axp209: pmic@34 {
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

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

* [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings
@ 2015-03-23 17:43       ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-23 17:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 23, 2015 at 4:54 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, 10 Mar 2015, Chen-Yu Tsai wrote:
>
>> Add the list of regulators for AXP22x to the DT bindings.
>> This includes the names and supply names.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>  Documentation/devicetree/bindings/mfd/axp20x.txt | 27 ++++++++++++++++++++++++
>>  1 file changed, 27 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
>> index 3914a3f91ff6..0fc2f1f35cef 100644
>> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
>> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
>> @@ -49,6 +49,33 @@ LDO3               : LDO           : ldo3in-supply
>>  LDO4         : LDO           : ldo24in-supply        : shared supply
>>  LDO5         : LDO           : ldo5in-supply
>>
>> +
>
> Nit: I'm not keen on double line spacing.
>
>> +AXP221 regulators, type, and corresponding input supply names:
>> +
>> +Regulator      Type            Supply Name             Notes
>> +---------      ----            -----------             -----
>> +DCDC1                : DC-DC buck    : vin1-supply
>> +DCDC2                : DC-DC buck    : vin2-supply
>> +DCDC3                : DC-DC buck    : vin3-supply
>> +DCDC4                : DC-DC buck    : vin4-supply
>> +DCDC5                : DC-DC buck    : vin5-supply
>> +DC1SW                : On/Off Switch : dcdc1-supply          : DCDC1 secondary output
>> +DC5LDO               : LDO           : dcdc5-supply          : input from DCDC5
>> +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
>> +LDO_IO0              : LDO           : ips-supply            : GPIO 0
>> +LDO_IO1              : LDO           : ips-supply            : GPIO 1
>> +RTC_LDO              : LDO           : ips-supply            : always on
>> +
>> +
>
> Nit: I'm not keen on double line spacing.

Ok. I can get rid of them. IMHO it makes different sections clearer though.
I assume you don't want them in the original axp20x patches either?

ChenYu

>>  Example:
>>
>>  axp209: pmic at 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] 102+ messages in thread

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Add basic support for the WiFi module
@ 2015-03-23 22:16     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-23 22:16 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel

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

On Tue, Mar 10, 2015 at 07:59:23PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> The IC also takes a power enable signal via GPIO.
> 
> The WiFi module supports out-of-band interrupt signaling via GPIO,
> but this is not supported in this patch.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!

Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Add basic support for the WiFi module
@ 2015-03-23 22:16     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-23 22:16 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood, Kumar Gala,
	Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

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

On Tue, Mar 10, 2015 at 07:59:23PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> The IC also takes a power enable signal via GPIO.
> 
> The WiFi module supports out-of-band interrupt signaling via GPIO,
> but this is not supported in this patch.
> 
> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>

Applied, thanks!

Maxime

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Add basic support for the WiFi module
@ 2015-03-23 22:16     ` Maxime Ripard
  0 siblings, 0 replies; 102+ messages in thread
From: Maxime Ripard @ 2015-03-23 22:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 10, 2015 at 07:59:23PM +0800, Chen-Yu Tsai wrote:
> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
> The IC also takes a power enable signal via GPIO.
> 
> The WiFi module supports out-of-band interrupt signaling via GPIO,
> but this is not supported in this patch.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150323/729ac7d5/attachment.sig>

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

* Re: [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Add basic support for the WiFi module
  2015-03-23 22:16     ` Maxime Ripard
@ 2015-03-24  0:24       ` Chen-Yu Tsai
  -1 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-24  0:24 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Lee Jones, Samuel Ortiz, Mark Brown, Liam Girdwood,
	Kumar Gala, Ian Campbell, Mark Rutland, Pawel Moll, Rob Herring,
	linux-arm-kernel, devicetree, linux-kernel

On Mon, Mar 23, 2015 at 3:16 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Tue, Mar 10, 2015 at 07:59:23PM +0800, Chen-Yu Tsai wrote:
>> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
>> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
>> The IC also takes a power enable signal via GPIO.
>>
>> The WiFi module supports out-of-band interrupt signaling via GPIO,
>> but this is not supported in this patch.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>
> Applied, thanks!

Thanks, but I don't see this particular patch in dt-for-4.1 you just pushed.

ChenYu

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

* [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Add basic support for the WiFi module
@ 2015-03-24  0:24       ` Chen-Yu Tsai
  0 siblings, 0 replies; 102+ messages in thread
From: Chen-Yu Tsai @ 2015-03-24  0:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 23, 2015 at 3:16 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Tue, Mar 10, 2015 at 07:59:23PM +0800, Chen-Yu Tsai wrote:
>> The Hummingbird A31 has an AMPAK AP6210 WiFi+Bluetooth module. The
>> WiFi part is a BCM43362 IC connected to MMC1 in the A31 SoC via SDIO.
>> The IC also takes a power enable signal via GPIO.
>>
>> The WiFi module supports out-of-band interrupt signaling via GPIO,
>> but this is not supported in this patch.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>
> Applied, thanks!

Thanks, but I don't see this particular patch in dt-for-4.1 you just pushed.

ChenYu

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

end of thread, other threads:[~2015-03-24  0:25 UTC | newest]

Thread overview: 102+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 11:59 [PATCH v5 00/12] mfd: axp20x: add AXP221 PMIC support Chen-Yu Tsai
2015-03-10 11:59 ` Chen-Yu Tsai
2015-03-10 11:59 ` Chen-Yu Tsai
2015-03-10 11:59 ` [PATCH v5 01/12] ARM: dts: sun6i: add p2wi controller node to dtsi Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 21:27   ` Maxime Ripard
2015-03-10 21:27     ` Maxime Ripard
2015-03-10 21:27     ` Maxime Ripard
2015-03-10 11:59 ` [PATCH v5 02/12] ARM: dts: sun6i: hummingbird: Enable P2WI controller Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 21:27   ` Maxime Ripard
2015-03-10 21:27     ` Maxime Ripard
2015-03-10 21:27     ` Maxime Ripard
2015-03-10 11:59 ` [PATCH v5 03/12] mfd: axp20x: add AXP22x PMIC support Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-23 11:52   ` Lee Jones
2015-03-23 11:52     ` Lee Jones
2015-03-23 11:52     ` Lee Jones
2015-03-23 16:58     ` Chen-Yu Tsai
2015-03-23 16:58       ` Chen-Yu Tsai
2015-03-23 16:58       ` Chen-Yu Tsai
2015-03-10 11:59 ` [PATCH v5 04/12] mfd: axp20x: update DT bindings with AXP22x compatibles Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-23 11:53   ` Lee Jones
2015-03-23 11:53     ` Lee Jones
2015-03-23 11:53     ` Lee Jones
2015-03-10 11:59 ` [PATCH v5 05/12] ARM: dts: sun6i: hummingbird: Add AXP221 PMIC device node Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 21:28   ` Maxime Ripard
2015-03-10 21:28     ` Maxime Ripard
2015-03-10 21:28     ` Maxime Ripard
2015-03-10 11:59 ` [PATCH v5 06/12] regulator: axp20x: prepare support for multiple AXP chip families Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 20:04   ` Mark Brown
2015-03-10 20:04     ` Mark Brown
2015-03-10 20:05   ` Mark Brown
2015-03-10 20:05     ` Mark Brown
2015-03-10 20:05     ` Mark Brown
2015-03-10 11:59 ` [PATCH v5 07/12] regulator: axp20x: add support for AXP22X regulators Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 20:04   ` Mark Brown
2015-03-10 20:04     ` Mark Brown
2015-03-10 20:05   ` Mark Brown
2015-03-10 20:05     ` Mark Brown
2015-03-10 20:05     ` Mark Brown
2015-03-10 11:59 ` [PATCH v5 08/12] mfd: axp20x: Add AXP22x regulator information to DT bindings Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-23 11:54   ` Lee Jones
2015-03-23 11:54     ` Lee Jones
2015-03-23 11:54     ` Lee Jones
2015-03-23 17:43     ` Chen-Yu Tsai
2015-03-23 17:43       ` Chen-Yu Tsai
2015-03-23 17:43       ` Chen-Yu Tsai
2015-03-10 11:59 ` [PATCH v5 09/12] mfd: axp20x: Enable AXP22X regulators Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-23 11:55   ` Lee Jones
2015-03-23 11:55     ` Lee Jones
2015-03-23 11:55     ` Lee Jones
2015-03-10 11:59 ` [PATCH v5 10/12] ARM: dts: sun6i: hummingbird: Add AXP221 regulator nodes Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 21:30   ` Maxime Ripard
2015-03-10 21:30     ` Maxime Ripard
2015-03-10 21:30     ` Maxime Ripard
2015-03-10 11:59 ` [PATCH v5 11/12] ARM: dts: sun6i: Add pinmux settings for mmc1 to dtsi Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 21:31   ` Maxime Ripard
2015-03-10 21:31     ` Maxime Ripard
2015-03-10 21:31     ` Maxime Ripard
2015-03-10 11:59 ` [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Add basic support for the WiFi module Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-23 22:16   ` Maxime Ripard
2015-03-23 22:16     ` Maxime Ripard
2015-03-23 22:16     ` Maxime Ripard
2015-03-24  0:24     ` Chen-Yu Tsai
2015-03-24  0:24       ` Chen-Yu Tsai
2015-03-10 11:59 ` [PATCH v5 12/12] ARM: dts: sun6i: hummingbird: Enable the onboard " Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 11:59   ` Chen-Yu Tsai
2015-03-10 21:32   ` Maxime Ripard
2015-03-10 21:32     ` Maxime Ripard
2015-03-10 21:32     ` Maxime Ripard
2015-03-11  3:11     ` Chen-Yu Tsai
2015-03-11  3:11       ` Chen-Yu Tsai
2015-03-11  8:52       ` Maxime Ripard
2015-03-11  8:52         ` Maxime Ripard
2015-03-11  8:52         ` Maxime Ripard
2015-03-11  9:08         ` Chen-Yu Tsai
2015-03-11  9:08           ` Chen-Yu Tsai
2015-03-11  9:08           ` Chen-Yu Tsai
2015-03-11 14:28           ` Maxime Ripard
2015-03-11 14:28             ` Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.