Skip to contentSkip to conversation

ARM: dts: imx6qdl-wandboard: enable USB OTG

PATCH New Alexander Kurz 3 participants 3 messages Jul 23, 2017 – Jul 26, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: dts: imx6qdl-wandboard: enable USB OTG

Enable USB OTG (dual-role) on the Wandboard.
Note, that the USB_OTG_VBUS current is quite limited due to a 22R resistor in the power line. Hence, the overcurrent signal of 1A will never be triggered on this board.

---
 arch/arm/boot/dts/imx6qdl-wandboard.dtsi | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx6qdl-wandboard.dtsi +18 -1
index b4fa7f1..f1abde8 100644
@@ -34,6 +34,16 @@
 			regulator-max-microvolt = <3300000>;
 			regulator-always-on;
 		};
+
+		reg_usb_otg_vbus: usb_otg_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb_otg_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usbotgvbus>;
+			gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
+		};
 	};
 
 	sound {
@@ -170,6 +180,12 @@
 			>;
 		};
 
+		pinctrl_usbotgvbus: usbotgvbusgrp {
+			fsl,pins = <
+				MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x130b0
+			>;
+		};
+
 		pinctrl_usdhc1: usdhc1grp {
 			fsl,pins = <
 				MX6QDL_PAD_SD1_CMD__SD1_CMD		0x17059
@@ -244,10 +260,11 @@
 };
 
 &usbotg {
+	vbus-supply = <&reg_usb_otg_vbus>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbotg>;
 	disable-over-current;
-	dr_mode = "peripheral";
+	dr_mode = "otg";
 	status = "okay";
 };
 
Signature · 1 line
2.1.4
reviewer
#1 lore raw

PATCH v2 1/1 ARM: dts: imx6qdl-wandboard: enable USB OTG

[Adding Shawn]

Quoted 6 lines · Alexander Kurz

Enable USB OTG (dual-role) on the Wandboard.
Note, that the USB_OTG_VBUS current is quite limited due to a 22R resistor in the power line. Hence, the overcurrent signal of 1A will never be triggered on this board.

Quoted 59 lines
---
 arch/arm/boot/dts/imx6qdl-wandboard.dtsi | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx6qdl-wandboard.dtsi +18 -2
index b4fa7f1..f1abde8 100644
@@ -34,6 +34,16 @@
                        regulator-max-microvolt = <3300000>;
                        regulator-always-on;
                };
+
+               reg_usb_otg_vbus: usb_otg_vbus {
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb_otg_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_usbotgvbus>;
+                       gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
+               };
        };
 
        sound {
@@ -170,6 +180,12 @@
                        >;
                };
 
+               pinctrl_usbotgvbus: usbotgvbusgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D22__GPIO3_IO22          0x130b0
+                       >;
+               };
+
                pinctrl_usdhc1: usdhc1grp {
                        fsl,pins = <
                                MX6QDL_PAD_SD1_CMD__SD1_CMD             0x17059
@@ -244,10 +260,11 @@
 };
 
 &usbotg {
+       vbus-supply = <&reg_usb_otg_vbus>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usbotg>;
        disable-over-current;
-       dr_mode = "peripheral";
+       dr_mode = "otg";
        status = "okay";
 };
 
--

2.1.4

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw

PATCH v2 1/1 ARM: dts: imx6qdl-wandboard: enable USB OTG

In reply to Alexander Kurz
Quoted 7 lines · Alexander Kurz

Enable USB OTG (dual-role) on the Wandboard.
Note, that the USB_OTG_VBUS current is quite limited due to a 22R resistor in the power line. Hence, the overcurrent signal of 1A will never be triggered on this board.

---

When sending a version, it's helpful to have a change log here.

arch/arm/boot/dts/imx6qdl-wandboard.dtsi line 38

Quoted 13 lines
 arch/arm/boot/dts/imx6qdl-wandboard.dtsi | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx6qdl-wandboard.dtsi +2 -0
index b4fa7f1..f1abde8 100644
@@ -34,6 +34,16 @@
 			regulator-max-microvolt = <3300000>;
 			regulator-always-on;
 		};
+
+		reg_usb_otg_vbus: usb_otg_vbus {

You are trying to add a fixed regulator under regulators bus node without sticking to the existing convention. I understand that it's now preferred to put fixed regulator node directly under root node, but mixing two styles is not good either.

I suggest you order a patch to remove regulators bus node and name node like below:

	reg_xxx: regulator-xxx {
		...
	};

And then add your changes on top of that.

Shawn

Quoted 45 lines
arch/arm/boot/dts/imx6qdl-wandboard.dtsi +16 -1
+			compatible = "regulator-fixed";
+			regulator-name = "usb_otg_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usbotgvbus>;
+			gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
+		};
 	};
 
 	sound {
@@ -170,6 +180,12 @@
 			>;
 		};
 
+		pinctrl_usbotgvbus: usbotgvbusgrp {
+			fsl,pins = <
+				MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x130b0
+			>;
+		};
+
 		pinctrl_usdhc1: usdhc1grp {
 			fsl,pins = <
 				MX6QDL_PAD_SD1_CMD__SD1_CMD		0x17059
@@ -244,10 +260,11 @@
 };
 
 &usbotg {
+	vbus-supply = <&reg_usb_otg_vbus>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbotg>;
 	disable-over-current;
-	dr_mode = "peripheral";
+	dr_mode = "otg";
 	status = "okay";
 };
 
Signature · 7 lines
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel