diff options
author | Roger Quadros <rogerq@ti.com> | 2013-02-14 03:13:48 -0500 |
---|---|---|
committer | Roger Quadros <rogerq@ti.com> | 2013-02-14 03:13:48 -0500 |
commit | 42973159599086c48c58ad79b9ad0758da6bc256 (patch) | |
tree | 6a33b6bc3ac6a29fc1a0b0f37efd5235d16a3f19 /arch/arm/mach-omap2/usb-host.c | |
parent | 7f07863ec60f7d3dbeec5aff881ea074db3925ed (diff) |
ARM: OMAP: Consolidate OMAP USB-HS platform data (part 3/3)
Let's have a single platform data structure for the OMAP's High-Speed
USB host subsystem instead of having 3 separate ones i.e. one for
board data, one for USB Host (UHH) module and one for USB-TLL module.
This makes the code much simpler and avoids creating multiple copies of
platform data.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/usb-host.c')
-rw-r--r-- | arch/arm/mach-omap2/usb-host.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c index 2e44e8a22884..940aad401279 100644 --- a/arch/arm/mach-omap2/usb-host.c +++ b/arch/arm/mach-omap2/usb-host.c | |||
@@ -37,11 +37,6 @@ | |||
37 | #define USBHS_UHH_HWMODNAME "usb_host_hs" | 37 | #define USBHS_UHH_HWMODNAME "usb_host_hs" |
38 | #define USBHS_TLL_HWMODNAME "usb_tll_hs" | 38 | #define USBHS_TLL_HWMODNAME "usb_tll_hs" |
39 | 39 | ||
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; | ||
43 | static struct ohci_hcd_omap_platform_data ohci_data; | ||
44 | |||
45 | static struct omap_device_pm_latency omap_uhhtll_latency[] = { | 40 | static struct omap_device_pm_latency omap_uhhtll_latency[] = { |
46 | { | 41 | { |
47 | .deactivate_func = omap_device_idle_hwmods, | 42 | .deactivate_func = omap_device_idle_hwmods, |
@@ -485,32 +480,18 @@ void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) | |||
485 | } | 480 | } |
486 | } | 481 | } |
487 | 482 | ||
488 | void __init usbhs_init(const struct usbhs_omap_board_data *pdata) | 483 | void __init usbhs_init(struct usbhs_omap_platform_data *pdata) |
489 | { | 484 | { |
490 | struct omap_hwmod *uhh_hwm, *tll_hwm; | 485 | struct omap_hwmod *uhh_hwm, *tll_hwm; |
491 | struct platform_device *pdev; | 486 | struct platform_device *pdev; |
492 | int bus_id = -1; | 487 | int bus_id = -1; |
493 | int i; | ||
494 | |||
495 | for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { | ||
496 | usbhs_data.port_mode[i] = pdata->port_mode[i]; | ||
497 | usbtll_data.port_mode[i] = pdata->port_mode[i]; | ||
498 | ohci_data.port_mode[i] = pdata->port_mode[i]; | ||
499 | ehci_data.port_mode[i] = pdata->port_mode[i]; | ||
500 | ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i]; | ||
501 | ehci_data.regulator[i] = pdata->regulator[i]; | ||
502 | } | ||
503 | ehci_data.phy_reset = pdata->phy_reset; | ||
504 | ohci_data.es2_compatibility = pdata->es2_compatibility; | ||
505 | usbhs_data.ehci_data = &ehci_data; | ||
506 | usbhs_data.ohci_data = &ohci_data; | ||
507 | 488 | ||
508 | if (cpu_is_omap34xx()) { | 489 | if (cpu_is_omap34xx()) { |
509 | setup_ehci_io_mux(pdata->port_mode); | 490 | setup_ehci_io_mux(pdata->port_mode); |
510 | setup_ohci_io_mux(pdata->port_mode); | 491 | setup_ohci_io_mux(pdata->port_mode); |
511 | 492 | ||
512 | if (omap_rev() <= OMAP3430_REV_ES2_1) | 493 | if (omap_rev() <= OMAP3430_REV_ES2_1) |
513 | usbhs_data.single_ulpi_bypass = true; | 494 | pdata->single_ulpi_bypass = true; |
514 | 495 | ||
515 | } else if (cpu_is_omap44xx()) { | 496 | } else if (cpu_is_omap44xx()) { |
516 | setup_4430ehci_io_mux(pdata->port_mode); | 497 | setup_4430ehci_io_mux(pdata->port_mode); |
@@ -530,7 +511,7 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) | |||
530 | } | 511 | } |
531 | 512 | ||
532 | pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm, | 513 | pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm, |
533 | &usbtll_data, sizeof(usbtll_data), | 514 | pdata, sizeof(*pdata), |
534 | omap_uhhtll_latency, | 515 | omap_uhhtll_latency, |
535 | ARRAY_SIZE(omap_uhhtll_latency), false); | 516 | ARRAY_SIZE(omap_uhhtll_latency), false); |
536 | if (IS_ERR(pdev)) { | 517 | if (IS_ERR(pdev)) { |
@@ -540,7 +521,7 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) | |||
540 | } | 521 | } |
541 | 522 | ||
542 | pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm, | 523 | pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm, |
543 | &usbhs_data, sizeof(usbhs_data), | 524 | pdata, sizeof(*pdata), |
544 | omap_uhhtll_latency, | 525 | omap_uhhtll_latency, |
545 | ARRAY_SIZE(omap_uhhtll_latency), false); | 526 | ARRAY_SIZE(omap_uhhtll_latency), false); |
546 | if (IS_ERR(pdev)) { | 527 | if (IS_ERR(pdev)) { |
@@ -552,7 +533,7 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) | |||
552 | 533 | ||
553 | #else | 534 | #else |
554 | 535 | ||
555 | void __init usbhs_init(const struct usbhs_omap_board_data *pdata) | 536 | void __init usbhs_init(struct usbhs_omap_platform_data *pdata) |
556 | { | 537 | { |
557 | } | 538 | } |
558 | 539 | ||