]> git.baikalelectronics.ru Git - uboot.git/commitdiff
musb-new: omap2430: fix compiling in DM_USB_GADGET config
authorAndreas Kemnade <andreas@kemnade.info>
Mon, 9 Jan 2023 07:13:31 +0000 (08:13 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 18 Jan 2023 17:46:13 +0000 (12:46 -0500)
Add the separate IRQ handling function and change the registration.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
drivers/usb/musb-new/omap2430.c

index 0d1fb03727d51164e90cb0606b1db8e564461013..42e7abddbc2b5eca45676444eabc92a7749dd5fb 100644 (file)
@@ -46,6 +46,15 @@ static inline void omap2430_low_level_init(struct musb *musb)
        musb_writel(musb->mregs, OTG_FORCESTDBY, l);
 }
 
+#ifdef CONFIG_DM_USB_GADGET
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
+{
+       struct musb_host_data *host = dev_get_priv(dev);
+
+       host->host->isr(0, host->host);
+       return 0;
+}
+#endif
 
 static int omap2430_musb_init(struct musb *musb)
 {
@@ -235,6 +244,16 @@ static int omap2430_musb_probe(struct udevice *dev)
                        return -EIO;
 
                return musb_lowlevel_init(host);
+       } else if (CONFIG_IS_ENABLED(DM_USB_GADGET)) {
+               struct musb_host_data *host = dev_get_priv(dev);
+
+               host->host = musb_init_controller(&plat->plat,
+                                                 (struct device *)otg_board_data,
+                                                 plat->base);
+               if (!host->host)
+                       return -EIO;
+
+               return usb_add_gadget_udc((struct device *)otg_board_data, &host->host->g);
        }
 
        musbp = musb_register(&plat->plat, (struct device *)otg_board_data,