[PATCH v1 4/7] usb: ci_udc: Convert driver to DM_USB_GADGET
Marek Vasut
marek.vasut at mailbox.org
Tue Dec 16 12:19:36 CET 2025
On 12/16/25 7:38 AM, 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
> @@ -7,9 +7,17 @@
> * Murray.Jensen at cmst.csiro.au, 27-Jan-01.
> */
>
> +#include <asm/arch/sys_proto.h>
> +#include <asm/arch/clock.h>
> +#include <asm/mach-imx/regs-usbphy.h>
> +#include <clk.h>
> #include <command.h>
> #include <config.h>
> #include <cpu_func.h>
> +#include <dm.h>
> +#include <dm/device_compat.h>
> +#include <dm/pinctrl.h>
> +#include <power-domain.h>
> #include <net.h>
> #include <malloc.h>
> #include <wait_bit.h>
> @@ -22,6 +30,8 @@
> #include <linux/types.h>
> #include <linux/usb/ch9.h>
> #include <linux/usb/gadget.h>
> +#include <linux/usb/otg.h>
> +#include <usb/ehci-ci.h>
> #include <usb/ci_udc.h>
> #include "../host/ehci.h"
> #include "ci_udc.h"
Can we reduce the amount of headers included by this driver ?
[...]
> +#if defined(CONFIG_MX6)
Can we somehow reduce the ifdeffery ? Use if (IS_ENABLED(...)) for example ?
[...]
More information about the U-Boot
mailing list