All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo
@ 2021-09-05  0:01 Marek Vasut
  2021-09-05  0:49 ` Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Marek Vasut @ 2021-09-05  0:01 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Marek Vasut, Shawn Guo, Fabio Estevam, NXP Linux Team

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")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
---
 arch/arm/boot/dts/imx53-m53menlo.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/imx53-m53menlo.dts b/arch/arm/boot/dts/imx53-m53menlo.dts
index 48adcfd32cea9..4f88e96d81ddb 100644
--- a/arch/arm/boot/dts/imx53-m53menlo.dts
+++ b/arch/arm/boot/dts/imx53-m53menlo.dts
@@ -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>;
 	};
 };
 
-- 
2.33.0


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo
  2021-09-05  0:01 [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo Marek Vasut
@ 2021-09-05  0:49 ` Fabio Estevam
  2021-09-05  2:57   ` Marek Vasut
  2021-09-05 13:03 ` Fabio Estevam
  2021-09-22  8:14 ` Shawn Guo
  2 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2021-09-05  0:49 UTC (permalink / raw)
  To: Marek Vasut
  Cc: moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Shawn Guo, NXP Linux Team

Hi Marek,

On Sat, Sep 4, 2021 at 9:01 PM Marek Vasut <marex@denx.de> wrote:
>
> 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")
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: NXP Linux Team <linux-imx@nxp.com>
> ---
>  arch/arm/boot/dts/imx53-m53menlo.dts | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx53-m53menlo.dts b/arch/arm/boot/dts/imx53-m53menlo.dts
> index 48adcfd32cea9..4f88e96d81ddb 100644
> --- a/arch/arm/boot/dts/imx53-m53menlo.dts
> +++ b/arch/arm/boot/dts/imx53-m53menlo.dts
> @@ -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
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo
  2021-09-05  0:49 ` Fabio Estevam
@ 2021-09-05  2:57   ` Marek Vasut
  2021-09-05 12:00     ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2021-09-05  2:57 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Shawn Guo, NXP Linux Team

On 9/5/21 2:49 AM, Fabio Estevam wrote:
> Hi Marek,
> 
> On Sat, Sep 4, 2021 at 9:01 PM Marek Vasut <marex@denx.de> wrote:
>>
>> 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")
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Shawn Guo <shawnguo@kernel.org>
>> Cc: Fabio Estevam <festevam@gmail.com>
>> Cc: NXP Linux Team <linux-imx@nxp.com>
>> ---
>>   arch/arm/boot/dts/imx53-m53menlo.dts | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/imx53-m53menlo.dts b/arch/arm/boot/dts/imx53-m53menlo.dts
>> index 48adcfd32cea9..4f88e96d81ddb 100644
>> --- a/arch/arm/boot/dts/imx53-m53menlo.dts
>> +++ b/arch/arm/boot/dts/imx53-m53menlo.dts
>> @@ -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
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo
  2021-09-05  2:57   ` Marek Vasut
@ 2021-09-05 12:00     ` Fabio Estevam
  2021-09-05 14:35       ` Marek Vasut
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2021-09-05 12:00 UTC (permalink / raw)
  To: Marek Vasut
  Cc: moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Shawn Guo, NXP Linux Team

Hi Marek,

On Sat, Sep 4, 2021 at 11:57 PM Marek Vasut <marex@denx.de> wrote:

> 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
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo
  2021-09-05  0:01 [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo Marek Vasut
  2021-09-05  0:49 ` Fabio Estevam
@ 2021-09-05 13:03 ` Fabio Estevam
  2021-09-22  8:14 ` Shawn Guo
  2 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2021-09-05 13:03 UTC (permalink / raw)
  To: Marek Vasut
  Cc: moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Shawn Guo, NXP Linux Team

On Sat, Sep 4, 2021 at 9:01 PM Marek Vasut <marex@denx.de> wrote:
>
> 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")
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: NXP Linux Team <linux-imx@nxp.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo
  2021-09-05 12:00     ` Fabio Estevam
@ 2021-09-05 14:35       ` Marek Vasut
  0 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2021-09-05 14:35 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Shawn Guo, NXP Linux Team

On 9/5/21 2:00 PM, Fabio Estevam wrote:
> Hi Marek,

Hi,

> On Sat, Sep 4, 2021 at 11:57 PM Marek Vasut <marex@denx.de> wrote:
> 
>> 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>.

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

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
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo
  2021-09-05  0:01 [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo Marek Vasut
  2021-09-05  0:49 ` Fabio Estevam
  2021-09-05 13:03 ` Fabio Estevam
@ 2021-09-22  8:14 ` Shawn Guo
  2 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2021-09-22  8:14 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-arm-kernel, Fabio Estevam, NXP Linux Team

On Sun, Sep 05, 2021 at 02:01:37AM +0200, Marek Vasut wrote:
> 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")
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: NXP Linux Team <linux-imx@nxp.com>

Applied, thanks!

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-22  8:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-05  0:01 [PATCH] ARM: dts: imx: Fix USB host power regulator polarity on M53Menlo Marek Vasut
2021-09-05  0:49 ` Fabio Estevam
2021-09-05  2:57   ` Marek Vasut
2021-09-05 12:00     ` Fabio Estevam
2021-09-05 14:35       ` Marek Vasut
2021-09-05 13:03 ` Fabio Estevam
2021-09-22  8:14 ` Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.