All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx25: provide a fixed regulator for usb phys
@ 2019-06-25 10:04 Uwe Kleine-König
  2019-06-25 10:44 ` Sergei Shtylyov
  2019-06-26  2:40 ` Peter Chen
  0 siblings, 2 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2019-06-25 10:04 UTC (permalink / raw)
  To: Shawn Guo, Peter Chen
  Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	devicetree, linux-usb

The usb phys are internal to the SoC and so it their 5V supply. With
this regulator added explicitly the following (harmless) boot messages
go away:

	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator
	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

note I'm an USB noob, so please consider carefully before applying :-)
I also put the regulator near the usbphy node instead of in alphabetic
order. Not sure what is sensible/usual here, too.

Best regards
Uwe

 arch/arm/boot/dts/imx25.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
--- a/arch/arm/boot/dts/imx25.dtsi
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -614,6 +614,11 @@
 		};
 	};
 
+	reg_usb: regulator_usbphy {
+		compatible = "regulator-fixed";
+		regulator-name = "usb-phy supply";
+	};
+
 	usbphy {
 		compatible = "simple-bus";
 		#address-cells = <1>;
@@ -623,12 +630,14 @@
 			reg = <0>;
 			compatible = "usb-nop-xceiv";
 			#phy-cells = <0>;
+			vcc-supply = <&reg_usb>;
 		};
 
 		usbphy1: usb-phy@1 {
 			reg = <1>;
 			compatible = "usb-nop-xceiv";
 			#phy-cells = <0>;
+			vcc-supply = <&reg_usb>;
 		};
 	};
 };
-- 
2.20.1

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

* Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
  2019-06-25 10:04 [PATCH] ARM: imx25: provide a fixed regulator for usb phys Uwe Kleine-König
@ 2019-06-25 10:44 ` Sergei Shtylyov
  2019-06-26  2:40 ` Peter Chen
  1 sibling, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2019-06-25 10:44 UTC (permalink / raw)
  To: Uwe Kleine-König, Shawn Guo, Peter Chen
  Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	devicetree, linux-usb

Hello!

On 25.06.2019 13:04, Uwe Kleine-König wrote:

> The usb phys are internal to the SoC and so it their 5V supply. With

    s/it/is/?

> this regulator added explicitly the following (harmless) boot messages
> go away:
> 
> 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator
> 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> note I'm an USB noob, so please consider carefully before applying :-)
> I also put the regulator near the usbphy node instead of in alphabetic
> order. Not sure what is sensible/usual here, too.
> 
> Best regards
> Uwe
> 
>   arch/arm/boot/dts/imx25.dtsi | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
> --- a/arch/arm/boot/dts/imx25.dtsi
> +++ b/arch/arm/boot/dts/imx25.dtsi
> @@ -614,6 +614,11 @@
>   		};
>   	};
>   
> +	reg_usb: regulator_usbphy {

    Hyphens are preferred to underscores in the prop names.

> +		compatible = "regulator-fixed";
> +		regulator-name = "usb-phy supply";
> +	};
> +
[...]

MBR, Sergei

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

* RE: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
  2019-06-25 10:04 [PATCH] ARM: imx25: provide a fixed regulator for usb phys Uwe Kleine-König
  2019-06-25 10:44 ` Sergei Shtylyov
@ 2019-06-26  2:40 ` Peter Chen
  2019-06-26  5:54     ` Marco Felsch
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Chen @ 2019-06-26  2:40 UTC (permalink / raw)
  To: Uwe Kleine-König, Shawn Guo
  Cc: Pengutronix Kernel Team, Fabio Estevam, dl-linux-imx, devicetree,
	linux-usb

 
> Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> 
> The usb phys are internal to the SoC and so it their 5V supply. With this regulator
> added explicitly the following (harmless) boot messages go away:
> 
> 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not
> found, using dummy regulator
> 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not
> found, using dummy regulator
> 

To eliminate the warning message, I suggest doing below changes, as vcc
supply is not mandatory.

diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index a53b89be5324..01a5ff1a0515 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
                }   
        }   
 
-       nop->vcc = devm_regulator_get(dev, "vcc");
+       nop->vcc = devm_regulator_get_optional(dev, "vcc");
        if (IS_ERR(nop->vcc)) {
                dev_dbg(dev, "Error getting vcc regulator: %ld\n",
                                        PTR_ERR(nop->vcc));

Peter

> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> note I'm an USB noob, so please consider carefully before applying :-) I also put the
> regulator near the usbphy node instead of in alphabetic order. Not sure what is
> sensible/usual here, too.
> 
> Best regards
> Uwe
> 
>  arch/arm/boot/dts/imx25.dtsi | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
> --- a/arch/arm/boot/dts/imx25.dtsi
> +++ b/arch/arm/boot/dts/imx25.dtsi
> @@ -614,6 +614,11 @@
>  		};
>  	};
> 
> +	reg_usb: regulator_usbphy {
> +		compatible = "regulator-fixed";
> +		regulator-name = "usb-phy supply";
> +	};
> +
>  	usbphy {
>  		compatible = "simple-bus";
>  		#address-cells = <1>;
> @@ -623,12 +630,14 @@
>  			reg = <0>;
>  			compatible = "usb-nop-xceiv";
>  			#phy-cells = <0>;
> +			vcc-supply = <&reg_usb>;
>  		};
> 
>  		usbphy1: usb-phy@1 {
>  			reg = <1>;
>  			compatible = "usb-nop-xceiv";
>  			#phy-cells = <0>;
> +			vcc-supply = <&reg_usb>;
>  		};
>  	};
>  };
> --
> 2.20.1


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

* Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
  2019-06-26  2:40 ` Peter Chen
@ 2019-06-26  5:54     ` Marco Felsch
  0 siblings, 0 replies; 11+ messages in thread
From: Marco Felsch @ 2019-06-26  5:54 UTC (permalink / raw)
  To: Peter Chen
  Cc: Uwe Kleine-König, Shawn Guo, devicetree, linux-usb,
	Fabio Estevam, dl-linux-imx, Pengutronix Kernel Team

On 19-06-26 02:40, Peter Chen wrote:
>  
> > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> > 
> > The usb phys are internal to the SoC and so it their 5V supply. With this regulator
> > added explicitly the following (harmless) boot messages go away:
> > 
> > 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not
> > found, using dummy regulator
> > 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not
> > found, using dummy regulator
> > 
> 
> To eliminate the warning message, I suggest doing below changes, as vcc
> supply is not mandatory.
> 
> diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
> index a53b89be5324..01a5ff1a0515 100644
> --- a/drivers/usb/phy/phy-generic.c
> +++ b/drivers/usb/phy/phy-generic.c
> @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
>                 }   
>         }   
>  
> -       nop->vcc = devm_regulator_get(dev, "vcc");
> +       nop->vcc = devm_regulator_get_optional(dev, "vcc");

Is the regulator optional? IMHO this shouldn't be the fix. I think the
right fix is Uwe's approach.

Regards,
  Marco

>         if (IS_ERR(nop->vcc)) {
>                 dev_dbg(dev, "Error getting vcc regulator: %ld\n",
>                                         PTR_ERR(nop->vcc));
> 
> Peter
> 
> > Signed-off-by: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
> > ---
> > Hello,
> > 
> > note I'm an USB noob, so please consider carefully before applying :-) I also put the
> > regulator near the usbphy node instead of in alphabetic order. Not sure what is
> > sensible/usual here, too.
> > 
> > Best regards
> > Uwe
> > 
> >  arch/arm/boot/dts/imx25.dtsi | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
> > --- a/arch/arm/boot/dts/imx25.dtsi
> > +++ b/arch/arm/boot/dts/imx25.dtsi
> > @@ -614,6 +614,11 @@
> >  		};
> >  	};
> > 
> > +	reg_usb: regulator_usbphy {
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "usb-phy supply";
> > +	};
> > +
> >  	usbphy {
> >  		compatible = "simple-bus";
> >  		#address-cells = <1>;
> > @@ -623,12 +630,14 @@
> >  			reg = <0>;
> >  			compatible = "usb-nop-xceiv";
> >  			#phy-cells = <0>;
> > +			vcc-supply = <&reg_usb>;
> >  		};
> > 
> >  		usbphy1: usb-phy@1 {
> >  			reg = <1>;
> >  			compatible = "usb-nop-xceiv";
> >  			#phy-cells = <0>;
> > +			vcc-supply = <&reg_usb>;
> >  		};
> >  	};
> >  };
> > --
> > 2.20.1
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
@ 2019-06-26  5:54     ` Marco Felsch
  0 siblings, 0 replies; 11+ messages in thread
From: Marco Felsch @ 2019-06-26  5:54 UTC (permalink / raw)
  To: Peter Chen
  Cc: Uwe Kleine-König, Shawn Guo, devicetree, linux-usb,
	Fabio Estevam, dl-linux-imx, Pengutronix Kernel Team

On 19-06-26 02:40, Peter Chen wrote:
>  
> > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> > 
> > The usb phys are internal to the SoC and so it their 5V supply. With this regulator
> > added explicitly the following (harmless) boot messages go away:
> > 
> > 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not
> > found, using dummy regulator
> > 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not
> > found, using dummy regulator
> > 
> 
> To eliminate the warning message, I suggest doing below changes, as vcc
> supply is not mandatory.
> 
> diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
> index a53b89be5324..01a5ff1a0515 100644
> --- a/drivers/usb/phy/phy-generic.c
> +++ b/drivers/usb/phy/phy-generic.c
> @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
>                 }   
>         }   
>  
> -       nop->vcc = devm_regulator_get(dev, "vcc");
> +       nop->vcc = devm_regulator_get_optional(dev, "vcc");

Is the regulator optional? IMHO this shouldn't be the fix. I think the
right fix is Uwe's approach.

Regards,
  Marco

>         if (IS_ERR(nop->vcc)) {
>                 dev_dbg(dev, "Error getting vcc regulator: %ld\n",
>                                         PTR_ERR(nop->vcc));
> 
> Peter
> 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> > Hello,
> > 
> > note I'm an USB noob, so please consider carefully before applying :-) I also put the
> > regulator near the usbphy node instead of in alphabetic order. Not sure what is
> > sensible/usual here, too.
> > 
> > Best regards
> > Uwe
> > 
> >  arch/arm/boot/dts/imx25.dtsi | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
> > --- a/arch/arm/boot/dts/imx25.dtsi
> > +++ b/arch/arm/boot/dts/imx25.dtsi
> > @@ -614,6 +614,11 @@
> >  		};
> >  	};
> > 
> > +	reg_usb: regulator_usbphy {
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "usb-phy supply";
> > +	};
> > +
> >  	usbphy {
> >  		compatible = "simple-bus";
> >  		#address-cells = <1>;
> > @@ -623,12 +630,14 @@
> >  			reg = <0>;
> >  			compatible = "usb-nop-xceiv";
> >  			#phy-cells = <0>;
> > +			vcc-supply = <&reg_usb>;
> >  		};
> > 
> >  		usbphy1: usb-phy@1 {
> >  			reg = <1>;
> >  			compatible = "usb-nop-xceiv";
> >  			#phy-cells = <0>;
> > +			vcc-supply = <&reg_usb>;
> >  		};
> >  	};
> >  };
> > --
> > 2.20.1
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* RE: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
  2019-06-26  5:54     ` Marco Felsch
  (?)
@ 2019-06-27  3:15     ` Peter Chen
  2019-07-24 13:09         ` Uwe Kleine-König
  -1 siblings, 1 reply; 11+ messages in thread
From: Peter Chen @ 2019-06-27  3:15 UTC (permalink / raw)
  To: Marco Felsch, felipe.balbi
  Cc: Uwe Kleine-König, Shawn Guo, devicetree, linux-usb,
	Fabio Estevam, dl-linux-imx, Pengutronix Kernel Team

 
> On 19-06-26 02:40, Peter Chen wrote:
> >
> > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> > >
> > > The usb phys are internal to the SoC and so it their 5V supply. With
> > > this regulator added explicitly the following (harmless) boot messages go away:
> > >
> > > 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not
> > > found, using dummy regulator
> > > 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not
> > > found, using dummy regulator
> > >
> >
> > To eliminate the warning message, I suggest doing below changes, as
> > vcc supply is not mandatory.
> >
> > diff --git a/drivers/usb/phy/phy-generic.c
> > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515
> > 100644
> > --- a/drivers/usb/phy/phy-generic.c
> > +++ b/drivers/usb/phy/phy-generic.c
> > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct
> usb_phy_generic *nop,
> >                 }
> >         }
> >
> > -       nop->vcc = devm_regulator_get(dev, "vcc");
> > +       nop->vcc = devm_regulator_get_optional(dev, "vcc");
> 
> Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's
> approach.
> 

Add Felipe.

Some USB PHY's power are from the core system's power (eg, DDR), and some are
fixed at the board and no switch for it. So, it is transparent for software at some cases.

Peter

> Regards,
>   Marco
> 
> >         if (IS_ERR(nop->vcc)) {
> >                 dev_dbg(dev, "Error getting vcc regulator: %ld\n",
> >                                         PTR_ERR(nop->vcc));
> >
> > Peter
> >
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > ---
> > > Hello,
> > >
> > > note I'm an USB noob, so please consider carefully before applying
> > > :-) I also put the regulator near the usbphy node instead of in
> > > alphabetic order. Not sure what is sensible/usual here, too.
> > >
> > > Best regards
> > > Uwe
> > >
> > >  arch/arm/boot/dts/imx25.dtsi | 9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/imx25.dtsi
> > > b/arch/arm/boot/dts/imx25.dtsi
> > > --- a/arch/arm/boot/dts/imx25.dtsi
> > > +++ b/arch/arm/boot/dts/imx25.dtsi
> > > @@ -614,6 +614,11 @@
> > >  		};
> > >  	};
> > >
> > > +	reg_usb: regulator_usbphy {
> > > +		compatible = "regulator-fixed";
> > > +		regulator-name = "usb-phy supply";
> > > +	};
> > > +
> > >  	usbphy {
> > >  		compatible = "simple-bus";
> > >  		#address-cells = <1>;
> > > @@ -623,12 +630,14 @@
> > >  			reg = <0>;
> > >  			compatible = "usb-nop-xceiv";
> > >  			#phy-cells = <0>;
> > > +			vcc-supply = <&reg_usb>;
> > >  		};
> > >
> > >  		usbphy1: usb-phy@1 {
> > >  			reg = <1>;
> > >  			compatible = "usb-nop-xceiv";
> > >  			#phy-cells = <0>;
> > > +			vcc-supply = <&reg_usb>;
> > >  		};
> > >  	};
> > >  };
> > > --
> > > 2.20.1
> >
> 
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 |
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pengutro
> nix.de%2F&amp;data=02%7C01%7Cpeter.chen%40nxp.com%7Cd1a839827b3a49
> 0624f508d6f9fab73f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63
> 6971252538657445&amp;sdata=kfTeGJ99AfS74BqdRAOLVJm52jIFIdNmZXXYPX
> SzAcA%3D&amp;reserved=0  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
  2019-06-27  3:15     ` Peter Chen
@ 2019-07-24 13:09         ` Uwe Kleine-König
  0 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2019-07-24 13:09 UTC (permalink / raw)
  To: Peter Chen, felipe.balbi, Marco Felsch
  Cc: devicetree, Fabio Estevam, linux-usb, dl-linux-imx,
	Pengutronix Kernel Team, Shawn Guo

Hello,

On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote:
>  
> > On 19-06-26 02:40, Peter Chen wrote:
> > >
> > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> > > >
> > > > The usb phys are internal to the SoC and so it their 5V supply. With
> > > > this regulator added explicitly the following (harmless) boot messages go away:
> > > >
> > > > 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator
> > > > 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator
> > > >
> > >
> > > To eliminate the warning message, I suggest doing below changes, as
> > > vcc supply is not mandatory.
> > >
> > > diff --git a/drivers/usb/phy/phy-generic.c
> > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515
> > > 100644
> > > --- a/drivers/usb/phy/phy-generic.c
> > > +++ b/drivers/usb/phy/phy-generic.c
> > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
> > >                 }
> > >         }
> > >
> > > -       nop->vcc = devm_regulator_get(dev, "vcc");
> > > +       nop->vcc = devm_regulator_get_optional(dev, "vcc");
> > 
> > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's
> > approach.
> > 
> 
> Add Felipe.
> 
> Some USB PHY's power are from the core system's power (eg, DDR), and some are
> fixed at the board and no switch for it. So, it is transparent for software at some cases.

It's not clear to me how to proceed. There are two opposing opinions and
I don't know enough about USB on mx25 to judge myself.

Felipe?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K�nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
@ 2019-07-24 13:09         ` Uwe Kleine-König
  0 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2019-07-24 13:09 UTC (permalink / raw)
  To: Peter Chen, felipe.balbi, Marco Felsch
  Cc: devicetree, Fabio Estevam, linux-usb, dl-linux-imx,
	Pengutronix Kernel Team, Shawn Guo

Hello,

On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote:
>  
> > On 19-06-26 02:40, Peter Chen wrote:
> > >
> > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> > > >
> > > > The usb phys are internal to the SoC and so it their 5V supply. With
> > > > this regulator added explicitly the following (harmless) boot messages go away:
> > > >
> > > > 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator
> > > > 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator
> > > >
> > >
> > > To eliminate the warning message, I suggest doing below changes, as
> > > vcc supply is not mandatory.
> > >
> > > diff --git a/drivers/usb/phy/phy-generic.c
> > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515
> > > 100644
> > > --- a/drivers/usb/phy/phy-generic.c
> > > +++ b/drivers/usb/phy/phy-generic.c
> > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
> > >                 }
> > >         }
> > >
> > > -       nop->vcc = devm_regulator_get(dev, "vcc");
> > > +       nop->vcc = devm_regulator_get_optional(dev, "vcc");
> > 
> > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's
> > approach.
> > 
> 
> Add Felipe.
> 
> Some USB PHY's power are from the core system's power (eg, DDR), and some are
> fixed at the board and no switch for it. So, it is transparent for software at some cases.

It's not clear to me how to proceed. There are two opposing opinions and
I don't know enough about USB on mx25 to judge myself.

Felipe?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
  2019-07-24 13:09         ` Uwe Kleine-König
  (?)
@ 2019-09-23 10:28         ` Uwe Kleine-König
  2019-11-15  9:07           ` Uwe Kleine-König
  -1 siblings, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2019-09-23 10:28 UTC (permalink / raw)
  To: Peter Chen, felipe.balbi, Marco Felsch
  Cc: devicetree, Fabio Estevam, linux-usb, dl-linux-imx,
	Pengutronix Kernel Team, Shawn Guo

On Wed, Jul 24, 2019 at 03:09:39PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote:
> >  
> > > On 19-06-26 02:40, Peter Chen wrote:
> > > >
> > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> > > > >
> > > > > The usb phys are internal to the SoC and so it their 5V supply. With
> > > > > this regulator added explicitly the following (harmless) boot messages go away:
> > > > >
> > > > > 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator
> > > > > 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator
> > > > >
> > > >
> > > > To eliminate the warning message, I suggest doing below changes, as
> > > > vcc supply is not mandatory.
> > > >
> > > > diff --git a/drivers/usb/phy/phy-generic.c
> > > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515
> > > > 100644
> > > > --- a/drivers/usb/phy/phy-generic.c
> > > > +++ b/drivers/usb/phy/phy-generic.c
> > > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
> > > >                 }
> > > >         }
> > > >
> > > > -       nop->vcc = devm_regulator_get(dev, "vcc");
> > > > +       nop->vcc = devm_regulator_get_optional(dev, "vcc");
> > > 
> > > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's
> > > approach.
> > > 
> > 
> > Add Felipe.
> > 
> > Some USB PHY's power are from the core system's power (eg, DDR), and some are
> > fixed at the board and no switch for it. So, it is transparent for software at some cases.
> 
> It's not clear to me how to proceed. There are two opposing opinions and
> I don't know enough about USB on mx25 to judge myself.
> 
> Felipe?

This thread is still open in my inbox. Felipe, how can I lure you into
giving your opinion?

My original suggestion can be seen at
https://lore.kernel.org/linux-usb/20190625100412.11815-1-u.kleine-koenig@pengutronix.de/,
Peter's alternative is still in the quotes above. Which is the
right/better one?

Best regards and thanks,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
  2019-09-23 10:28         ` Uwe Kleine-König
@ 2019-11-15  9:07           ` Uwe Kleine-König
  2021-10-21 11:02             ` Uwe Kleine-König
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2019-11-15  9:07 UTC (permalink / raw)
  To: Peter Chen, felipe.balbi, Marco Felsch
  Cc: devicetree, Fabio Estevam, linux-usb, dl-linux-imx,
	Pengutronix Kernel Team, Shawn Guo

Hello,

On Mon, Sep 23, 2019 at 12:28:25PM +0200, Uwe Kleine-König wrote:
> On Wed, Jul 24, 2019 at 03:09:39PM +0200, Uwe Kleine-König wrote:
> > On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote:
> > >  
> > > > On 19-06-26 02:40, Peter Chen wrote:
> > > > >
> > > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> > > > > >
> > > > > > The usb phys are internal to the SoC and so it their 5V supply. With
> > > > > > this regulator added explicitly the following (harmless) boot messages go away:
> > > > > >
> > > > > > 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator
> > > > > > 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator
> > > > > >
> > > > >
> > > > > To eliminate the warning message, I suggest doing below changes, as
> > > > > vcc supply is not mandatory.
> > > > >
> > > > > diff --git a/drivers/usb/phy/phy-generic.c
> > > > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515
> > > > > 100644
> > > > > --- a/drivers/usb/phy/phy-generic.c
> > > > > +++ b/drivers/usb/phy/phy-generic.c
> > > > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
> > > > >                 }
> > > > >         }
> > > > >
> > > > > -       nop->vcc = devm_regulator_get(dev, "vcc");
> > > > > +       nop->vcc = devm_regulator_get_optional(dev, "vcc");
> > > > 
> > > > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's
> > > > approach.
> > > > 
> > > 
> > > Add Felipe.
> > > 
> > > Some USB PHY's power are from the core system's power (eg, DDR), and some are
> > > fixed at the board and no switch for it. So, it is transparent for software at some cases.
> > 
> > It's not clear to me how to proceed. There are two opposing opinions and
> > I don't know enough about USB on mx25 to judge myself.
> > 
> > Felipe?
> 
> This thread is still open in my inbox. Felipe, how can I lure you into
> giving your opinion?
> 
> My original suggestion can be seen at
> https://lore.kernel.org/linux-usb/20190625100412.11815-1-u.kleine-koenig@pengutronix.de/,
> Peter's alternative is still in the quotes above. Which is the
> right/better one?

The stuff said above is still true. I'd like to put this issue on file
with "fixed in mainline", but currently this seems to be a stalemate.
because nobody cares enough :-|

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

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

* Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
  2019-11-15  9:07           ` Uwe Kleine-König
@ 2021-10-21 11:02             ` Uwe Kleine-König
  0 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2021-10-21 11:02 UTC (permalink / raw)
  To: Peter Chen, felipe.balbi
  Cc: devicetree, Fabio Estevam, linux-usb, dl-linux-imx,
	Pengutronix Kernel Team, Shawn Guo

[-- Attachment #1: Type: text/plain, Size: 3178 bytes --]

On Fri, Nov 15, 2019 at 10:07:57AM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> On Mon, Sep 23, 2019 at 12:28:25PM +0200, Uwe Kleine-König wrote:
> > On Wed, Jul 24, 2019 at 03:09:39PM +0200, Uwe Kleine-König wrote:
> > > On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote:
> > > >  
> > > > > On 19-06-26 02:40, Peter Chen wrote:
> > > > > >
> > > > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys
> > > > > > >
> > > > > > > The usb phys are internal to the SoC and so it their 5V supply. With
> > > > > > > this regulator added explicitly the following (harmless) boot messages go away:
> > > > > > >
> > > > > > > 	usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator
> > > > > > > 	usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator
> > > > > > >
> > > > > >
> > > > > > To eliminate the warning message, I suggest doing below changes, as
> > > > > > vcc supply is not mandatory.
> > > > > >
> > > > > > diff --git a/drivers/usb/phy/phy-generic.c
> > > > > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515
> > > > > > 100644
> > > > > > --- a/drivers/usb/phy/phy-generic.c
> > > > > > +++ b/drivers/usb/phy/phy-generic.c
> > > > > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
> > > > > >                 }
> > > > > >         }
> > > > > >
> > > > > > -       nop->vcc = devm_regulator_get(dev, "vcc");
> > > > > > +       nop->vcc = devm_regulator_get_optional(dev, "vcc");
> > > > > 
> > > > > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's
> > > > > approach.
> > > > > 
> > > > 
> > > > Add Felipe.
> > > > 
> > > > Some USB PHY's power are from the core system's power (eg, DDR), and some are
> > > > fixed at the board and no switch for it. So, it is transparent for software at some cases.
> > > 
> > > It's not clear to me how to proceed. There are two opposing opinions and
> > > I don't know enough about USB on mx25 to judge myself.
> > > 
> > > Felipe?
> > 
> > This thread is still open in my inbox. Felipe, how can I lure you into
> > giving your opinion?
> > 
> > My original suggestion can be seen at
> > https://lore.kernel.org/linux-usb/20190625100412.11815-1-u.kleine-koenig@pengutronix.de/,
> > Peter's alternative is still in the quotes above. Which is the
> > right/better one?
> 
> The stuff said above is still true. I'd like to put this issue on file
> with "fixed in mainline", but currently this seems to be a stalemate.
> because nobody cares enough :-|

This topic is on stall since two years now and I still have the patch in
the patch stack for my mx25 boards.

In my eyes my patch is the right one, because no matter how, the usb
phys need some powering, so devm_regulator_get_optional() doesn't seem
to be the right approach.

Would resending the patch help?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-10-21 11:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25 10:04 [PATCH] ARM: imx25: provide a fixed regulator for usb phys Uwe Kleine-König
2019-06-25 10:44 ` Sergei Shtylyov
2019-06-26  2:40 ` Peter Chen
2019-06-26  5:54   ` Marco Felsch
2019-06-26  5:54     ` Marco Felsch
2019-06-27  3:15     ` Peter Chen
2019-07-24 13:09       ` Uwe Kleine-König
2019-07-24 13:09         ` Uwe Kleine-König
2019-09-23 10:28         ` Uwe Kleine-König
2019-11-15  9:07           ` Uwe Kleine-König
2021-10-21 11:02             ` Uwe Kleine-König

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.