Skip to contentSkip to conversation

ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator

PATCH In review Samuel Holland 2 participants 2 messages Jan 22, 2023 – Apr 11, 2023

Subsystems (2)
lore
Share & tools
lore

Samuel Holland

author maintainer
#0 lore raw

PATCH 1/1 ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator

This board is configured with CONFIG_USB1_VBUS_PIN="PH24", but no regulator exists in its device tree. Add the regulator, so USB will continue to work when the PHY driver switches to using the regulator uclass instead of a GPIO.

Update the device tree here because it does not exist in Linux.

---

 arch/arm/dts/sun6i-a31-mixtile-loftq.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/dts/sun6i-a31-mixtile-loftq.dts +17 -0
index dde9bdf2f9..bd98fb3e6a 100644
@@ -6,6 +6,9 @@
  */
 
 /dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+
 #include "sun6i-a31.dtsi"
 
 / {
@@ -19,6 +22,15 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_usb1_vbus: usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+		gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
+	};
 };
 
 &ehci0 {
@@ -56,3 +68,8 @@
 	pinctrl-0 = <&uart0_ph_pins>;
 	status = "okay";
 };
+
+&usbphy {
+	usb1_vbus-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};
Signature · 1 line
2.37.4
Reviewed-by on v1 1/1
#1 lore raw

On Sun, 22 Jan 2023 17:50:19 -0600
Samuel Holland <[email protected]> wrote:

Hi,

Quoted 8 lines

This board is configured with CONFIG_USB1_VBUS_PIN="PH24", but no regulator exists in its device tree. Add the regulator, so USB will continue to work when the PHY driver switches to using the regulator uclass instead of a GPIO.

Update the device tree here because it does not exist in Linux.

Looks alright. I cannot test this, but it compiled and matches the defconfig setting.

Queued for sunxi/master.

Cheers,
Andre

Quoted 44 lines

---

 arch/arm/dts/sun6i-a31-mixtile-loftq.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/dts/sun6i-a31-mixtile-loftq.dts +17 -0
index dde9bdf2f9..bd98fb3e6a 100644
@@ -6,6 +6,9 @@
  */
 
 /dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+
 #include "sun6i-a31.dtsi"
 
 / {
@@ -19,6 +22,15 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_usb1_vbus: usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+		gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
+	};
 };
 
 &ehci0 {
@@ -56,3 +68,8 @@
 	pinctrl-0 = <&uart0_ph_pins>;
 	status = "okay";
 };
+
+&usbphy {
+	usb1_vbus-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};