public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator
@ 2023-01-22 23:50 Samuel Holland
  2023-04-11 13:18 ` Andre Przywara
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Holland @ 2023-01-22 23:50 UTC (permalink / raw)
  To: Andre Przywara, Jagan Teki; +Cc: Samuel Holland, Tom Rini, u-boot

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.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 arch/arm/dts/sun6i-a31-mixtile-loftq.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/dts/sun6i-a31-mixtile-loftq.dts b/arch/arm/dts/sun6i-a31-mixtile-loftq.dts
index dde9bdf2f9..bd98fb3e6a 100644
--- a/arch/arm/dts/sun6i-a31-mixtile-loftq.dts
+++ b/arch/arm/dts/sun6i-a31-mixtile-loftq.dts
@@ -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";
+};
-- 
2.37.4


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

* Re: [PATCH] ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator
  2023-01-22 23:50 [PATCH] ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator Samuel Holland
@ 2023-04-11 13:18 ` Andre Przywara
  0 siblings, 0 replies; 2+ messages in thread
From: Andre Przywara @ 2023-04-11 13:18 UTC (permalink / raw)
  To: Samuel Holland; +Cc: Jagan Teki, Tom Rini, u-boot

On Sun, 22 Jan 2023 17:50:19 -0600
Samuel Holland <samuel@sholland.org> wrote:

Hi,

> 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.
> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>

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

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Queued for sunxi/master.

Cheers,
Andre

> ---
> 
>  arch/arm/dts/sun6i-a31-mixtile-loftq.dts | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/arch/arm/dts/sun6i-a31-mixtile-loftq.dts b/arch/arm/dts/sun6i-a31-mixtile-loftq.dts
> index dde9bdf2f9..bd98fb3e6a 100644
> --- a/arch/arm/dts/sun6i-a31-mixtile-loftq.dts
> +++ b/arch/arm/dts/sun6i-a31-mixtile-loftq.dts
> @@ -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";
> +};


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

end of thread, other threads:[~2023-04-11 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-22 23:50 [PATCH] ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator Samuel Holland
2023-04-11 13:18 ` Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox