[PATCH 09/11] usb: gadget: ux500: Convert interrupt handling to usb_gadget_generic_ops

Marek Vasut marek.vasut+renesas at mailbox.org
Fri Jun 14 02:51:24 CEST 2024


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 at mailbox.org>
---
Cc: Alexander Sverdlin <alexander.sverdlin at siemens.com>
Cc: Felipe Balbi <felipe.balbi at linux.intel.com>
Cc: Lukasz Majewski <lukma at denx.de>
Cc: Mattijs Korpershoek <mkorpershoek at baylibre.com>
Cc: Nishanth Menon <nm at ti.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: Thinh Nguyen <Thinh.Nguyen at synopsys.com>
Cc: Tom Rini <trini at konsulko.com>
Cc: u-boot at lists.denx.de
---
 drivers/usb/musb-new/ux500.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/musb-new/ux500.c b/drivers/usb/musb-new/ux500.c
index 6b4ef3c8578..89dd75b7d05 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
-- 
2.43.0



More information about the U-Boot mailing list