/* SPDX-License-Identifier: GPL-2.0 */ /* * Driver for the NXP ISP1761 device controller * * Copyright 2021 Linaro, Rui Miguel Silva * Copyright 2014 Ideas on Board Oy * * Contacts: * Laurent Pinchart <[email protected]> * Rui Miguel Silva <[email protected]> */ #ifndef _ISP1760_UDC_H_ #define _ISP1760_UDC_H_ #include <linux/ioport.h> #include <linux/list.h> #include <linux/spinlock.h> #include <linux/timer.h> #include <linux/usb/gadget.h> #include "isp1760-regs.h" struct isp1760_device; struct isp1760_udc; enum isp1760_ctrl_state { … }; struct isp1760_ep { … }; /** * struct isp1760_udc - UDC state information * irq: IRQ number * irqname: IRQ name (as passed to request_irq) * regs: regmap for UDC registers * driver: Gadget driver * gadget: Gadget device * lock: Protects driver, vbus_timer, ep, ep0_*, DC_EPINDEX register * ep: Array of endpoints * ep0_state: Control request state for endpoint 0 * ep0_dir: Direction of the current control request * ep0_length: Length of the current control request * connected: Tracks gadget driver bus connection state */ struct isp1760_udc { … }; #ifdef CONFIG_USB_ISP1761_UDC int isp1760_udc_register(struct isp1760_device *isp, int irq, unsigned long irqflags); void isp1760_udc_unregister(struct isp1760_device *isp); #else static inline int isp1760_udc_register(struct isp1760_device *isp, int irq, unsigned long irqflags) { return 0; } static inline void isp1760_udc_unregister(struct isp1760_device *isp) { } #endif #endif