diff mbox series

[v1,02/11] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub

Message ID 20221228100321.15949-3-linux.amoon@gmail.com (mailing list archive)
State Superseded
Headers show
Series Used onboard HUB to reset and add power to hub | expand

Commit Message

Anand Moon Dec. 28, 2022, 10:03 a.m. UTC
On Odroid c1 previously use gpio-hog to reset the usb hub,
switch to used on board usb hub reset to enable the usb hub
and enable power to usb hub.

Add usb hub regulator as per the schematic.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 arch/arm/boot/dts/meson8b-odroidc1.dts | 40 +++++++++++++++++---------
 1 file changed, 27 insertions(+), 13 deletions(-)

Comments

Krzysztof Kozlowski Dec. 28, 2022, 3:08 p.m. UTC | #1
On 28/12/2022 11:03, Anand Moon wrote:
> On Odroid c1 previously use gpio-hog to reset the usb hub,
> switch to used on board usb hub reset to enable the usb hub
> and enable power to usb hub.
> 
> Add usb hub regulator as per the schematic.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>  arch/arm/boot/dts/meson8b-odroidc1.dts | 40 +++++++++++++++++---------
>  1 file changed, 27 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
> index 04356bc639fa..3b29169aac43 100644
> --- a/arch/arm/boot/dts/meson8b-odroidc1.dts
> +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
> @@ -185,6 +185,33 @@ vdd_rtc: regulator-vdd-rtc {
>  
>  		vin-supply = <&vcc_3v3>;
>  	};
> +
> +	usb_otg_pwr: regulator-usb-pwrs {
> +		compatible = "regulator-fixed";
> +		regulator-name = "USB_OTG_PWR";
> +
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +
> +		/* signal name from schematics: PWREN */
> +		gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +		vin-supply = <&p5v0>;
> +	};
> +
> +	usb {
> +		dr_mode = "host";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		hub@1 {
> +			/* Genesys Logic GL852G-OHG usb hub */
> +			compatible = "genesys,usb5e3,610";

Wrong compatible. Does not match pattern in usb-device.yaml.


Best regards,
Krzysztof
Anand Moon Jan. 7, 2023, 2:59 p.m. UTC | #2
Hi Krzysztof,

On Wed, 28 Dec 2022 at 20:39, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 28/12/2022 11:03, Anand Moon wrote:
> > On Odroid c1 previously use gpio-hog to reset the usb hub,
> > switch to used on board usb hub reset to enable the usb hub
> > and enable power to usb hub.
> >
> > Add usb hub regulator as per the schematic.
> >
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> >  arch/arm/boot/dts/meson8b-odroidc1.dts | 40 +++++++++++++++++---------
> >  1 file changed, 27 insertions(+), 13 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
> > index 04356bc639fa..3b29169aac43 100644
> > --- a/arch/arm/boot/dts/meson8b-odroidc1.dts
> > +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
> > @@ -185,6 +185,33 @@ vdd_rtc: regulator-vdd-rtc {
> >
> >               vin-supply = <&vcc_3v3>;
> >       };
> > +
> > +     usb_otg_pwr: regulator-usb-pwrs {
> > +             compatible = "regulator-fixed";
> > +             regulator-name = "USB_OTG_PWR";
> > +
> > +             regulator-min-microvolt = <5000000>;
> > +             regulator-max-microvolt = <5000000>;
> > +
> > +             /* signal name from schematics: PWREN */
> > +             gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
> > +             enable-active-high;
> > +             vin-supply = <&p5v0>;
> > +     };
> > +
> > +     usb {
> > +             dr_mode = "host";
> > +             #address-cells = <1>;
> > +             #size-cells = <0>;
> > +
> > +             hub@1 {
> > +                     /* Genesys Logic GL852G-OHG usb hub */
> > +                     compatible = "genesys,usb5e3,610";
>
> Wrong compatible. Does not match pattern in usb-device.yaml.
>

ok, will fix this in the next version.

>
> Best regards,
> Krzysztof
>

Thanks


-Anand
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
index 04356bc639fa..3b29169aac43 100644
--- a/arch/arm/boot/dts/meson8b-odroidc1.dts
+++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
@@ -185,6 +185,33 @@  vdd_rtc: regulator-vdd-rtc {
 
 		vin-supply = <&vcc_3v3>;
 	};
+
+	usb_otg_pwr: regulator-usb-pwrs {
+		compatible = "regulator-fixed";
+		regulator-name = "USB_OTG_PWR";
+
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+
+		/* signal name from schematics: PWREN */
+		gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		vin-supply = <&p5v0>;
+	};
+
+	usb {
+		dr_mode = "host";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		hub@1 {
+			/* Genesys Logic GL852G-OHG usb hub */
+			compatible = "genesys,usb5e3,610";
+			reg = <1>;
+			vdd-supply = <&usb_otg_pwr>;
+			reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
+		};
+	};
 };
 
 &cpu0 {
@@ -281,19 +308,6 @@  &gpio_ao {
 			  "J7 Header Pin 6", "J7 Header Pin 5",
 			  "J7 Header Pin 7", "HDMI_CEC",
 			  "SYS_LED", "", "";
-
-	/*
-	 * WARNING: The USB Hub on the Odroid-C1/C1+ needs a reset signal
-	 * to be turned high in order to be detected by the USB Controller.
-	 * This signal should be handled by a USB specific power sequence
-	 * in order to reset the Hub when USB bus is powered down.
-	 */
-	usb-hub {
-		gpio-hog;
-		gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
-		output-high;
-		line-name = "usb-hub-reset";
-	};
 };
 
 &ir_receiver {