Skip to contentSkip to conversation

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

PATCH Superseded Marcel Ziswiler 3 participants 8 messages Sep 20, 2022 – Sep 21, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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.

Marcel Ziswiler (3):
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

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 -
 5 files changed, 18 insertions(+), 8 deletions(-)
Signature · 1 line
2.36.1
#1 lore raw

PATCH 1/4 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.

---

 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 · 1 line
2.36.1
#2 lore raw

PATCH 2/4 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.

---

 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 3/4 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.

---

 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 · 1 line
2.36.1
#4 lore raw

PATCH 4/4 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).

Fixes 0ef1969ea569 ("ARM: dts: imx7-colibri: move aliases, chosen, extcon and gpio-keys")

---

 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 · 1 line
2.36.1
#5 lore raw

Re: [PATCH v1 4/4] arm: dts: imx7-colibri: remove spurious debounce property

+Greg, to get an opinion on the fixes tag.

Quoted 9 lines · 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).

Fixes 0ef1969ea569 ("ARM: dts: imx7-colibri: move aliases, chosen, extcon and gpio-keys")

Hello all,
we did have some (internal) discussion if this patch should have the fixes tag or not.

I do personally think it should not have it and should not be backported to stable tree, since this is not fixing a real bug, it's just a cleanup.

On the other hand the original patch was not correct, and this change is making it right.

What is the general opinion on this topic? What do the stable kernel maintainers would expect?

Documentation/process/stable-kernel-rules.rst is about rules for backporting, it does not really talk about the fixes tag, but today this is used to decide if a patch should be backported or not.

Francesco

#6 lore raw

Re: [PATCH v1 4/4] arm: dts: imx7-colibri: remove spurious debounce property

Quoted 13 lines · Francesco Dolcini

+Greg, to get an opinion on the fixes tag.

Quoted 9 lines · 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).

Fixes 0ef1969ea569 ("ARM: dts: imx7-colibri: move aliases, chosen, extcon and gpio-keys")
Quoted 7 lines

Hello all,
we did have some (internal) discussion if this patch should have the fixes tag or not.

I do personally think it should not have it and should not be backported to stable tree, since this is not fixing a real bug, it's just a cleanup.

If it's not a real bug, why would you have a Fixes: tag on the commit?

Quoted 2 lines

On the other hand the original patch was not correct, and this change is making it right.

Ah, so it is a bugfix.

Quoted 2 lines

What is the general opinion on this topic? What do the stable kernel maintainers would expect?

It's up to you, but what is the problem with it being backported?

Quoted 3 lines

Documentation/process/stable-kernel-rules.rst is about rules for backporting, it does not really talk about the fixes tag, but today this is used to decide if a patch should be backported or not.

We use Fixes: as a signal from maintainers and developers that do not normally use the cc: stable@ as documented to pick up things that look like fixes but someone forgot to ask to be backported.

It's not a guarantee it will be backported, like cc: stable will be, but it is a hint to us that maybe it should be looked at.

thanks,

greg k-h

#7 lore raw

Re: [PATCH v1 4/4] arm: dts: imx7-colibri: remove spurious debounce property

Quoted 22 lines · Greg Kroah-Hartman
Quoted 13 lines · Francesco Dolcini

+Greg, to get an opinion on the fixes tag.

Quoted 9 lines · 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).

Fixes 0ef1969ea569 ("ARM: dts: imx7-colibri: move aliases, chosen, extcon and gpio-keys")
Quoted 7 lines

Hello all,
we did have some (internal) discussion if this patch should have the fixes tag or not.

I do personally think it should not have it and should not be backported to stable tree, since this is not fixing a real bug, it's just a cleanup.

Quoted 6 lines

If it's not a real bug, why would you have a Fixes: tag on the commit?

Quoted 2 lines

On the other hand the original patch was not correct, and this change is making it right.

Ah, so it is a bugfix.

The DTS file should not contain this unknown property, however having this property present does not change the behavior of the code.

It's more like an unused variable kind of error that could trigger a warning in the compiler.

Francesco