Skip to contentSkip to conversation

ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo

PATCH Applied Marek Vasut 3 participants 7 messages Sep 5, 2021 – Sep 22, 2021

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

PATCH 1/1 ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo

The MIC2025 switch input signal nEN is active low, describe it as such in the DT. The previous change to this regulator polarity was incorrectly influenced by broken quirks in gpiolib-of.c, which is now long fixed. So fix this regulator polarity setting here once and for all.

Fixes 3c3601cd6a6d3 ("ARM: dts: imx53: Update USB configuration on M53Menlo")
Cc Shawn Guo <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>
---
 arch/arm/boot/dts/imx53-m53menlo.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/boot/dts/imx53-m53menlo.dts +1 -2
index 48adcfd32cea9..4f88e96d81ddb 100644
@@ -77,8 +77,7 @@ reg_usbh1_vbus: regulator-usbh1-vbus {
 		regulator-name = "vbus";
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
-		gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
-		enable-active-high;
+		gpio = <&gpio1 2 0>;
 	};
 };
 
Signature · 7 lines
2.33.0


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

Hi Marek,

Quoted 20 lines · Marek Vasut

The MIC2025 switch input signal nEN is active low, describe it as such in the DT. The previous change to this regulator polarity was incorrectly influenced by broken quirks in gpiolib-of.c, which is now long fixed. So fix this regulator polarity setting here once and for all.

Fixes 3c3601cd6a6d3 ("ARM: dts: imx53: Update USB configuration on M53Menlo")
Cc Shawn Guo <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>
---
 arch/arm/boot/dts/imx53-m53menlo.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/boot/dts/imx53-m53menlo.dts +0 -0
index 48adcfd32cea9..4f88e96d81ddb 100644

arch/arm/boot/dts/imx53-m53menlo.dts reg_usbh1_vbus: regulator-usbh1-vbus { · line 80

Quoted 6 lines
arch/arm/boot/dts/imx53-m53menlo.dts +1 -2
@@ -77,8 +77,7 @@ reg_usbh1_vbus: regulator-usbh1-vbus {
                regulator-name = "vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
+               gpio = <&gpio1 2 0>;

Don't you mean: gpio = <&gpio1 2 GPIO_ACTIVE_LOW> here?

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

#2 lore raw
Quoted 18 lines · Fabio Estevam

Hi Marek,

Quoted 15 lines · Marek Vasut

The MIC2025 switch input signal nEN is active low, describe it as such in the DT. The previous change to this regulator polarity was incorrectly influenced by broken quirks in gpiolib-of.c, which is now long fixed. So fix this regulator polarity setting here once and for all.

Fixes 3c3601cd6a6d3 ("ARM: dts: imx53: Update USB configuration on M53Menlo")
Cc Shawn Guo <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>
---
  arch/arm/boot/dts/imx53-m53menlo.dts | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 13 lines

arch/arm/boot/dts/imx53-m53menlo.dts reg_usbh1_vbus: regulator-usbh1-vbus { · line 80

Quoted 11 lines
arch/arm/boot/dts/imx53-m53menlo.dts +1 -2
index 48adcfd32cea9..4f88e96d81ddb 100644
@@ -77,8 +77,7 @@ reg_usbh1_vbus: regulator-usbh1-vbus {
                 regulator-name = "vbus";
                 regulator-min-microvolt = <5000000>;
                 regulator-max-microvolt = <5000000>;
-               gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
+               gpio = <&gpio1 2 0>;

Don't you mean: gpio = <&gpio1 2 GPIO_ACTIVE_LOW> here?

No, the GPIO flags are ignored by gpiolib-of and the signal is active low. That's why there is that zero, no flags, and no enable-active-high property.

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

reviewer
#3 lore raw

Hi Marek,

Quoted 3 lines · Marek Vasut

No, the GPIO flags are ignored by gpiolib-of and the signal is active low. That's why there is that zero, no flags, and no enable-active-high property.

Yes, correct. The GPIO flag is ignored by "regulator-fixed".

As you removed the 'enable-active-high' property, you turned the regulator to active low as needed.

This is correct.

gpio = <&gpio1 2 0> is the same as gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>

I just suggested gpio = <&gpio1 2 GPIO_ACTIVE_LOW> to make it clearer what is the real polarity.

The GPIO flag is ignored, I know. No issues if you want to keep it as gpio = <&gpio1 2 0>.

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

#4 lore raw
Quoted 1 line · Fabio Estevam

Hi Marek,

Hi,

Quoted 13 lines · Marek Vasut
Quoted 4 lines

No, the GPIO flags are ignored by gpiolib-of and the signal is active low. That's why there is that zero, no flags, and no enable-active-high property.

Yes, correct. The GPIO flag is ignored by "regulator-fixed".

As you removed the 'enable-active-high' property, you turned the regulator to active low as needed.

This is correct.

Quoted 7 lines

gpio = <&gpio1 2 0> is the same as gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>

I just suggested gpio = <&gpio1 2 GPIO_ACTIVE_LOW> to make it clearer what is the real polarity.

The GPIO flag is ignored, I know. No issues if you want to keep it as gpio = <&gpio1 2 0>.

We had the same discussion before around this patch :) [PATCH V6 01/15] ARM: dts: imx6q-dhcom: Add the parallel system bus
Message-ID: <[email protected]>

The 0 is correct as the field is ignored, please keep it.

Any other variants (like GPIO_ACTIVE_LOW = 1) interact badly with
drivers/gpio/gpiolib-of.c of_gpio_flags_quirks()
which is already a total compatibility attempt mess and lead to odd misbehavior of the regulator where the polarity of the GPIO is randomly interpreted as low or high dependent on the kernel version.

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

reviewer Reviewed-by on v1 1/1
#5 lore raw
In reply to Marek Vasut
Quoted 11 lines · Marek Vasut

The MIC2025 switch input signal nEN is active low, describe it as such in the DT. The previous change to this regulator polarity was incorrectly influenced by broken quirks in gpiolib-of.c, which is now long fixed. So fix this regulator polarity setting here once and for all.

Fixes 3c3601cd6a6d3 ("ARM: dts: imx53: Update USB configuration on M53Menlo")
Cc Shawn Guo <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>

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

Applied
#6 lore raw
In reply to Marek Vasut
Quoted 10 lines · Marek Vasut

The MIC2025 switch input signal nEN is active low, describe it as such in the DT. The previous change to this regulator polarity was incorrectly influenced by broken quirks in gpiolib-of.c, which is now long fixed. So fix this regulator polarity setting here once and for all.

Fixes 3c3601cd6a6d3 ("ARM: dts: imx53: Update USB configuration on M53Menlo")
Cc Shawn Guo <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>

Applied, thanks!

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