From patchwork Fri Oct 30 19:49:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 56689 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9UJpE6G016397 for ; Fri, 30 Oct 2009 19:51:14 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9UJo2TF032285 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Oct 2009 14:50:02 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9UJnxn2008665; Fri, 30 Oct 2009 14:50:02 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id A41C580627; Fri, 30 Oct 2009 13:49:59 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 3DEA180626 for ; Fri, 30 Oct 2009 13:49:58 -0600 (CST) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9UJnvkF023504 for ; Fri, 30 Oct 2009 14:49:57 -0500 (CDT) Received: from mail135-va3-R.bigfish.com (mail-va3.bigfish.com [216.32.180.113]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9UJnvKg001172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 30 Oct 2009 14:49:57 -0500 Received: from mail135-va3 (localhost.localdomain [127.0.0.1]) by mail135-va3-R.bigfish.com (Postfix) with ESMTP id C00006987F1 for ; Fri, 30 Oct 2009 19:49:56 +0000 (UTC) X-SpamScore: 10 X-BigFish: vps10(zcb8kzzz1202hzzz2dh6bh259o61h) X-Spam-TCS-SCL: 0:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 206.112.117.35; Service: EHS Received: by mail135-va3 (MessageSwitch) id 1256932191648854_15974; Fri, 30 Oct 2009 19:49:51 +0000 (UCT) Received: from VA3EHSMHS013.bigfish.com (unknown [10.7.14.250]) by mail135-va3.bigfish.com (Postfix) with ESMTP id BE8A115B805D for ; Fri, 30 Oct 2009 19:49:50 +0000 (UTC) Received: from imap.sh.mvista.com (206.112.117.35) by VA3EHSMHS013.bigfish.com (10.7.99.23) with Microsoft SMTP Server id 14.0.482.32; Fri, 30 Oct 2009 19:49:50 +0000 Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9]) by imap.sh.mvista.com (Postfix) with SMTP id 4A0FF3EFD; Fri, 30 Oct 2009 12:49:48 -0700 (PDT) From: Sergei Shtylyov Organization: MontaVista Software Inc. To: davinci-linux-open-source@linux.davincidsp.com Date: Fri, 30 Oct 2009 23:49:44 +0400 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Disposition: inline Message-ID: <200910302249.44702.sshtylyov@ru.mvista.com> X-Reverse-DNS: unknown Cc: linux-usb@vger.kernel.org Subject: [PATCH v2 2/3] DA8xx: MUSB platform device registration X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com Index: linux-davinci/arch/arm/mach-davinci/include/mach/da8xx.h =================================================================== --- linux-davinci.orig/arch/arm/mach-davinci/include/mach/da8xx.h +++ linux-davinci/arch/arm/mach-davinci/include/mach/da8xx.h @@ -82,6 +82,7 @@ int da8xx_cppi41_init(void); int da8xx_register_edma(void); int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); int da8xx_register_watchdog(void); +int da8xx_register_usb20(unsigned mA, unsigned potpgt); int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); int da8xx_register_emac(void); int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata); Index: linux-davinci/arch/arm/mach-davinci/usb.c =================================================================== --- linux-davinci.orig/arch/arm/mach-davinci/usb.c +++ linux-davinci/arch/arm/mach-davinci/usb.c @@ -13,6 +13,8 @@ #include #define DAVINCI_USB_OTG_BASE 0x01c64000 + +#define DA8XX_USB0_BASE 0x01e00000 #define DA8XX_USB1_BASE 0x01e25000 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) @@ -98,12 +100,44 @@ void __init davinci_setup_usb(unsigned m platform_device_register(&usb_dev); } +#ifdef CONFIG_ARCH_DAVINCI_DA8XX +static struct resource da8xx_usb20_resources[] = { + { + .start = DA8XX_USB0_BASE, + .end = DA8XX_USB0_BASE + SZ_64K - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = IRQ_DA8XX_USB_INT, + .flags = IORESOURCE_IRQ, + }, +}; + +int __init da8xx_register_usb20(unsigned mA, unsigned potpgt) +{ + usb_data.clock = "usb20"; + usb_data.power = mA > 510 ? 255 : mA / 2; + usb_data.potpgt = (potpgt + 1) / 2; + + usb_dev.resource = da8xx_usb20_resources; + usb_dev.num_resources = ARRAY_SIZE(da8xx_usb20_resources); + + return platform_device_register(&usb_dev); +} +#endif /* CONFIG_DAVINCI_DA8XX */ + #else void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms) { } +#ifdef CONFIG_ARCH_DAVINCI_DA8XX +int __init da8xx_register_usb20(unsigned mA, unsigned potpgt) +{ +} +#endif + #endif /* CONFIG_USB_MUSB_HDRC */ #ifdef CONFIG_ARCH_DAVINCI_DA8XX