Skip to contentSkip to conversation

arm: dts: colibri-imx6: usb dual-role switching et. al.

PATCH In review Marcel Ziswiler 2 participants 7 messages Sep 28, 2022 – Oct 24, 2022

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

v2 cover arm: dts: colibri-imx6: usb dual-role switching et. al.

From: Marcel Ziswiler <[email protected]>

This series is an assortment of USB dual-role specific commits as follows:

Introduce USBC_DET GPIO based USB dual-role aka device/host switching.

Move USB VBUS supply from single carrier board to module level device tree. This pin is as per Colibri module family standard.

Specify USBH_PEN GPIO being active-low rather than active-high (cosmetic only).

Remove spurious debounce property from linux,extcon-usb-gpio. That commit is actually for Colibri iMX7.

Changes in v2:
- Dropped fixes tag as this change is rather cosmetic.
- Add new commit also actually enabling CONFIG_EXTCON_USB_GPIO.

Marcel Ziswiler (4):
arm: dts: colibri-imx6: move vbus-supply to module level device tree
arm: dts: colibri-imx6: specify usbh_pen gpio being active-low
arm: dts: imx7-colibri: remove spurious debounce property
ARM: imx_v6_v7_defconfig: Enable USB GPIO extcon support

Philippe Schenker (1):
arm: dts: colibri-imx6: usb dual-role switching

 arch/arm/boot/dts/imx6dl-colibri-aster.dts   |  1 -
 arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts |  1 -
 arch/arm/boot/dts/imx6dl-colibri-iris.dts    |  1 -
 arch/arm/boot/dts/imx6qdl-colibri.dtsi       | 22 ++++++++++++++++----
 arch/arm/boot/dts/imx7-colibri.dtsi          |  1 -
 arch/arm/configs/imx_v6_v7_defconfig         |  1 +
 6 files changed, 19 insertions(+), 8 deletions(-)
Signature · 1 line
2.36.1
#1 lore raw

PATCH v2 1/5 arm: dts: colibri-imx6: usb dual-role switching

From: Philippe Schenker <[email protected]>

Introduce USBC_DET GPIO based USB dual-role aka device/host switching.

While at it re-work pinmux comment adding SODIMM number to the USBC_DET entry.

---

(no changes since v1)

 arch/arm/boot/dts/imx6qdl-colibri.dtsi | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx6qdl-colibri.dtsi +11 -2
index 023e76215064..3e98b5da0cc6 100644
@@ -24,6 +24,13 @@ backlight: backlight {
 		status = "disabled";
 	};
 
+	extcon_usbc_det: usbc-det {
+		compatible = "linux,extcon-usb-gpio";
+		id-gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / USBC_DET */
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_usbc_det>;
+	};
+
 	gpio-keys {
 		compatible = "gpio-keys";
 		pinctrl-names = "default";
@@ -670,9 +677,11 @@ &uart3 {
 	status = "disabled";
 };
 
+/* Colibri USBC */
 &usbotg {
 	disable-over-current;
-	dr_mode = "peripheral";
+	dr_mode = "otg";
+	extcon = <0>, <&extcon_usbc_det>;
 	status = "disabled";
 };
 
@@ -1055,7 +1064,7 @@ MX6QDL_PAD_SD4_CMD__UART3_RX_DATA	0x1b0b1
 
 	pinctrl_usbc_det: usbcdetgrp {
 		fsl,pins = <
-			/* USBC_DET */
+			/* SODIMM 137 / USBC_DET */
 			MX6QDL_PAD_GPIO_17__GPIO7_IO12		0x1b0b0
 			/* USBC_DET_OVERWRITE */
 			MX6QDL_PAD_RGMII_RXC__GPIO6_IO30	0x0f058
Signature · 7 lines
2.36.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH v2 2/5 arm: dts: colibri-imx6: move vbus-supply to module level device tree

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Move USB VBUS supply from single carrier board to module level device tree. This pin is as per Colibri module family standard.

---

(no changes since v1)

 arch/arm/boot/dts/imx6dl-colibri-aster.dts   | 1 -
 arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts | 1 -
 arch/arm/boot/dts/imx6dl-colibri-iris.dts    | 1 -
 arch/arm/boot/dts/imx6qdl-colibri.dtsi       | 9 +++++++--
 4 files changed, 7 insertions(+), 5 deletions(-)
arch/arm/boot/dts/imx6dl-colibri-aster.dts +0 -1
index 74e8a6cd8bed..a28e083f29d5 100644
@@ -99,7 +99,6 @@ &uart3 {
 };
 
 &usbh1 {
-	vbus-supply = <&reg_usb_host_vbus>;
 	status = "okay";
 };
 
arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts +0 -1
index 7272edd85a49..a02981d4a3fc 100644
@@ -111,7 +111,6 @@ &uart3 {
 };
 
 &usbh1 {
-	vbus-supply = <&reg_usb_host_vbus>;
 	status = "okay";
 };
 
arch/arm/boot/dts/imx6dl-colibri-iris.dts +0 -1
index cf77d894f6d7..c5797ff35b71 100644
@@ -138,7 +138,6 @@ &uart3 {
 };
 
 &usbh1 {
-	vbus-supply = <&reg_usb_host_vbus>;
 	status = "okay";
 };
 
arch/arm/boot/dts/imx6qdl-colibri.dtsi +7 -2
index 3e98b5da0cc6..21c5049bda4e 100644
@@ -112,7 +112,7 @@ reg_module_3v3_audio: regulator-module-3v3-audio {
 
 	reg_usb_host_vbus: regulator-usb-host-vbus {
 		compatible = "regulator-fixed";
-		gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>; /* USBH_PEN */
+		gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>; /* SODIMM 129 / USBH_PEN */
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_regulator_usbh_pwr>;
 		regulator-max-microvolt = <5000000>;
@@ -677,6 +677,11 @@ &uart3 {
 	status = "disabled";
 };
 
+/* Colibri USBH */
+&usbh1 {
+	vbus-supply = <&reg_usb_host_vbus>;
+};
+
 /* Colibri USBC */
 &usbotg {
 	disable-over-current;
@@ -995,7 +1000,7 @@ MX6QDL_PAD_SD4_DAT2__PWM4_OUT	0x1b0b1
 
 	pinctrl_regulator_usbh_pwr: gpioregusbhpwrgrp {
 		fsl,pins = <
-			/* USBH_EN */
+			/* SODIMM 129 / USBH_PEN */
 			MX6QDL_PAD_EIM_D31__GPIO3_IO31	0x0f058
 		>;
 	};
Signature · 1 line
2.36.1
#3 lore raw

PATCH v2 3/5 arm: dts: colibri-imx6: specify usbh_pen gpio being active-low

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Specify USBH_PEN GPIO being active-low rather than active-high.

Note that this should not have any functional impact as for fixed regulators the regular GPIO polarity is ignored and a true active-high enable GPIO would need an additional enable-active-high property which is/was not the case here. However, this may be rather confusing which this patch fixes.

---

(no changes since v1)

 arch/arm/boot/dts/imx6qdl-colibri.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx6qdl-colibri.dtsi +1 -1
index 21c5049bda4e..d8f985f297e4 100644
@@ -112,7 +112,7 @@ reg_module_3v3_audio: regulator-module-3v3-audio {
 
 	reg_usb_host_vbus: regulator-usb-host-vbus {
 		compatible = "regulator-fixed";
-		gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>; /* SODIMM 129 / USBH_PEN */
+		gpio = <&gpio3 31 GPIO_ACTIVE_LOW>; /* SODIMM 129 / USBH_PEN */
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_regulator_usbh_pwr>;
 		regulator-max-microvolt = <5000000>;
Signature · 7 lines
2.36.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#4 lore raw

PATCH v2 4/5 arm: dts: imx7-colibri: remove spurious debounce property

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Remove spurious debounce property from linux,extcon-usb-gpio.

Note that debouncing is hard-coded to 20 ms (USB_GPIO_DEBOUNCE_MS define).

---

Changes in v2:
- Dropped fixes tag as this change is rather cosmetic.

 arch/arm/boot/dts/imx7-colibri.dtsi | 1 -
 1 file changed, 1 deletion(-)
arch/arm/boot/dts/imx7-colibri.dtsi +0 -1
index a8c31ee65623..840420f9a1cd 100644
@@ -29,7 +29,6 @@ chosen {
 
 	extcon_usbc_det: usbc-det {
 		compatible = "linux,extcon-usb-gpio";
-		debounce = <25>;
 		id-gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / USBC_DET */
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_usbc_det>;
Signature · 7 lines
2.36.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#5 lore raw

PATCH v2 5/5 ARM: imx_v6_v7_defconfig: Enable USB GPIO extcon support

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Enable USB GPIO extcon support aka CONFIG_EXTCON_USB_GPIO as e.g. used on Colibri iMX6 and Colibri iMX7 for USB device/host role switching.

---

Changes in v2:
- Add new commit also actually enabling CONFIG_EXTCON_USB_GPIO.

 arch/arm/configs/imx_v6_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/imx_v6_v7_defconfig +1 -0
index 01012537a9b9..bd4b132cb049 100644
@@ -397,6 +397,7 @@ CONFIG_CLK_IMX8MN=y
 CONFIG_CLK_IMX8MP=y
 CONFIG_CLK_IMX8MQ=y
 CONFIG_SOC_IMX8M=y
+CONFIG_EXTCON_USB_GPIO=y
 CONFIG_IIO=y
 CONFIG_MMA8452=y
 CONFIG_IMX7D_ADC=y
Signature · 1 line
2.36.1
#6 lore raw
In reply to Marcel Ziswiler
Quoted 21 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This series is an assortment of USB dual-role specific commits as follows:

Introduce USBC_DET GPIO based USB dual-role aka device/host switching.

Move USB VBUS supply from single carrier board to module level device tree. This pin is as per Colibri module family standard.

Specify USBH_PEN GPIO being active-low rather than active-high (cosmetic only).

Remove spurious debounce property from linux,extcon-usb-gpio. That commit is actually for Colibri iMX7.

Changes in v2:
- Dropped fixes tag as this change is rather cosmetic.
- Add new commit also actually enabling CONFIG_EXTCON_USB_GPIO.

Quoted 8 lines

Marcel Ziswiler (4):
arm: dts: colibri-imx6: move vbus-supply to module level device tree
arm: dts: colibri-imx6: specify usbh_pen gpio being active-low
arm: dts: imx7-colibri: remove spurious debounce property
ARM: imx_v6_v7_defconfig: Enable USB GPIO extcon support

Philippe Schenker (1):
arm: dts: colibri-imx6: usb dual-role switching

We idiomatically use prefix 'ARM: dts: ...' for i.MX arm DTS. Fixed them up and applied the series.

Shawn