This source file includes following definitions.
- isp1760_udc_register
- isp1760_udc_unregister
1
2
3
4
5
6
7
8
9
10
11 #ifndef _ISP1760_UDC_H_
12 #define _ISP1760_UDC_H_
13
14 #include <linux/ioport.h>
15 #include <linux/list.h>
16 #include <linux/spinlock.h>
17 #include <linux/timer.h>
18 #include <linux/usb/gadget.h>
19
20 struct isp1760_device;
21 struct isp1760_udc;
22
23 enum isp1760_ctrl_state {
24 ISP1760_CTRL_SETUP,
25 ISP1760_CTRL_DATA_IN,
26 ISP1760_CTRL_DATA_OUT,
27 ISP1760_CTRL_STATUS,
28 };
29
30 struct isp1760_ep {
31 struct isp1760_udc *udc;
32 struct usb_ep ep;
33
34 struct list_head queue;
35
36 unsigned int addr;
37 unsigned int maxpacket;
38 char name[7];
39
40 const struct usb_endpoint_descriptor *desc;
41
42 bool rx_pending;
43 bool halted;
44 bool wedged;
45 };
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 struct isp1760_udc {
62 #ifdef CONFIG_USB_ISP1761_UDC
63 struct isp1760_device *isp;
64
65 int irq;
66 char *irqname;
67 void __iomem *regs;
68
69 struct usb_gadget_driver *driver;
70 struct usb_gadget gadget;
71
72 spinlock_t lock;
73 struct timer_list vbus_timer;
74
75 struct isp1760_ep ep[15];
76
77 enum isp1760_ctrl_state ep0_state;
78 u8 ep0_dir;
79 u16 ep0_length;
80
81 bool connected;
82
83 unsigned int devstatus;
84 #endif
85 };
86
87 #ifdef CONFIG_USB_ISP1761_UDC
88 int isp1760_udc_register(struct isp1760_device *isp, int irq,
89 unsigned long irqflags);
90 void isp1760_udc_unregister(struct isp1760_device *isp);
91 #else
92 static inline int isp1760_udc_register(struct isp1760_device *isp, int irq,
93 unsigned long irqflags)
94 {
95 return 0;
96 }
97
98 static inline void isp1760_udc_unregister(struct isp1760_device *isp)
99 {
100 }
101 #endif
102
103 #endif