RE: [PATCH] ARM: imx25: provide a fixed regulator for usb phys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
> 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@xxxxxxxxxxxxxx>
> ---
> 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





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux