On 12/16/25 7:38 AM, [email protected] wrote:
From: Sherry Sun <[email protected]>

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 <[email protected]>
Signed-off-by: Alice Guo <[email protected]>
Reviewed-by: Ye Li <[email protected]>
---
  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 @@
   * [email protected], 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 ?

[...]

Reply via email to