1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef RENESAS_USB_H
20 #define RENESAS_USB_H
21 #include <linux/notifier.h>
22 #include <linux/platform_device.h>
23 #include <linux/usb/ch9.h>
24
25
26
27
28
29
30 enum {
31 USBHS_HOST = 0,
32 USBHS_GADGET,
33 USBHS_MAX,
34 };
35
36
37
38
39
40
41 struct renesas_usbhs_platform_callback {
42
43
44
45
46
47
48
49 int (*hardware_init)(struct platform_device *pdev);
50
51
52
53
54
55
56
57 int (*hardware_exit)(struct platform_device *pdev);
58
59
60
61
62
63
64 int (*power_ctrl)(struct platform_device *pdev,
65 void __iomem *base, int enable);
66
67
68
69
70
71
72 int (*phy_reset)(struct platform_device *pdev);
73
74
75
76
77
78
79 int (*get_id)(struct platform_device *pdev);
80
81
82
83
84 int (*get_vbus)(struct platform_device *pdev);
85
86
87
88
89
90
91 int (*set_vbus)(struct platform_device *pdev, int enable);
92
93
94
95
96
97 int (*notifier)(struct notifier_block *nb, unsigned long event,
98 void *data);
99 };
100
101
102
103
104
105
106
107
108 struct renesas_usbhs_driver_pipe_config {
109 u8 type;
110 u16 bufsize;
111 u8 bufnum;
112 bool double_buf;
113 };
114 #define RENESAS_USBHS_PIPE(_type, _size, _num, _double_buf) { \
115 .type = (_type), \
116 .bufsize = (_size), \
117 .bufnum = (_num), \
118 .double_buf = (_double_buf), \
119 }
120
121 struct renesas_usbhs_driver_param {
122
123
124
125 struct renesas_usbhs_driver_pipe_config *pipe_configs;
126 int pipe_size;
127
128
129
130
131
132
133
134
135 int buswait_bwait;
136
137
138
139
140
141
142 int detection_delay;
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157 int d0_tx_id;
158 int d0_rx_id;
159 int d1_tx_id;
160 int d1_rx_id;
161 int d2_tx_id;
162 int d2_rx_id;
163 int d3_tx_id;
164 int d3_rx_id;
165
166
167
168
169
170
171 int pio_dma_border;
172
173 u32 enable_gpio;
174
175
176
177
178 u32 has_usb_dmac:1;
179 u32 runtime_pwctrl:1;
180 u32 has_cnen:1;
181 u32 cfifo_byte_addr:1;
182 #define USBHS_USB_DMAC_XFER_SIZE 32
183 u32 multi_clks:1;
184 u32 has_new_pipe_configs:1;
185 };
186
187
188
189
190
191
192 struct renesas_usbhs_platform_info {
193
194
195
196
197
198
199 struct renesas_usbhs_platform_callback platform_callback;
200
201
202
203
204
205
206 struct renesas_usbhs_driver_param driver_param;
207 };
208
209
210
211
212 #define renesas_usbhs_get_info(pdev)\
213 ((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data)
214 #endif