aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/usb-host.c
diff options
context:
space:
mode:
authorKeshava Munegowda <keshava_mgowda@ti.com>2011-03-01 09:38:20 -0500
committerFelipe Balbi <balbi@ti.com>2011-03-01 10:02:44 -0500
commit3b68ae73d8afa925807ebaae7eb14e2afd43f5b5 (patch)
tree7f6ad22371bf59725d24edc2cf42429a9b6a4b05 /arch/arm/mach-omap2/usb-host.c
parent9e64bb1e9f0613093b3e34ac5402fcfef0dcc35a (diff)
arm: omap: usb: cleanup ehci and ohci resources and devices
The prototype and defination of functions usb_ehci_init and usb_ohci_init are removed. The ehci and ohci devices are removed since usbhs device contains both ehci and ohci details. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Signed-off-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.c176
1 files changed, 26 insertions, 150 deletions
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index ab0638208748..89ae29847c59 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -33,34 +33,46 @@
33 33
34#ifdef CONFIG_MFD_OMAP_USB_HOST 34#ifdef CONFIG_MFD_OMAP_USB_HOST
35 35
36static struct resource ehci_resources[] = { 36#define OMAP_USBHS_DEVICE "usbhs-omap"
37
38static struct resource usbhs_resources[] = {
39 {
40 .name = "uhh",
41 .flags = IORESOURCE_MEM,
42 },
37 { 43 {
44 .name = "tll",
38 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
39 }, 46 },
40 { 47 {
48 .name = "ehci",
41 .flags = IORESOURCE_MEM, 49 .flags = IORESOURCE_MEM,
42 }, 50 },
43 { 51 {
52 .name = "ehci-irq",
53 .flags = IORESOURCE_IRQ,
54 },
55 {
56 .name = "ohci",
44 .flags = IORESOURCE_MEM, 57 .flags = IORESOURCE_MEM,
45 }, 58 },
46 { /* general IRQ */ 59 {
47 .flags = IORESOURCE_IRQ, 60 .name = "ohci-irq",
61 .flags = IORESOURCE_IRQ,
48 } 62 }
49}; 63};
50 64
51static u64 ehci_dmamask = ~(u32)0; 65static struct platform_device usbhs_device = {
52static struct platform_device ehci_device = { 66 .name = OMAP_USBHS_DEVICE,
53 .name = "ehci-omap", 67 .id = 0,
54 .id = 0, 68 .num_resources = ARRAY_SIZE(usbhs_resources),
55 .dev = { 69 .resource = usbhs_resources,
56 .dma_mask = &ehci_dmamask,
57 .coherent_dma_mask = 0xffffffff,
58 .platform_data = NULL,
59 },
60 .num_resources = ARRAY_SIZE(ehci_resources),
61 .resource = ehci_resources,
62}; 70};
63 71
72static struct usbhs_omap_platform_data usbhs_data;
73static struct ehci_hcd_omap_platform_data ehci_data;
74static struct ohci_hcd_omap_platform_data ohci_data;
75
64/* MUX settings for EHCI pins */ 76/* MUX settings for EHCI pins */
65/* 77/*
66 * setup_ehci_io_mux - initialize IO pad mux for USBHOST 78 * setup_ehci_io_mux - initialize IO pad mux for USBHOST
@@ -326,81 +338,6 @@ static void setup_4430ehci_io_mux(const enum usbhs_omap_port_mode *port_mode)
326 } 338 }
327} 339}
328 340
329void __init usb_ehci_init(const struct usbhs_omap_board_data *pdata)
330{
331 platform_device_add_data(&ehci_device, pdata, sizeof(*pdata));
332
333 /* Setup Pin IO MUX for EHCI */
334 if (cpu_is_omap34xx()) {
335 ehci_resources[0].start = OMAP34XX_EHCI_BASE;
336 ehci_resources[0].end = OMAP34XX_EHCI_BASE + SZ_1K - 1;
337 ehci_resources[1].start = OMAP34XX_UHH_CONFIG_BASE;
338 ehci_resources[1].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
339 ehci_resources[2].start = OMAP34XX_USBTLL_BASE;
340 ehci_resources[2].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1;
341 ehci_resources[3].start = INT_34XX_EHCI_IRQ;
342 setup_ehci_io_mux(pdata->port_mode);
343 } else if (cpu_is_omap44xx()) {
344 ehci_resources[0].start = OMAP44XX_HSUSB_EHCI_BASE;
345 ehci_resources[0].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
346 ehci_resources[1].start = OMAP44XX_UHH_CONFIG_BASE;
347 ehci_resources[1].end = OMAP44XX_UHH_CONFIG_BASE + SZ_2K - 1;
348 ehci_resources[2].start = OMAP44XX_USBTLL_BASE;
349 ehci_resources[2].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1;
350 ehci_resources[3].start = OMAP44XX_IRQ_EHCI;
351 setup_4430ehci_io_mux(pdata->port_mode);
352 }
353
354 ehci_resources[0].name = "ehci";
355 ehci_resources[1].name = "uhh";
356 ehci_resources[2].name = "tll";
357 ehci_resources[3].name = "irq";
358
359 if (platform_device_register(&ehci_device) < 0) {
360 printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
361 return;
362 }
363}
364
365static struct resource ohci_resources[] = {
366 {
367 .name = "ohci",
368 .start = OMAP34XX_OHCI_BASE,
369 .end = OMAP34XX_OHCI_BASE + SZ_1K - 1,
370 .flags = IORESOURCE_MEM,
371 },
372 {
373 .name = "uhh",
374 .start = OMAP34XX_UHH_CONFIG_BASE,
375 .end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1,
376 .flags = IORESOURCE_MEM,
377 },
378 {
379 .name = "tll",
380 .start = OMAP34XX_USBTLL_BASE,
381 .end = OMAP34XX_USBTLL_BASE + SZ_4K - 1,
382 .flags = IORESOURCE_MEM,
383 },
384 { /* general IRQ */
385 .name = "irq",
386 .start = INT_34XX_OHCI_IRQ,
387 .flags = IORESOURCE_IRQ,
388 }
389};
390
391static u64 ohci_dmamask = DMA_BIT_MASK(32);
392
393static struct platform_device ohci_device = {
394 .name = "ohci-omap3",
395 .id = 0,
396 .dev = {
397 .dma_mask = &ohci_dmamask,
398 .coherent_dma_mask = 0xffffffff,
399 },
400 .num_resources = ARRAY_SIZE(ohci_resources),
401 .resource = ohci_resources,
402};
403
404static void setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) 341static void setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
405{ 342{
406 switch (port_mode[0]) { 343 switch (port_mode[0]) {
@@ -569,60 +506,6 @@ static void setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
569 } 506 }
570} 507}
571 508
572void __init usb_ohci_init(const struct usbhs_omap_board_data *pdata)
573{
574 platform_device_add_data(&ohci_device, pdata, sizeof(*pdata));
575
576 /* Setup Pin IO MUX for OHCI */
577 if (cpu_is_omap34xx())
578 setup_ohci_io_mux(pdata->port_mode);
579
580 if (platform_device_register(&ohci_device) < 0) {
581 pr_err("Unable to register FS-USB (OHCI) device\n");
582 return;
583 }
584}
585
586#define OMAP_USBHS_DEVICE "usbhs-omap"
587
588static struct resource usbhs_resources[] = {
589 {
590 .name = "uhh",
591 .flags = IORESOURCE_MEM,
592 },
593 {
594 .name = "tll",
595 .flags = IORESOURCE_MEM,
596 },
597 {
598 .name = "ehci",
599 .flags = IORESOURCE_MEM,
600 },
601 {
602 .name = "ehci-irq",
603 .flags = IORESOURCE_IRQ,
604 },
605 {
606 .name = "ohci",
607 .flags = IORESOURCE_MEM,
608 },
609 {
610 .name = "ohci-irq",
611 .flags = IORESOURCE_IRQ,
612 }
613};
614
615static struct platform_device usbhs_device = {
616 .name = OMAP_USBHS_DEVICE,
617 .id = 0,
618 .num_resources = ARRAY_SIZE(usbhs_resources),
619 .resource = usbhs_resources,
620};
621
622static struct usbhs_omap_platform_data usbhs_data;
623static struct ehci_hcd_omap_platform_data ehci_data;
624static struct ohci_hcd_omap_platform_data ohci_data;
625
626void __init usbhs_init(const struct usbhs_omap_board_data *pdata) 509void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
627{ 510{
628 int i; 511 int i;
@@ -686,13 +569,6 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
686{ 569{
687} 570}
688 571
689void __init usb_ohci_init(const struct usbhs_omap_board_data *pdata)
690{
691}
692
693void __init usb_ehci_init(const struct usbhs_omap_board_data *pdata)
694{
695}
696#endif 572#endif
697 573
698 574