[PATCH 1/3] usb: chipidea: udc: add CI_HDRC_CONTROLLER_PULLUP_EVENT event

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


On 25-06-14 20:56:43, Xu Yang wrote:
> The device controller will send CI_HDRC_CONTROLLER_PULLUP_EVENT event
> when it's going to pullup or pulldown data line.
> 
> Signed-off-by: Xu Yang <xu.yang_2 at nxp.com>

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

Peter
> ---
>  drivers/usb/chipidea/udc.c   | 5 +++++
>  include/linux/usb/chipidea.h | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> index 1a48e6440e6c..64a421ae0f05 100644
> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -1970,6 +1970,11 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
>  		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
>  	else
>  		hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
> +
> +	if (ci->platdata->notify_event) {
> +		_gadget->connected = is_on;
> +		ci->platdata->notify_event(ci, CI_HDRC_CONTROLLER_PULLUP_EVENT);
> +	}
>  	pm_runtime_put_sync(ci->dev);
>  
>  	return 0;
> diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
> index ebdfef124b2b..e17ebeee24e3 100644
> --- a/include/linux/usb/chipidea.h
> +++ b/include/linux/usb/chipidea.h
> @@ -72,6 +72,7 @@ struct ci_hdrc_platform_data {
>  #define CI_HDRC_IMX_HSIC_ACTIVE_EVENT		2
>  #define CI_HDRC_IMX_HSIC_SUSPEND_EVENT		3
>  #define CI_HDRC_CONTROLLER_VBUS_EVENT		4
> +#define CI_HDRC_CONTROLLER_PULLUP_EVENT		5
>  	int	(*notify_event) (struct ci_hdrc *ci, unsigned event);
>  	struct regulator	*reg_vbus;
>  	struct usb_otg_caps	ci_otg_caps;
> -- 
> 2.34.1
> 

-- 

Best regards,
Peter



More information about the linux-arm-kernel mailing list