]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gadget: ux500: Convert interrupt handling to usb_gadget_generic_ops
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Fri, 14 Jun 2024 00:51:24 +0000 (02:51 +0200)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Fri, 5 Jul 2024 12:08:45 +0000 (14:08 +0200)
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 <marek.vasut+renesas@mailbox.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3
Link: https://lore.kernel.org/r/20240614005309.34433-10-marek.vasut+renesas@mailbox.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
drivers/usb/musb-new/ux500.c

index 6b4ef3c85782ce2027865c82629b8d17d59083e3..89dd75b7d057bba0739a922c5af0d31ba75cce44 100644 (file)
@@ -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