[PATCH 2/3] usb: chipidea: imx: add imx_usbmisc_pullup() hook

Peter Chen (CIX) peter.chen at kernel.org
Wed Jun 18 03:36:12 PDT 2025


On 25-06-14 20:56:44, Xu Yang wrote:
> It's used to do other pullup related operations if needs.
> 
> Signed-off-by: Xu Yang <xu.yang_2 at nxp.com>

Acked-by: Peter Chen <peter.chen at kernel.org>

Peter
> ---
>  drivers/usb/chipidea/ci_hdrc_imx.h |  1 +
>  drivers/usb/chipidea/usbmisc_imx.c | 18 ++++++++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.h b/drivers/usb/chipidea/ci_hdrc_imx.h
> index 88b8da79d518..cb95c84d0322 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.h
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.h
> @@ -37,5 +37,6 @@ int imx_usbmisc_hsic_set_connect(struct imx_usbmisc_data *data);
>  int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect);
>  int imx_usbmisc_suspend(struct imx_usbmisc_data *data, bool wakeup);
>  int imx_usbmisc_resume(struct imx_usbmisc_data *data, bool wakeup);
> +int imx_usbmisc_pullup(struct imx_usbmisc_data *data, bool on);
>  
>  #endif /* __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H */
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index 118b9a68496b..9db67d6d0ec4 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -170,6 +170,9 @@ struct usbmisc_ops {
>  	int (*charger_detection)(struct imx_usbmisc_data *data);
>  	/* It's called when system resume from usb power lost */
>  	int (*power_lost_check)(struct imx_usbmisc_data *data);
> +	/* It's called when device controller changed pullup status */
> +	void (*pullup)(struct imx_usbmisc_data *data, bool on);
> +	/* It's called during suspend/resume to save power */
>  	void (*vbus_comparator_on)(struct imx_usbmisc_data *data, bool on);
>  };
>  
> @@ -1225,6 +1228,21 @@ int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect)
>  }
>  EXPORT_SYMBOL_GPL(imx_usbmisc_charger_detection);
>  
> +int imx_usbmisc_pullup(struct imx_usbmisc_data *data, bool on)
> +{
> +	struct imx_usbmisc *usbmisc;
> +
> +	if (!data)
> +		return 0;
> +
> +	usbmisc = dev_get_drvdata(data->dev);
> +	if (usbmisc->ops->pullup)
> +		usbmisc->ops->pullup(data, on);
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(imx_usbmisc_pullup);
> +
>  int imx_usbmisc_suspend(struct imx_usbmisc_data *data, bool wakeup)
>  {
>  	struct imx_usbmisc *usbmisc;
> -- 
> 2.34.1
> 

-- 

Best regards,
Peter



More information about the linux-arm-kernel mailing list