Skip to contentSkip to conversation

arm64: allwinner: Enable AXP803's USB power supply

PATCH Applied Chen-Yu Tsai 3 participants 6 messages Apr 18, 2019 – May 20, 2019

Subsystems (4)
lore
Share & tools
lore

Chen-Yu Tsai

author maintainer
#0 lore raw

cover 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(+)
Signature · 1 line
2.20.1
author maintainer
#1 lore raw

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.

---
 drivers/mfd/axp20x.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mfd/axp20x.c +5 -0
index 902f9f27e748..2215660dfa05 100644
@@ -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" },
 };
Signature · 1 line
2.20.1
author maintainer
#3 lore raw

PATCH 2/3 arm64: dts: allwinner: axp803: add USB power supply node

In reply to Chen-Yu Tsai

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

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

---
 arch/arm64/boot/dts/allwinner/axp803.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/allwinner/axp803.dtsi +6 -0
index c3a618e1279a..f0349ef4bfdd 100644
@@ -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";
+	};
 };
Signature · 1 line
2.20.1
author maintainer
#4 lore raw

PATCH 3/3 arm64: dts: allwinner: a64: bananapi-m64: Enable PMIC USB power supply

In reply to Chen-Yu Tsai

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.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +5 -0
index 0a56c0c23ba1..855d1044b9a2 100644
@@ -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";
 };
Signature · 1 line
2.20.1
Applied
#2 lore raw

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

In reply to Chen-Yu Tsai
Quoted 10 lines · Chen-Yu Tsai

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.

---
 drivers/mfd/axp20x.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw
In reply to Chen-Yu Tsai
Quoted 16 lines · Chen-Yu Tsai

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.

Quoted 7 lines

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