[PATCH v1 4/7] usb: ci_udc: Convert driver to DM_USB_GADGET

Yao Zi me at ziyao.cc
Tue Dec 16 11:00:31 CET 2025


On Tue, Dec 16, 2025 at 02:38:36PM +0800, alice.guo at oss.nxp.com wrote:
> From: Sherry Sun <sherry.sun at nxp.com>
> 
> Convert the ci_udc driver to driver model by using the uclass
> UCLASS_USB_GADGET_GENERIC. The clk and power of USB controller and USB
> PHY both are initialized by parsing the device tree nodes.
> 
> If CONFIG_DM_USB_GADGET is defined, we use the ci_udc driver in DM way,
> if it does not defined, we can use ci_udc driver in its original Non-DM
> way.
> 
> Signed-off-by: Sherry Sun <sherry.sun at nxp.com>
> Signed-off-by: Alice Guo <alice.guo at nxp.com>
> Reviewed-by: Ye Li <ye.li at nxp.com>
> ---
>  drivers/usb/gadget/ci_udc.c | 352 +++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 348 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c
> index 4bff75da759..154a3ab7f22 100644
> --- a/drivers/usb/gadget/ci_udc.c
> +++ b/drivers/usb/gadget/ci_udc.c

...

> +static int ci_udc_otg_probe(struct udevice *dev)
> +{
> +	struct ci_udc_priv_data *priv = dev_get_priv(dev);
> +	struct usb_ehci *ehci;
> +	int ret;
> +
> +	ehci = (struct usb_ehci *)devfdt_get_addr(&priv->otgdev);
> +
> +	pinctrl_select_state(&priv->otgdev, "default");

I think device core would take care of pinctrl and set it to "default"
state before probing the driver if possible, is this call to
pinctrl_select_state really necessary? See device_probe() in
drivers/core/device.c.

Regards,
Yao Zi


More information about the U-Boot mailing list