.hsphy_mode = USBPHY_INTERFACE_MODE_UTMIW,
};
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
- dwc3_uboot_handle_interrupt(0);
+ dwc3_uboot_handle_interrupt(dev);
return 0;
}
return rv;
}
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
- dwc3_uboot_handle_interrupt(0);
+ dwc3_uboot_handle_interrupt(dev);
return 0;
}
.index = 0,
};
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
- dwc3_uboot_handle_interrupt(0);
+ dwc3_uboot_handle_interrupt(dev);
return 0;
}
.index = 0,
};
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
- dwc3_uboot_handle_interrupt(index);
+ dwc3_uboot_handle_interrupt(dev);
return 0;
}
.index = 1,
};
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
u32 status;
- status = dwc3_omap_uboot_interrupt_status(index);
+ status = dwc3_omap_uboot_interrupt_status(dev);
if (status)
- dwc3_uboot_handle_interrupt(index);
+ dwc3_uboot_handle_interrupt(dev);
return 0;
}
/**
* dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
- * @index: index of this controller
+ * @dev: device of this controller
*
* Invokes dwc3 gadget interrupts.
*
* Generally called from board file.
*/
-void dwc3_uboot_handle_interrupt(int index)
+void dwc3_uboot_handle_interrupt(struct udevice *dev)
{
struct dwc3 *dwc = NULL;
list_for_each_entry(dwc, &dwc3_list, list) {
- if (dwc->index != index)
+ if (dwc->dev != dev)
continue;
dwc3_gadget_uboot_handle_interrupt(dwc);
#define USBOTGSS_UTMI_OTG_STATUS_VBUSVALID (1 << 1)
struct dwc3_omap {
- struct device *dev;
+ struct udevice *dev;
void __iomem *base;
/**
* dwc3_omap_uboot_interrupt_status - check the status of interrupt
- * @index: index of this controller
+ * @dev: device of this controller
*
* Checks the status of interrupts and returns true if an interrupt
* is detected or false otherwise.
*
* Generally called from board file.
*/
-int dwc3_omap_uboot_interrupt_status(int index)
+int dwc3_omap_uboot_interrupt_status(struct udevice *dev)
{
struct dwc3_omap *omap = NULL;
list_for_each_entry(omap, &dwc3_omap_list, list)
- if (omap->index == index)
+ if (omap->dev == dev)
return dwc3_omap_interrupt(-1, omap);
return 0;
};
#endif
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
struct at91_udc *udc = controller;
},
};
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
struct usba_udc *udc = &controller;
return usba_udc_irq(udc);
}
-
int usb_gadget_register_driver(struct usb_gadget_driver *driver)
{
struct usba_udc *udc = &controller;
}
}
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
- u32 value;
struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor;
+ u32 value;
value = readl(&udc->usbsts);
if (value)
return 0;
}
-#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
-
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
return dwc2_udc_handle_interrupt();
}
-#else /* CONFIG_IS_ENABLED(DM_USB_GADGET) */
-
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
struct dwc2_priv_data {
struct clk_bulk clks;
struct reset_ctl_bulk resets;
struct udevice *usb33d_supply;
};
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
- return dwc2_udc_handle_interrupt();
-}
-
static int dwc2_phy_setup(struct udevice *dev, struct phy_bulk *phys)
{
int ret;
return -ENOSYS;
#endif
}
-
-int usb_gadget_handle_interrupts(int index)
-{
- struct udevice *udc;
- int ret;
-
- ret = udc_device_get_by_index(index, &udc);
- if (ret)
- return ret;
-
- return dm_usb_gadget_handle_interrupts(udc);
-}
#else
/* Backwards hardware compatibility -- switch to DM_USB_GADGET */
static int legacy_index;
return 0;
}
#else
-int usb_gadget_handle_interrupts(int index)
-{
- return 0;
-}
-
int usb_gadget_register_driver(struct usb_gadget_driver *driver)
{
struct sandbox_udc *dev = this_controller;
#if defined(CONFIG_USB_MUSB_GADGET) && !CONFIG_IS_ENABLED(DM_USB_GADGET)
static struct musb *gadget;
-int usb_gadget_handle_interrupts(int index)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
schedule();
if (!gadget || !gadget->isr)
int dwc3_omap_uboot_init(struct dwc3_omap_device *dev);
void dwc3_omap_uboot_exit(int index);
-int dwc3_omap_uboot_interrupt_status(int index);
+int dwc3_omap_uboot_interrupt_status(struct udevice *dev);
#endif /* __DWC3_OMAP_UBOOT_H_ */
int dwc3_uboot_init(struct dwc3_device *dev);
void dwc3_uboot_exit(int index);
-void dwc3_uboot_handle_interrupt(int index);
+void dwc3_uboot_handle_interrupt(struct udevice *dev);
struct phy;
#if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
extern void usb_ep_autoconfig_reset(struct usb_gadget *);
-extern int usb_gadget_handle_interrupts(int index);
+extern int dm_usb_gadget_handle_interrupts(struct udevice *);
/**
* udc_device_get_by_index() - Get UDC udevice by index