2019-04-18 16:19:19

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply

From: Chen-Yu Tsai <[email protected]>

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


2019-04-18 16:19:25

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH 3/3] arm64: dts: allwinner: a64: bananapi-m64: Enable PMIC USB power supply

From: Chen-Yu Tsai <[email protected]>

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 <[email protected]>
---
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

2019-04-18 16:19:31

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH 2/3] arm64: dts: allwinner: axp803: add USB power supply node

From: Chen-Yu Tsai <[email protected]>

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

Signed-off-by: Chen-Yu Tsai <[email protected]>
---
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

2019-04-18 16:19:35

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803

From: Chen-Yu Tsai <[email protected]>

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 <[email protected]>
---
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

2019-05-08 10:26:21

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: axp20x: add USB power supply mfd cell to AXP803

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

> From: Chen-Yu Tsai <[email protected]>
>
> 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 <[email protected]>
> ---
> 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

2019-05-20 09:16:52

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 0/3] arm64: allwinner: Enable AXP803's USB power supply

On Fri, Apr 19, 2019 at 12:18:01AM +0800, Chen-Yu Tsai wrote:
> From: Chen-Yu Tsai <[email protected]>
>
> 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


Attachments:
(No filename) (1.05 kB)
signature.asc (235.00 B)
Download all attachments