2 * usb-host.c - OMAP USB Host
4 * This file will contain the board specific details for the
5 * Synopsys EHCI/OHCI host controller on OMAP3430 and onwards
7 * Copyright (C) 2007-2011 Texas Instruments
8 * Author: Vikram Pandita <vikram.pandita@ti.com>
9 * Author: Keshava Munegowda <keshava_mgowda@ti.com>
12 * Felipe Balbi <balbi@ti.com>
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
19 #include <linux/types.h>
20 #include <linux/errno.h>
21 #include <linux/delay.h>
22 #include <linux/platform_device.h>
23 #include <linux/slab.h>
24 #include <linux/dma-mapping.h>
29 #include "omap_device.h"
33 #ifdef CONFIG_MFD_OMAP_USB_HOST
35 #define OMAP_USBHS_DEVICE "usbhs_omap"
36 #define OMAP_USBTLL_DEVICE "usbhs_tll"
37 #define USBHS_UHH_HWMODNAME "usb_host_hs"
38 #define USBHS_TLL_HWMODNAME "usb_tll_hs"
40 static struct omap_device_pm_latency omap_uhhtll_latency[] = {
42 .deactivate_func = omap_device_idle_hwmods,
43 .activate_func = omap_device_enable_hwmods,
44 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
48 /* MUX settings for EHCI pins */
50 * setup_ehci_io_mux - initialize IO pad mux for USBHOST
52 static void __init setup_ehci_io_mux(const enum usbhs_omap_port_mode *port_mode)
54 switch (port_mode[0]) {
55 case OMAP_EHCI_PORT_MODE_PHY:
56 omap_mux_init_signal("hsusb1_stp", OMAP_PIN_OUTPUT);
57 omap_mux_init_signal("hsusb1_clk", OMAP_PIN_OUTPUT);
58 omap_mux_init_signal("hsusb1_dir", OMAP_PIN_INPUT_PULLDOWN);
59 omap_mux_init_signal("hsusb1_nxt", OMAP_PIN_INPUT_PULLDOWN);
60 omap_mux_init_signal("hsusb1_data0", OMAP_PIN_INPUT_PULLDOWN);
61 omap_mux_init_signal("hsusb1_data1", OMAP_PIN_INPUT_PULLDOWN);
62 omap_mux_init_signal("hsusb1_data2", OMAP_PIN_INPUT_PULLDOWN);
63 omap_mux_init_signal("hsusb1_data3", OMAP_PIN_INPUT_PULLDOWN);
64 omap_mux_init_signal("hsusb1_data4", OMAP_PIN_INPUT_PULLDOWN);
65 omap_mux_init_signal("hsusb1_data5", OMAP_PIN_INPUT_PULLDOWN);
66 omap_mux_init_signal("hsusb1_data6", OMAP_PIN_INPUT_PULLDOWN);
67 omap_mux_init_signal("hsusb1_data7", OMAP_PIN_INPUT_PULLDOWN);
69 case OMAP_EHCI_PORT_MODE_TLL:
70 omap_mux_init_signal("hsusb1_tll_stp",
71 OMAP_PIN_INPUT_PULLUP);
72 omap_mux_init_signal("hsusb1_tll_clk",
73 OMAP_PIN_INPUT_PULLDOWN);
74 omap_mux_init_signal("hsusb1_tll_dir",
75 OMAP_PIN_INPUT_PULLDOWN);
76 omap_mux_init_signal("hsusb1_tll_nxt",
77 OMAP_PIN_INPUT_PULLDOWN);
78 omap_mux_init_signal("hsusb1_tll_data0",
79 OMAP_PIN_INPUT_PULLDOWN);
80 omap_mux_init_signal("hsusb1_tll_data1",
81 OMAP_PIN_INPUT_PULLDOWN);
82 omap_mux_init_signal("hsusb1_tll_data2",
83 OMAP_PIN_INPUT_PULLDOWN);
84 omap_mux_init_signal("hsusb1_tll_data3",
85 OMAP_PIN_INPUT_PULLDOWN);
86 omap_mux_init_signal("hsusb1_tll_data4",
87 OMAP_PIN_INPUT_PULLDOWN);
88 omap_mux_init_signal("hsusb1_tll_data5",
89 OMAP_PIN_INPUT_PULLDOWN);
90 omap_mux_init_signal("hsusb1_tll_data6",
91 OMAP_PIN_INPUT_PULLDOWN);
92 omap_mux_init_signal("hsusb1_tll_data7",
93 OMAP_PIN_INPUT_PULLDOWN);
95 case OMAP_USBHS_PORT_MODE_UNUSED:
101 switch (port_mode[1]) {
102 case OMAP_EHCI_PORT_MODE_PHY:
103 omap_mux_init_signal("hsusb2_stp", OMAP_PIN_OUTPUT);
104 omap_mux_init_signal("hsusb2_clk", OMAP_PIN_OUTPUT);
105 omap_mux_init_signal("hsusb2_dir", OMAP_PIN_INPUT_PULLDOWN);
106 omap_mux_init_signal("hsusb2_nxt", OMAP_PIN_INPUT_PULLDOWN);
107 omap_mux_init_signal("hsusb2_data0",
108 OMAP_PIN_INPUT_PULLDOWN);
109 omap_mux_init_signal("hsusb2_data1",
110 OMAP_PIN_INPUT_PULLDOWN);
111 omap_mux_init_signal("hsusb2_data2",
112 OMAP_PIN_INPUT_PULLDOWN);
113 omap_mux_init_signal("hsusb2_data3",
114 OMAP_PIN_INPUT_PULLDOWN);
115 omap_mux_init_signal("hsusb2_data4",
116 OMAP_PIN_INPUT_PULLDOWN);
117 omap_mux_init_signal("hsusb2_data5",
118 OMAP_PIN_INPUT_PULLDOWN);
119 omap_mux_init_signal("hsusb2_data6",
120 OMAP_PIN_INPUT_PULLDOWN);
121 omap_mux_init_signal("hsusb2_data7",
122 OMAP_PIN_INPUT_PULLDOWN);
124 case OMAP_EHCI_PORT_MODE_TLL:
125 omap_mux_init_signal("hsusb2_tll_stp",
126 OMAP_PIN_INPUT_PULLUP);
127 omap_mux_init_signal("hsusb2_tll_clk",
128 OMAP_PIN_INPUT_PULLDOWN);
129 omap_mux_init_signal("hsusb2_tll_dir",
130 OMAP_PIN_INPUT_PULLDOWN);
131 omap_mux_init_signal("hsusb2_tll_nxt",
132 OMAP_PIN_INPUT_PULLDOWN);
133 omap_mux_init_signal("hsusb2_tll_data0",
134 OMAP_PIN_INPUT_PULLDOWN);
135 omap_mux_init_signal("hsusb2_tll_data1",
136 OMAP_PIN_INPUT_PULLDOWN);
137 omap_mux_init_signal("hsusb2_tll_data2",
138 OMAP_PIN_INPUT_PULLDOWN);
139 omap_mux_init_signal("hsusb2_tll_data3",
140 OMAP_PIN_INPUT_PULLDOWN);
141 omap_mux_init_signal("hsusb2_tll_data4",
142 OMAP_PIN_INPUT_PULLDOWN);
143 omap_mux_init_signal("hsusb2_tll_data5",
144 OMAP_PIN_INPUT_PULLDOWN);
145 omap_mux_init_signal("hsusb2_tll_data6",
146 OMAP_PIN_INPUT_PULLDOWN);
147 omap_mux_init_signal("hsusb2_tll_data7",
148 OMAP_PIN_INPUT_PULLDOWN);
150 case OMAP_USBHS_PORT_MODE_UNUSED:
156 switch (port_mode[2]) {
157 case OMAP_EHCI_PORT_MODE_PHY:
158 printk(KERN_WARNING "Port3 can't be used in PHY mode\n");
160 case OMAP_EHCI_PORT_MODE_TLL:
161 omap_mux_init_signal("hsusb3_tll_stp",
162 OMAP_PIN_INPUT_PULLUP);
163 omap_mux_init_signal("hsusb3_tll_clk",
164 OMAP_PIN_INPUT_PULLDOWN);
165 omap_mux_init_signal("hsusb3_tll_dir",
166 OMAP_PIN_INPUT_PULLDOWN);
167 omap_mux_init_signal("hsusb3_tll_nxt",
168 OMAP_PIN_INPUT_PULLDOWN);
169 omap_mux_init_signal("hsusb3_tll_data0",
170 OMAP_PIN_INPUT_PULLDOWN);
171 omap_mux_init_signal("hsusb3_tll_data1",
172 OMAP_PIN_INPUT_PULLDOWN);
173 omap_mux_init_signal("hsusb3_tll_data2",
174 OMAP_PIN_INPUT_PULLDOWN);
175 omap_mux_init_signal("hsusb3_tll_data3",
176 OMAP_PIN_INPUT_PULLDOWN);
177 omap_mux_init_signal("hsusb3_tll_data4",
178 OMAP_PIN_INPUT_PULLDOWN);
179 omap_mux_init_signal("hsusb3_tll_data5",
180 OMAP_PIN_INPUT_PULLDOWN);
181 omap_mux_init_signal("hsusb3_tll_data6",
182 OMAP_PIN_INPUT_PULLDOWN);
183 omap_mux_init_signal("hsusb3_tll_data7",
184 OMAP_PIN_INPUT_PULLDOWN);
186 case OMAP_USBHS_PORT_MODE_UNUSED:
196 void __init setup_4430ehci_io_mux(const enum usbhs_omap_port_mode *port_mode)
198 switch (port_mode[0]) {
199 case OMAP_EHCI_PORT_MODE_PHY:
200 omap_mux_init_signal("usbb1_ulpiphy_stp",
202 omap_mux_init_signal("usbb1_ulpiphy_clk",
203 OMAP_PIN_INPUT_PULLDOWN);
204 omap_mux_init_signal("usbb1_ulpiphy_dir",
205 OMAP_PIN_INPUT_PULLDOWN);
206 omap_mux_init_signal("usbb1_ulpiphy_nxt",
207 OMAP_PIN_INPUT_PULLDOWN);
208 omap_mux_init_signal("usbb1_ulpiphy_dat0",
209 OMAP_PIN_INPUT_PULLDOWN);
210 omap_mux_init_signal("usbb1_ulpiphy_dat1",
211 OMAP_PIN_INPUT_PULLDOWN);
212 omap_mux_init_signal("usbb1_ulpiphy_dat2",
213 OMAP_PIN_INPUT_PULLDOWN);
214 omap_mux_init_signal("usbb1_ulpiphy_dat3",
215 OMAP_PIN_INPUT_PULLDOWN);
216 omap_mux_init_signal("usbb1_ulpiphy_dat4",
217 OMAP_PIN_INPUT_PULLDOWN);
218 omap_mux_init_signal("usbb1_ulpiphy_dat5",
219 OMAP_PIN_INPUT_PULLDOWN);
220 omap_mux_init_signal("usbb1_ulpiphy_dat6",
221 OMAP_PIN_INPUT_PULLDOWN);
222 omap_mux_init_signal("usbb1_ulpiphy_dat7",
223 OMAP_PIN_INPUT_PULLDOWN);
225 case OMAP_EHCI_PORT_MODE_TLL:
226 omap_mux_init_signal("usbb1_ulpitll_stp",
227 OMAP_PIN_INPUT_PULLUP);
228 omap_mux_init_signal("usbb1_ulpitll_clk",
229 OMAP_PIN_INPUT_PULLDOWN);
230 omap_mux_init_signal("usbb1_ulpitll_dir",
231 OMAP_PIN_INPUT_PULLDOWN);
232 omap_mux_init_signal("usbb1_ulpitll_nxt",
233 OMAP_PIN_INPUT_PULLDOWN);
234 omap_mux_init_signal("usbb1_ulpitll_dat0",
235 OMAP_PIN_INPUT_PULLDOWN);
236 omap_mux_init_signal("usbb1_ulpitll_dat1",
237 OMAP_PIN_INPUT_PULLDOWN);
238 omap_mux_init_signal("usbb1_ulpitll_dat2",
239 OMAP_PIN_INPUT_PULLDOWN);
240 omap_mux_init_signal("usbb1_ulpitll_dat3",
241 OMAP_PIN_INPUT_PULLDOWN);
242 omap_mux_init_signal("usbb1_ulpitll_dat4",
243 OMAP_PIN_INPUT_PULLDOWN);
244 omap_mux_init_signal("usbb1_ulpitll_dat5",
245 OMAP_PIN_INPUT_PULLDOWN);
246 omap_mux_init_signal("usbb1_ulpitll_dat6",
247 OMAP_PIN_INPUT_PULLDOWN);
248 omap_mux_init_signal("usbb1_ulpitll_dat7",
249 OMAP_PIN_INPUT_PULLDOWN);
251 case OMAP_USBHS_PORT_MODE_UNUSED:
255 switch (port_mode[1]) {
256 case OMAP_EHCI_PORT_MODE_PHY:
257 omap_mux_init_signal("usbb2_ulpiphy_stp",
259 omap_mux_init_signal("usbb2_ulpiphy_clk",
260 OMAP_PIN_INPUT_PULLDOWN);
261 omap_mux_init_signal("usbb2_ulpiphy_dir",
262 OMAP_PIN_INPUT_PULLDOWN);
263 omap_mux_init_signal("usbb2_ulpiphy_nxt",
264 OMAP_PIN_INPUT_PULLDOWN);
265 omap_mux_init_signal("usbb2_ulpiphy_dat0",
266 OMAP_PIN_INPUT_PULLDOWN);
267 omap_mux_init_signal("usbb2_ulpiphy_dat1",
268 OMAP_PIN_INPUT_PULLDOWN);
269 omap_mux_init_signal("usbb2_ulpiphy_dat2",
270 OMAP_PIN_INPUT_PULLDOWN);
271 omap_mux_init_signal("usbb2_ulpiphy_dat3",
272 OMAP_PIN_INPUT_PULLDOWN);
273 omap_mux_init_signal("usbb2_ulpiphy_dat4",
274 OMAP_PIN_INPUT_PULLDOWN);
275 omap_mux_init_signal("usbb2_ulpiphy_dat5",
276 OMAP_PIN_INPUT_PULLDOWN);
277 omap_mux_init_signal("usbb2_ulpiphy_dat6",
278 OMAP_PIN_INPUT_PULLDOWN);
279 omap_mux_init_signal("usbb2_ulpiphy_dat7",
280 OMAP_PIN_INPUT_PULLDOWN);
282 case OMAP_EHCI_PORT_MODE_TLL:
283 omap_mux_init_signal("usbb2_ulpitll_stp",
284 OMAP_PIN_INPUT_PULLUP);
285 omap_mux_init_signal("usbb2_ulpitll_clk",
286 OMAP_PIN_INPUT_PULLDOWN);
287 omap_mux_init_signal("usbb2_ulpitll_dir",
288 OMAP_PIN_INPUT_PULLDOWN);
289 omap_mux_init_signal("usbb2_ulpitll_nxt",
290 OMAP_PIN_INPUT_PULLDOWN);
291 omap_mux_init_signal("usbb2_ulpitll_dat0",
292 OMAP_PIN_INPUT_PULLDOWN);
293 omap_mux_init_signal("usbb2_ulpitll_dat1",
294 OMAP_PIN_INPUT_PULLDOWN);
295 omap_mux_init_signal("usbb2_ulpitll_dat2",
296 OMAP_PIN_INPUT_PULLDOWN);
297 omap_mux_init_signal("usbb2_ulpitll_dat3",
298 OMAP_PIN_INPUT_PULLDOWN);
299 omap_mux_init_signal("usbb2_ulpitll_dat4",
300 OMAP_PIN_INPUT_PULLDOWN);
301 omap_mux_init_signal("usbb2_ulpitll_dat5",
302 OMAP_PIN_INPUT_PULLDOWN);
303 omap_mux_init_signal("usbb2_ulpitll_dat6",
304 OMAP_PIN_INPUT_PULLDOWN);
305 omap_mux_init_signal("usbb2_ulpitll_dat7",
306 OMAP_PIN_INPUT_PULLDOWN);
308 case OMAP_USBHS_PORT_MODE_UNUSED:
314 static void __init setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
316 switch (port_mode[0]) {
317 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
318 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
319 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
320 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
321 omap_mux_init_signal("mm1_rxdp",
322 OMAP_PIN_INPUT_PULLDOWN);
323 omap_mux_init_signal("mm1_rxdm",
324 OMAP_PIN_INPUT_PULLDOWN);
326 case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
327 case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
328 omap_mux_init_signal("mm1_rxrcv",
329 OMAP_PIN_INPUT_PULLDOWN);
331 case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
332 case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
333 omap_mux_init_signal("mm1_txen_n", OMAP_PIN_OUTPUT);
335 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
336 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
337 omap_mux_init_signal("mm1_txse0",
338 OMAP_PIN_INPUT_PULLDOWN);
339 omap_mux_init_signal("mm1_txdat",
340 OMAP_PIN_INPUT_PULLDOWN);
342 case OMAP_USBHS_PORT_MODE_UNUSED:
347 switch (port_mode[1]) {
348 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
349 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
350 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
351 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
352 omap_mux_init_signal("mm2_rxdp",
353 OMAP_PIN_INPUT_PULLDOWN);
354 omap_mux_init_signal("mm2_rxdm",
355 OMAP_PIN_INPUT_PULLDOWN);
357 case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
358 case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
359 omap_mux_init_signal("mm2_rxrcv",
360 OMAP_PIN_INPUT_PULLDOWN);
362 case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
363 case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
364 omap_mux_init_signal("mm2_txen_n", OMAP_PIN_OUTPUT);
366 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
367 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
368 omap_mux_init_signal("mm2_txse0",
369 OMAP_PIN_INPUT_PULLDOWN);
370 omap_mux_init_signal("mm2_txdat",
371 OMAP_PIN_INPUT_PULLDOWN);
373 case OMAP_USBHS_PORT_MODE_UNUSED:
378 switch (port_mode[2]) {
379 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
380 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
381 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
382 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
383 omap_mux_init_signal("mm3_rxdp",
384 OMAP_PIN_INPUT_PULLDOWN);
385 omap_mux_init_signal("mm3_rxdm",
386 OMAP_PIN_INPUT_PULLDOWN);
388 case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
389 case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
390 omap_mux_init_signal("mm3_rxrcv",
391 OMAP_PIN_INPUT_PULLDOWN);
393 case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
394 case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
395 omap_mux_init_signal("mm3_txen_n", OMAP_PIN_OUTPUT);
397 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
398 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
399 omap_mux_init_signal("mm3_txse0",
400 OMAP_PIN_INPUT_PULLDOWN);
401 omap_mux_init_signal("mm3_txdat",
402 OMAP_PIN_INPUT_PULLDOWN);
404 case OMAP_USBHS_PORT_MODE_UNUSED:
412 void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
414 switch (port_mode[0]) {
415 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
416 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
417 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
418 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
419 omap_mux_init_signal("usbb1_mm_rxdp",
420 OMAP_PIN_INPUT_PULLDOWN);
421 omap_mux_init_signal("usbb1_mm_rxdm",
422 OMAP_PIN_INPUT_PULLDOWN);
424 case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
425 case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
426 omap_mux_init_signal("usbb1_mm_rxrcv",
427 OMAP_PIN_INPUT_PULLDOWN);
429 case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
430 case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
431 omap_mux_init_signal("usbb1_mm_txen",
432 OMAP_PIN_INPUT_PULLDOWN);
435 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
436 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
437 omap_mux_init_signal("usbb1_mm_txdat",
438 OMAP_PIN_INPUT_PULLDOWN);
439 omap_mux_init_signal("usbb1_mm_txse0",
440 OMAP_PIN_INPUT_PULLDOWN);
443 case OMAP_USBHS_PORT_MODE_UNUSED:
448 switch (port_mode[1]) {
449 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
450 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
451 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
452 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
453 omap_mux_init_signal("usbb2_mm_rxdp",
454 OMAP_PIN_INPUT_PULLDOWN);
455 omap_mux_init_signal("usbb2_mm_rxdm",
456 OMAP_PIN_INPUT_PULLDOWN);
458 case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
459 case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
460 omap_mux_init_signal("usbb2_mm_rxrcv",
461 OMAP_PIN_INPUT_PULLDOWN);
463 case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
464 case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
465 omap_mux_init_signal("usbb2_mm_txen",
466 OMAP_PIN_INPUT_PULLDOWN);
469 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
470 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
471 omap_mux_init_signal("usbb2_mm_txdat",
472 OMAP_PIN_INPUT_PULLDOWN);
473 omap_mux_init_signal("usbb2_mm_txse0",
474 OMAP_PIN_INPUT_PULLDOWN);
477 case OMAP_USBHS_PORT_MODE_UNUSED:
483 void __init usbhs_init(struct usbhs_omap_platform_data *pdata)
485 struct omap_hwmod *uhh_hwm, *tll_hwm;
486 struct platform_device *pdev;
489 if (cpu_is_omap34xx()) {
490 setup_ehci_io_mux(pdata->port_mode);
491 setup_ohci_io_mux(pdata->port_mode);
493 if (omap_rev() <= OMAP3430_REV_ES2_1)
494 pdata->single_ulpi_bypass = true;
496 } else if (cpu_is_omap44xx()) {
497 setup_4430ehci_io_mux(pdata->port_mode);
498 setup_4430ohci_io_mux(pdata->port_mode);
501 uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
503 pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
507 tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
509 pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
513 pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
514 pdata, sizeof(*pdata),
516 ARRAY_SIZE(omap_uhhtll_latency), false);
518 pr_err("Could not build hwmod device %s\n",
519 USBHS_TLL_HWMODNAME);
523 pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
524 pdata, sizeof(*pdata),
526 ARRAY_SIZE(omap_uhhtll_latency), false);
528 pr_err("Could not build hwmod devices %s\n",
529 USBHS_UHH_HWMODNAME);
536 void __init usbhs_init(struct usbhs_omap_platform_data *pdata)