[U-Boot] [PATCH v2 02/22] usb: ehci-mx6: Make regulator DM_REGULATOR dependent

Peng Fan peng.fan at nxp.com
Tue Jan 29 13:23:58 UTC 2019



> -----Original Message-----
> From: Abel Vesa
> Sent: 2019年1月29日 19:31
> To: Tom Rini <trini at konsulko.com>; Fabio Estevam
> <fabio.estevam at nxp.com>; u-boot at lists.denx.de; dl-uboot-imx
> <uboot-imx at nxp.com>; Peng Fan <peng.fan at nxp.com>
> Cc: Nitin Garg <nitin.garg at nxp.com>; Abel Vesa <abel.vesa at nxp.com>
> Subject: [PATCH v2 02/22] usb: ehci-mx6: Make regulator DM_REGULATOR
> dependent
> 
> Do the regulator related work only if the build has the DM_REGULATOR.
> 
> Signed-off-by: Abel Vesa <abel.vesa at nxp.com>
> ---
>  drivers/usb/host/ehci-mx6.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index
> 1acf08d..9483947 100644
> --- a/drivers/usb/host/ehci-mx6.c
> +++ b/drivers/usb/host/ehci-mx6.c
> @@ -404,6 +404,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
>  	if (ret)
>  		return ret;
> 
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
>  	if (priv->vbus_supply) {
>  		ret = regulator_set_enable(priv->vbus_supply,
>  					   (type == USB_INIT_DEVICE) ?
> @@ -413,6 +414,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
>  			return ret;
>  		}
>  	}
> +#endif
> 
>  	if (type == USB_INIT_DEVICE)
>  		return 0;
> @@ -514,15 +516,17 @@ static int ehci_usb_probe(struct udevice *dev)
>  	priv->portnr = dev->seq;
>  	priv->init_type = type;
> 
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
>  	ret = device_get_supply_regulator(dev, "vbus-supply",
>  					  &priv->vbus_supply);
>  	if (ret)
>  		debug("%s: No vbus supply\n", dev->name);
> -
> +#endif
>  	ret = ehci_mx6_common_init(ehci, priv->portnr);
>  	if (ret)
>  		return ret;
> 
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
>  	if (priv->vbus_supply) {
>  		ret = regulator_set_enable(priv->vbus_supply,
>  					   (type == USB_INIT_DEVICE) ?
> @@ -532,6 +536,7 @@ static int ehci_usb_probe(struct udevice *dev)
>  			return ret;
>  		}
>  	}
> +#endif
> 
>  	if (priv->init_type == USB_INIT_HOST) {
>  		setbits_le32(&ehci->usbmode, CM_HOST);
> --
> 2.7.4

Reviewed-by: Peng Fan <peng.fan at nxp.com>



More information about the U-Boot mailing list