diff mbox

[1/2] ARM: dts: imx6qdl-sabrelite: fix USB PHY reset

Message ID 20170724085005.22101-2-gary.bisson@boundarydevices.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gary Bisson July 24, 2017, 8:50 a.m. UTC
Declared as a regulator since the driver doesn't have a reset-gpios
property for this.

This ensures that the PHY is woken up, not depending on the state the
second stage bootloader leaves the pin.

This is a workaround until a proper mechanism is provided to reset such
devices like the pwrseq library [1] for instance.

[1] https://lkml.org/lkml/2017/2/10/779

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
 arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Fabio Estevam July 24, 2017, 12:49 p.m. UTC | #1
Hi Gary,

On Mon, Jul 24, 2017 at 5:50 AM, Gary Bisson
<gary.bisson@boundarydevices.com> wrote:

> +
> +               reg_usb_h1_vbus: regulator@7 {
> +                       compatible = "regulator-fixed";
> +                       reg = <7>;
> +                       pinctrl-names = "default";
> +                       pinctrl-0 = <&pinctrl_usbh1>;
> +                       regulator-name = "usb_h1_vbus";
> +                       regulator-min-microvolt = <3300000>;
> +                       regulator-max-microvolt = <3300000>;
> +                       gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
> +                       enable-active-high;
> +                       regulator-always-on;

As this regulator is controlled via GPIO I believe you should remove
the ' regulator-always-on' property.

Same applies to 2/2/
Gary Bisson July 24, 2017, 12:52 p.m. UTC | #2
Hi Fabio,

On Mon, Jul 24, 2017 at 2:49 PM, Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Gary,
>
> On Mon, Jul 24, 2017 at 5:50 AM, Gary Bisson
> <gary.bisson@boundarydevices.com> wrote:
>
> > +
> > +               reg_usb_h1_vbus: regulator@7 {
> > +                       compatible = "regulator-fixed";
> > +                       reg = <7>;
> > +                       pinctrl-names = "default";
> > +                       pinctrl-0 = <&pinctrl_usbh1>;
> > +                       regulator-name = "usb_h1_vbus";
> > +                       regulator-min-microvolt = <3300000>;
> > +                       regulator-max-microvolt = <3300000>;
> > +                       gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
> > +                       enable-active-high;
> > +                       regulator-always-on;
>
> As this regulator is controlled via GPIO I believe you should remove
> the ' regulator-always-on' property.
>
> Same applies to 2/2/

Good catch, I'll send a v2 right away.

Thanks,
Gary
diff mbox

Patch

diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
index afe7449c47da..7bd14e23afb8 100644
--- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
@@ -123,6 +123,19 @@ 
 			regulator-max-microvolt = <2800000>;
 			regulator-always-on;
 		};
+
+		reg_usb_h1_vbus: regulator@7 {
+			compatible = "regulator-fixed";
+			reg = <7>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usbh1>;
+			regulator-name = "usb_h1_vbus";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+			regulator-always-on;
+		};
 	};
 
 	mipi_xclk: mipi_xclk {
@@ -610,6 +623,12 @@ 
 			>;
 		};
 
+		pinctrl_usbh1: usbh1grp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_17__GPIO7_IO12		0x030b0
+			>;
+		};
+
 		pinctrl_usbotg: usbotggrp {
 			fsl,pins = <
 				MX6QDL_PAD_GPIO_1__USB_OTG_ID		0x17059
@@ -705,6 +724,7 @@ 
 };
 
 &usbh1 {
+	vbus-supply = <&reg_usb_h1_vbus>;
 	status = "okay";
 };