From 2e4865bc6486988dd5778c1f21c5459aae7a7706 Mon Sep 17 00:00:00 2001 From: Andreas Kemnade Date: Mon, 9 Jan 2023 08:13:31 +0100 Subject: [PATCH] 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 --- drivers/usb/musb-new/omap2430.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c index 0d1fb03727..42e7abddbc 100644 --- a/drivers/usb/musb-new/omap2430.c +++ b/drivers/usb/musb-new/omap2430.c @@ -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, -- 2.39.5