LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply
@ 2019-04-18 16:18 Chen-Yu Tsai
  2019-04-18 16:18 ` [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803 Chen-Yu Tsai
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Chen-Yu Tsai @ 2019-04-18 16:18 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel

From: Chen-Yu Tsai <wens@csie.org>

Hi everyone,

This series follows up on the A83T USB OTG series. The USB power supply
portion of the AXP803, the PMIC used with the A64, is identical to the
part in the AXP813/AXP818, used with the A83T.

This series enables the USB power supply in the AXP803 using the AXP813's
compatible string as a fallback. The per-model compatible string is still
added as a contigency.

Patch 1 adds an mfd cell for the USB power supply, to the AXP803.

Patch 2 adds a device node for the USB power supply.

Patch 3 enables the USB power supply on the Bananapi M64.

Unfortunately the original Pine64 does not wire up the USB power supply,
and I don't have any other A64 boards.

The mfd patch can go in through the mfd tree. There are no compile-time
dependencies. We, sunxi, can take the DT patches.

Please have a look.


Regards
ChenYu


Chen-Yu Tsai (3):
  mfd: axp20x: add USB power supply mfd cell to AXP803
  arm64: dts: allwinner: axp803: add USB power supply node
  arm64: dts: allwinner: a64: bananapi-m64: Enable PMIC USB power supply

 arch/arm64/boot/dts/allwinner/axp803.dtsi                 | 6 ++++++
 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 5 +++++
 drivers/mfd/axp20x.c                                      | 5 +++++
 3 files changed, 16 insertions(+)

-- 
2.20.1


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

* [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803
  2019-04-18 16:18 [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply Chen-Yu Tsai
@ 2019-04-18 16:18 ` Chen-Yu Tsai
  2019-05-08 10:25   ` Lee Jones
  2019-04-18 16:18 ` [PATCH 2/3] arm64: dts: allwinner: axp803: add USB power supply node Chen-Yu Tsai
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Chen-Yu Tsai @ 2019-04-18 16:18 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel

From: Chen-Yu Tsai <wens@csie.org>

The AXP803 has a VBUS power input. Its functionality is the same as the
one found in the AXP813. Now that the axp20x_usb_power driver supports
this variant, we can add an mfd cell for it to use it.

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

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 902f9f27e748..2215660dfa05 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -747,6 +747,11 @@ static const struct mfd_cell axp803_cells[] = {
 		.of_compatible	= "x-powers,axp813-ac-power-supply",
 		.num_resources	= ARRAY_SIZE(axp20x_ac_power_supply_resources),
 		.resources	= axp20x_ac_power_supply_resources,
+	}, {
+		.name		= "axp20x-usb-power-supply",
+		.num_resources	= ARRAY_SIZE(axp803_usb_power_supply_resources),
+		.resources	= axp803_usb_power_supply_resources,
+		.of_compatible	= "x-powers,axp813-usb-power-supply",
 	},
 	{	.name		= "axp20x-regulator" },
 };
-- 
2.20.1


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

* [PATCH 2/3] arm64: dts: allwinner: axp803: add USB power supply node
  2019-04-18 16:18 [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply Chen-Yu Tsai
  2019-04-18 16:18 ` [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803 Chen-Yu Tsai
@ 2019-04-18 16:18 ` Chen-Yu Tsai
  2019-04-18 16:18 ` [PATCH 3/3] arm64: dts: allwinner: a64: bananapi-m64: Enable PMIC USB power supply Chen-Yu Tsai
  2019-05-20  7:41 ` [PATCH 0/3] arm64: allwinner: Enable AXP803's " Maxime Ripard
  3 siblings, 0 replies; 6+ messages in thread
From: Chen-Yu Tsai @ 2019-04-18 16:18 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel

From: Chen-Yu Tsai <wens@csie.org>

The AXP803 has a VBUS power input. Add a device node for it,
now that we support it.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm64/boot/dts/allwinner/axp803.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi
index c3a618e1279a..f0349ef4bfdd 100644
--- a/arch/arm64/boot/dts/allwinner/axp803.dtsi
+++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi
@@ -185,4 +185,10 @@
 			status = "disabled";
 		};
 	};
+
+	usb_power_supply: usb-power-supply {
+		compatible = "x-powers,axp803-usb-power-supply",
+			     "x-powers,axp813-usb-power-supply";
+		status = "disabled";
+	};
 };
-- 
2.20.1


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

* [PATCH 3/3] arm64: dts: allwinner: a64: bananapi-m64: Enable PMIC USB power supply
  2019-04-18 16:18 [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply Chen-Yu Tsai
  2019-04-18 16:18 ` [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803 Chen-Yu Tsai
  2019-04-18 16:18 ` [PATCH 2/3] arm64: dts: allwinner: axp803: add USB power supply node Chen-Yu Tsai
@ 2019-04-18 16:18 ` Chen-Yu Tsai
  2019-05-20  7:41 ` [PATCH 0/3] arm64: allwinner: Enable AXP803's " Maxime Ripard
  3 siblings, 0 replies; 6+ messages in thread
From: Chen-Yu Tsai @ 2019-04-18 16:18 UTC (permalink / raw)
  To: Maxime Ripard, Lee Jones
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel

From: Chen-Yu Tsai <wens@csie.org>

The Bananapi M64 has a micro-USB connector with USB OTG support (that
is already enabled). VBUS from this connector is wired to the PMIC's
VBUS input.

Enable the PMIC's USB power supply on this board, and also hook it up
to the USB PHY.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
index 0a56c0c23ba1..855d1044b9a2 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
@@ -394,8 +394,13 @@
 	status = "okay";
 };
 
+&usb_power_supply {
+	status = "okay";
+};
+
 &usbphy {
 	usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+	usb0_vbus_power-supply = <&usb_power_supply>;
 	usb0_vbus-supply = <&reg_drivevbus>;
 	status = "okay";
 };
-- 
2.20.1


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

* Re: [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803
  2019-04-18 16:18 ` [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803 Chen-Yu Tsai
@ 2019-05-08 10:25   ` Lee Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2019-05-08 10:25 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel

On Fri, 19 Apr 2019, Chen-Yu Tsai wrote:

> From: Chen-Yu Tsai <wens@csie.org>
> 
> The AXP803 has a VBUS power input. Its functionality is the same as the
> one found in the AXP813. Now that the axp20x_usb_power driver supports
> this variant, we can add an mfd cell for it to use it.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  drivers/mfd/axp20x.c | 5 +++++
>  1 file changed, 5 insertions(+)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply
  2019-04-18 16:18 [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2019-04-18 16:18 ` [PATCH 3/3] arm64: dts: allwinner: a64: bananapi-m64: Enable PMIC USB power supply Chen-Yu Tsai
@ 2019-05-20  7:41 ` Maxime Ripard
  3 siblings, 0 replies; 6+ messages in thread
From: Maxime Ripard @ 2019-05-20  7:41 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Lee Jones, Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel

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

On Fri, Apr 19, 2019 at 12:18:01AM +0800, Chen-Yu Tsai wrote:
> From: Chen-Yu Tsai <wens@csie.org>
>
> Hi everyone,
>
> This series follows up on the A83T USB OTG series. The USB power supply
> portion of the AXP803, the PMIC used with the A64, is identical to the
> part in the AXP813/AXP818, used with the A83T.
>
> This series enables the USB power supply in the AXP803 using the AXP813's
> compatible string as a fallback. The per-model compatible string is still
> added as a contigency.
>
> Patch 1 adds an mfd cell for the USB power supply, to the AXP803.
>
> Patch 2 adds a device node for the USB power supply.
>
> Patch 3 enables the USB power supply on the Bananapi M64.
>
> Unfortunately the original Pine64 does not wire up the USB power supply,
> and I don't have any other A64 boards.
>
> The mfd patch can go in through the mfd tree. There are no compile-time
> dependencies. We, sunxi, can take the DT patches.

Applied 2 and 3, thanks!

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

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

end of thread, other threads:[~2019-05-20  7:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-18 16:18 [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply Chen-Yu Tsai
2019-04-18 16:18 ` [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803 Chen-Yu Tsai
2019-05-08 10:25   ` Lee Jones
2019-04-18 16:18 ` [PATCH 2/3] arm64: dts: allwinner: axp803: add USB power supply node Chen-Yu Tsai
2019-04-18 16:18 ` [PATCH 3/3] arm64: dts: allwinner: a64: bananapi-m64: Enable PMIC USB power supply Chen-Yu Tsai
2019-05-20  7:41 ` [PATCH 0/3] arm64: allwinner: Enable AXP803's " Maxime Ripard

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