diff options
Diffstat (limited to 'arch/arm/mach-omap2/usb-host.c')
-rw-r--r-- | arch/arm/mach-omap2/usb-host.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c index dde8a11f47d5..3c434498e12e 100644 --- a/arch/arm/mach-omap2/usb-host.c +++ b/arch/arm/mach-omap2/usb-host.c | |||
@@ -25,8 +25,6 @@ | |||
25 | 25 | ||
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | 27 | ||
28 | #include <mach/hardware.h> | ||
29 | #include <mach/irqs.h> | ||
30 | #include <plat/usb.h> | 28 | #include <plat/usb.h> |
31 | #include <plat/omap_device.h> | 29 | #include <plat/omap_device.h> |
32 | 30 | ||
@@ -35,10 +33,12 @@ | |||
35 | #ifdef CONFIG_MFD_OMAP_USB_HOST | 33 | #ifdef CONFIG_MFD_OMAP_USB_HOST |
36 | 34 | ||
37 | #define OMAP_USBHS_DEVICE "usbhs_omap" | 35 | #define OMAP_USBHS_DEVICE "usbhs_omap" |
36 | #define OMAP_USBTLL_DEVICE "usbhs_tll" | ||
38 | #define USBHS_UHH_HWMODNAME "usb_host_hs" | 37 | #define USBHS_UHH_HWMODNAME "usb_host_hs" |
39 | #define USBHS_TLL_HWMODNAME "usb_tll_hs" | 38 | #define USBHS_TLL_HWMODNAME "usb_tll_hs" |
40 | 39 | ||
41 | static struct usbhs_omap_platform_data usbhs_data; | 40 | static struct usbhs_omap_platform_data usbhs_data; |
41 | static struct usbtll_omap_platform_data usbtll_data; | ||
42 | static struct ehci_hcd_omap_platform_data ehci_data; | 42 | static struct ehci_hcd_omap_platform_data ehci_data; |
43 | static struct ohci_hcd_omap_platform_data ohci_data; | 43 | static struct ohci_hcd_omap_platform_data ohci_data; |
44 | 44 | ||
@@ -487,13 +487,14 @@ void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) | |||
487 | 487 | ||
488 | void __init usbhs_init(const struct usbhs_omap_board_data *pdata) | 488 | void __init usbhs_init(const struct usbhs_omap_board_data *pdata) |
489 | { | 489 | { |
490 | struct omap_hwmod *oh[2]; | 490 | struct omap_hwmod *uhh_hwm, *tll_hwm; |
491 | struct platform_device *pdev; | 491 | struct platform_device *pdev; |
492 | int bus_id = -1; | 492 | int bus_id = -1; |
493 | int i; | 493 | int i; |
494 | 494 | ||
495 | for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { | 495 | for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { |
496 | usbhs_data.port_mode[i] = pdata->port_mode[i]; | 496 | usbhs_data.port_mode[i] = pdata->port_mode[i]; |
497 | usbtll_data.port_mode[i] = pdata->port_mode[i]; | ||
497 | ohci_data.port_mode[i] = pdata->port_mode[i]; | 498 | ohci_data.port_mode[i] = pdata->port_mode[i]; |
498 | ehci_data.port_mode[i] = pdata->port_mode[i]; | 499 | ehci_data.port_mode[i] = pdata->port_mode[i]; |
499 | ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i]; | 500 | ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i]; |
@@ -512,25 +513,35 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) | |||
512 | setup_4430ohci_io_mux(pdata->port_mode); | 513 | setup_4430ohci_io_mux(pdata->port_mode); |
513 | } | 514 | } |
514 | 515 | ||
515 | oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); | 516 | uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); |
516 | if (!oh[0]) { | 517 | if (!uhh_hwm) { |
517 | pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); | 518 | pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); |
518 | return; | 519 | return; |
519 | } | 520 | } |
520 | 521 | ||
521 | oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); | 522 | tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); |
522 | if (!oh[1]) { | 523 | if (!tll_hwm) { |
523 | pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); | 524 | pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); |
524 | return; | 525 | return; |
525 | } | 526 | } |
526 | 527 | ||
527 | pdev = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, | 528 | pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm, |
528 | (void *)&usbhs_data, sizeof(usbhs_data), | 529 | &usbtll_data, sizeof(usbtll_data), |
529 | omap_uhhtll_latency, | 530 | omap_uhhtll_latency, |
530 | ARRAY_SIZE(omap_uhhtll_latency), false); | 531 | ARRAY_SIZE(omap_uhhtll_latency), false); |
531 | if (IS_ERR(pdev)) { | 532 | if (IS_ERR(pdev)) { |
532 | pr_err("Could not build hwmod devices %s,%s\n", | 533 | pr_err("Could not build hwmod device %s\n", |
533 | USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME); | 534 | USBHS_TLL_HWMODNAME); |
535 | return; | ||
536 | } | ||
537 | |||
538 | pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm, | ||
539 | &usbhs_data, sizeof(usbhs_data), | ||
540 | omap_uhhtll_latency, | ||
541 | ARRAY_SIZE(omap_uhhtll_latency), false); | ||
542 | if (IS_ERR(pdev)) { | ||
543 | pr_err("Could not build hwmod devices %s\n", | ||
544 | USBHS_UHH_HWMODNAME); | ||
534 | return; | 545 | return; |
535 | } | 546 | } |
536 | } | 547 | } |