From patchwork Thu Feb 12 19:16:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 6899 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1CJGmZ3017818 for ; Thu, 12 Feb 2009 19:17:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756811AbZBLTRE (ORCPT ); Thu, 12 Feb 2009 14:17:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757400AbZBLTRE (ORCPT ); Thu, 12 Feb 2009 14:17:04 -0500 Received: from mho-01-bos.mailhop.org ([63.208.196.178]:59635 "EHLO mho-01-bos.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756811AbZBLTRC (ORCPT ); Thu, 12 Feb 2009 14:17:02 -0500 Received: from c-69-181-40-92.hsd1.ca.comcast.net ([69.181.40.92] helo=[127.0.0.1]) by mho-01-bos.mailhop.org with esmtpa (Exim 4.68) (envelope-from ) id 1LXh3R-000FSL-Iu; Thu, 12 Feb 2009 19:16:57 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 69.181.40.92 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+u6vymxk3FRomltjP47qBE Subject: [PATCH 1/3] musb_hdrc: Set musb_resources dynamically To: linux-omap@vger.kernel.org From: Tony Lindgren Cc: Felipe Balbi , David Brownell Date: Thu, 12 Feb 2009 11:16:55 -0800 Message-ID: <20090212191655.19766.8429.stgit@localhost> In-Reply-To: <20090212191408.19766.62874.stgit@localhost> References: <20090212191408.19766.62874.stgit@localhost> User-Agent: Whatever/0.14.3.285.g62874 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The cpu_is_omap34xx() may not be static. Cc: Felipe Balbi Cc: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/usb-musb.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 5d79f89..897c07d 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c @@ -35,13 +35,7 @@ #ifdef CONFIG_USB_MUSB_SOC static struct resource musb_resources[] = { - [0] = { - .start = cpu_is_omap34xx() - ? OMAP34XX_HSUSB_OTG_BASE - : OMAP243X_HS_BASE, - .end = cpu_is_omap34xx() - ? OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1 - : OMAP243X_HS_BASE + SZ_8K - 1, + [0] = { /* start and end set dynamically */ .flags = IORESOURCE_MEM, }, [1] = { /* general IRQ */ @@ -128,9 +122,7 @@ static struct musb_hdrc_platform_data musb_plat = { #elif defined(CONFIG_USB_GADGET_MUSB_HDRC) .mode = MUSB_PERIPHERAL, #endif - .clock = cpu_is_omap34xx() - ? "hsotgusb_ick" - : "usbhs_ick", + /* .clock is set dynamically */ .set_clock = musb_set_clock, .config = &musb_config, @@ -160,6 +152,17 @@ static struct platform_device musb_device = { void __init usb_musb_init(void) { #ifdef CONFIG_USB_MUSB_SOC + + if (cpu_is_omap243x()) { + musb_resources[0].start = OMAP243X_HS_BASE; + musb_plat.clock = "usbhs_ick"; + } else { + musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; + musb_plat.clock = "hsotgusb_ick"; + } + + musb_resources[0].end = musb_resources[0].start + SZ_8K - 1; + if (platform_device_register(&musb_device) < 0) { printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); return;