aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/usb-host.c
diff options
context:
space:
mode:
authorKeshava Munegowda <keshava_mgowda@ti.com>2012-07-16 09:31:10 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-09-21 17:40:33 -0400
commit760189b362a5e00ea60477995a1d0a5826a333be (patch)
treee758f491f1a15bf035eafee49136a21d6006ebf1 /arch/arm/mach-omap2/usb-host.c
parent4dc2cceb5a85e8792517ea9b7ba334eaae75a10d (diff)
mfd: omap-usb-host: Remove TLL specific code from USB HS core driver
The TLL specific code such as channels clocks enable/disable, initialization functions are removed from the USBHS core driver. The hwmod of the usb tll is retrieved and omap device build is performed to created the platform device for the usb tll component. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Reviewed-by: Partha Basak <parthab@india.ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'arch/arm/mach-omap2/usb-host.c')
-rw-r--r--arch/arm/mach-omap2/usb-host.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index dde8a11f47d5..b2a2dd7c9b91 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -35,10 +35,12 @@
35#ifdef CONFIG_MFD_OMAP_USB_HOST 35#ifdef CONFIG_MFD_OMAP_USB_HOST
36 36
37#define OMAP_USBHS_DEVICE "usbhs_omap" 37#define OMAP_USBHS_DEVICE "usbhs_omap"
38#define OMAP_USBTLL_DEVICE "usbhs_tll"
38#define USBHS_UHH_HWMODNAME "usb_host_hs" 39#define USBHS_UHH_HWMODNAME "usb_host_hs"
39#define USBHS_TLL_HWMODNAME "usb_tll_hs" 40#define USBHS_TLL_HWMODNAME "usb_tll_hs"
40 41
41static struct usbhs_omap_platform_data usbhs_data; 42static struct usbhs_omap_platform_data usbhs_data;
43static struct usbtll_omap_platform_data usbtll_data;
42static struct ehci_hcd_omap_platform_data ehci_data; 44static struct ehci_hcd_omap_platform_data ehci_data;
43static struct ohci_hcd_omap_platform_data ohci_data; 45static struct ohci_hcd_omap_platform_data ohci_data;
44 46
@@ -487,13 +489,14 @@ void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
487 489
488void __init usbhs_init(const struct usbhs_omap_board_data *pdata) 490void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
489{ 491{
490 struct omap_hwmod *oh[2]; 492 struct omap_hwmod *uhh_hwm, *tll_hwm;
491 struct platform_device *pdev; 493 struct platform_device *pdev;
492 int bus_id = -1; 494 int bus_id = -1;
493 int i; 495 int i;
494 496
495 for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { 497 for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
496 usbhs_data.port_mode[i] = pdata->port_mode[i]; 498 usbhs_data.port_mode[i] = pdata->port_mode[i];
499 usbtll_data.port_mode[i] = pdata->port_mode[i];
497 ohci_data.port_mode[i] = pdata->port_mode[i]; 500 ohci_data.port_mode[i] = pdata->port_mode[i];
498 ehci_data.port_mode[i] = pdata->port_mode[i]; 501 ehci_data.port_mode[i] = pdata->port_mode[i];
499 ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i]; 502 ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
@@ -512,25 +515,35 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
512 setup_4430ohci_io_mux(pdata->port_mode); 515 setup_4430ohci_io_mux(pdata->port_mode);
513 } 516 }
514 517
515 oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); 518 uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
516 if (!oh[0]) { 519 if (!uhh_hwm) {
517 pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); 520 pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
518 return; 521 return;
519 } 522 }
520 523
521 oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); 524 tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
522 if (!oh[1]) { 525 if (!tll_hwm) {
523 pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); 526 pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
524 return; 527 return;
525 } 528 }
526 529
527 pdev = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, 530 pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
528 (void *)&usbhs_data, sizeof(usbhs_data), 531 &usbtll_data, sizeof(usbtll_data),
529 omap_uhhtll_latency, 532 omap_uhhtll_latency,
530 ARRAY_SIZE(omap_uhhtll_latency), false); 533 ARRAY_SIZE(omap_uhhtll_latency), false);
531 if (IS_ERR(pdev)) { 534 if (IS_ERR(pdev)) {
532 pr_err("Could not build hwmod devices %s,%s\n", 535 pr_err("Could not build hwmod device %s\n",
533 USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME); 536 USBHS_TLL_HWMODNAME);
537 return;
538 }
539
540 pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
541 &usbhs_data, sizeof(usbhs_data),
542 omap_uhhtll_latency,
543 ARRAY_SIZE(omap_uhhtll_latency), false);
544 if (IS_ERR(pdev)) {
545 pr_err("Could not build hwmod devices %s\n",
546 USBHS_UHH_HWMODNAME);
534 return; 547 return;
535 } 548 }
536} 549}