diff mbox

[RFC,4/5] usb: ohci: omap: Initialize resources for OMAP4

Message ID 1282245490-24339-5-git-send-email-keshava_mgowda@ti.com (mailing list archive)
State New, archived
Delegated to: Felipe Balbi
Headers show

Commit Message

Munegowda, Keshava Aug. 19, 2010, 7:18 p.m. UTC
None
diff mbox

Patch

Index: linux-2.6/arch/arm/mach-omap2/usb-ehci.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-omap2/usb-ehci.c
+++ linux-2.6/arch/arm/mach-omap2/usb-ehci.c
@@ -360,22 +360,15 @@  void __init usb_ehci_init(const struct e
 
 static struct resource ohci_resources[] = {
 	{
-		.start	= OMAP34XX_OHCI_BASE,
-		.end	= OMAP34XX_OHCI_BASE + SZ_1K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
 	{
-		.start	= OMAP34XX_UHH_CONFIG_BASE,
-		.end	= OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
 	{
-		.start	= OMAP34XX_USBTLL_BASE,
-		.end	= OMAP34XX_USBTLL_BASE + SZ_4K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
 	{	/* general IRQ */
-		.start	= INT_34XX_OHCI_IRQ,
 		.flags	= IORESOURCE_IRQ,
 	}
 };
@@ -580,8 +573,25 @@  void __init usb_ohci_init(const struct o
 	platform_device_add_data(&ohci_device, pdata, sizeof(*pdata));
 
 	/* Setup Pin IO MUX for OHCI */
-	if (cpu_is_omap34xx())
+	if (cpu_is_omap34xx()) {
+		ohci_resources[0].start	= OMAP34XX_OHCI_BASE;
+		ohci_resources[0].end	= OMAP34XX_OHCI_BASE + SZ_1K - 1;
+		ohci_resources[1].start	= OMAP34XX_UHH_CONFIG_BASE;
+		ohci_resources[1].end	= OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
+		ohci_resources[2].start	= OMAP34XX_USBTLL_BASE;
+		ohci_resources[2].end	= OMAP34XX_USBTLL_BASE + SZ_4K - 1;
+		ohci_resources[3].start = INT_34XX_OHCI_IRQ;
 		setup_ohci_io_mux(pdata->port_mode);
+	} else if (cpu_is_omap44xx()) {
+		ohci_resources[0].start	= OMAP44XX_HSUSB_OHCI_BASE;
+		ohci_resources[0].end	= OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1;
+		ohci_resources[1].start	= OMAP44XX_UHH_CONFIG_BASE;
+		ohci_resources[1].end	= OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1;
+		ohci_resources[2].start	= OMAP44XX_USBTLL_BASE;
+		ohci_resources[2].end	= OMAP44XX_USBTLL_BASE + SZ_4K - 1;
+		ohci_resources[3].start = OMAP44XX_IRQ_OHCI;
+		setup_4430ohci_io_mux(pdata->port_mode);
+	}
 
 	if (platform_device_register(&ohci_device) < 0) {
 		pr_err("Unable to register FS-USB (OHCI) device\n");