musb-new: omap2430: fix compiling in DM_USB_GADGET config
Add the separate IRQ handling function and change the registration.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c
index 0d1fb03..42e7abd 100644
--- a/drivers/usb/musb-new/omap2430.c
+++ b/drivers/usb/musb-new/omap2430.c
@@ -46,6 +46,15 @@
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 @@
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,