From: Marek Vasut Date: Fri, 14 Jun 2024 00:51:24 +0000 (+0200) Subject: usb: gadget: ux500: Convert interrupt handling to usb_gadget_generic_ops X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-logo.png?a=commitdiff_plain;h=ac4bf5d48a9e85e79ced3b7195a8599c21c0a16d;p=u-boot.git usb: gadget: ux500: Convert interrupt handling to usb_gadget_generic_ops Implement .handle_interrupts callback as a replacement for deprecated dm_usb_gadget_handle_interrupts() function. The new callback allows for each DM capable USB gadget controller driver to define its own IRQ handling implementation without colliding with other controller drivers. Signed-off-by: Marek Vasut Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek # vim3 Link: https://lore.kernel.org/r/20240614005309.34433-10-marek.vasut+renesas@mailbox.org Signed-off-by: Mattijs Korpershoek --- diff --git a/drivers/usb/musb-new/ux500.c b/drivers/usb/musb-new/ux500.c index 6b4ef3c857..89dd75b7d0 100644 --- a/drivers/usb/musb-new/ux500.c +++ b/drivers/usb/musb-new/ux500.c @@ -91,14 +91,6 @@ static const struct musb_platform_ops ux500_musb_ops = { .disable = ux500_musb_disable, }; -int dm_usb_gadget_handle_interrupts(struct udevice *dev) -{ - struct ux500_glue *glue = dev_get_priv(dev); - - glue->mdata.host->isr(0, glue->mdata.host); - return 0; -} - static int ux500_musb_probe(struct udevice *dev) { #ifdef CONFIG_USB_MUSB_HOST @@ -155,6 +147,19 @@ static int ux500_musb_remove(struct udevice *dev) return 0; } +static int ux500_gadget_handle_interrupts(struct udevice *dev) +{ + struct ux500_glue *glue = dev_get_priv(dev); + + glue->mdata.host->isr(0, glue->mdata.host); + + return 0; +} + +static const struct usb_gadget_generic_ops ux500_gadget_ops = { + .handle_interrupts = ux500_gadget_handle_interrupts, +}; + static const struct udevice_id ux500_musb_ids[] = { { .compatible = "stericsson,db8500-musb" }, { } @@ -168,6 +173,7 @@ U_BOOT_DRIVER(ux500_musb) = { .id = UCLASS_USB_GADGET_GENERIC, #endif .of_match = ux500_musb_ids, + .ops = &ux500_gadget_ops, .probe = ux500_musb_probe, .remove = ux500_musb_remove, #ifdef CONFIG_USB_MUSB_HOST