]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gadget: musb: Convert interrupt handling to usb_gadget_generic_ops
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Fri, 14 Jun 2024 00:51:23 +0000 (02:51 +0200)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Fri, 5 Jul 2024 12:08:42 +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-9-marek.vasut+renesas@mailbox.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
drivers/usb/musb-new/ti-musb.c

index 76e8b88369e31d9d02fb37b63a395e5c042bbb31..ec1baa9337d0cdc8291d5b293391efdab647f07a 100644 (file)
@@ -233,15 +233,6 @@ static int ti_musb_peripheral_of_to_plat(struct udevice *dev)
 }
 #endif
 
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-       struct ti_musb_peripheral *priv = dev_get_priv(dev);
-
-       priv->periph->isr(0, priv->periph);
-
-       return 0;
-}
-
 static int ti_musb_peripheral_probe(struct udevice *dev)
 {
        struct ti_musb_peripheral *priv = dev_get_priv(dev);
@@ -269,12 +260,26 @@ static int ti_musb_peripheral_remove(struct udevice *dev)
        return 0;
 }
 
+static int ti_musb_gadget_handle_interrupts(struct udevice *dev)
+{
+       struct ti_musb_peripheral *priv = dev_get_priv(dev);
+
+       priv->periph->isr(0, priv->periph);
+
+       return 0;
+}
+
+static const struct usb_gadget_generic_ops ti_musb_gadget_ops = {
+       .handle_interrupts      = ti_musb_gadget_handle_interrupts,
+};
+
 U_BOOT_DRIVER(ti_musb_peripheral) = {
        .name   = "ti-musb-peripheral",
        .id     = UCLASS_USB_GADGET_GENERIC,
 #if CONFIG_IS_ENABLED(OF_CONTROL)
        .of_to_plat = ti_musb_peripheral_of_to_plat,
 #endif
+       .ops    = &ti_musb_gadget_ops,
        .probe = ti_musb_peripheral_probe,
        .remove = ti_musb_peripheral_remove,
        .ops    = &musb_usb_ops,