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

index ca86b58dfcd72e4f5961ed87f1afa3a9d34ce361..f8e14eabfb2d53cf1d7ee75599617f31b0a86ce6 100644 (file)
@@ -223,15 +223,6 @@ static const struct udevice_id ssusb_of_match[] = {
 };
 
 #if CONFIG_IS_ENABLED(DM_USB_GADGET)
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-       struct mtu3 *mtu = dev_get_priv(dev);
-
-       mtu3_irq(0, mtu);
-
-       return 0;
-}
-
 static int mtu3_gadget_probe(struct udevice *dev)
 {
        struct ssusb_mtk *ssusb = dev_to_ssusb(dev->parent);
@@ -250,10 +241,24 @@ static int mtu3_gadget_remove(struct udevice *dev)
        return 0;
 }
 
+static int mtu3_gadget_handle_interrupts(struct udevice *dev)
+{
+       struct mtu3 *mtu = dev_get_priv(dev);
+
+       mtu3_irq(0, mtu);
+
+       return 0;
+}
+
+static const struct usb_gadget_generic_ops mtu3_gadget_ops = {
+       .handle_interrupts      = mtu3_gadget_handle_interrupts,
+};
+
 U_BOOT_DRIVER(mtu3_peripheral) = {
        .name = "mtu3-peripheral",
        .id = UCLASS_USB_GADGET_GENERIC,
        .of_match = ssusb_of_match,
+       .ops = &mtu3_gadget_ops,
        .probe = mtu3_gadget_probe,
        .remove = mtu3_gadget_remove,
        .priv_auto      = sizeof(struct mtu3),