From 2c2d7c2bab0ec6e4cd93db242822a57986680917 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 14 Jun 2024 02:51:21 +0200 Subject: [PATCH] usb: gadget: mtu3: 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-7-marek.vasut+renesas@mailbox.org Signed-off-by: Mattijs Korpershoek --- drivers/usb/mtu3/mtu3_plat.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index ca86b58dfc..f8e14eabfb 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -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), -- 2.39.5