From patchwork Sun Jul 10 22:19:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 962682 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6AMK8Rh024751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 10 Jul 2011 22:20:29 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qg2Ly-0005VF-3e; Sun, 10 Jul 2011 22:19:54 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qg2Lx-0001t3-NY; Sun, 10 Jul 2011 22:19:53 +0000 Received: from smtp-out.google.com ([74.125.121.67]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qg2Lt-0001sS-JU for linux-arm-kernel@lists.infradead.org; Sun, 10 Jul 2011 22:19:50 +0000 Received: from kpbe13.cbf.corp.google.com (kpbe13.cbf.corp.google.com [172.25.105.77]) by smtp-out.google.com with ESMTP id p6AMJgN8000511; Sun, 10 Jul 2011 15:19:42 -0700 Received: from walnut.mtv.corp.google.com (walnut.mtv.corp.google.com [172.18.102.62]) by kpbe13.cbf.corp.google.com with ESMTP id p6AMJe6k023858; Sun, 10 Jul 2011 15:19:40 -0700 Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 56CFB25771D; Sun, 10 Jul 2011 15:19:40 -0700 (PDT) From: Colin Cross To: linux-tegra@vger.kernel.org Subject: [PATCH 2/2] ARM: tegra: remove copy-and-pasted usb platform data from boards Date: Sun, 10 Jul 2011 15:19:34 -0700 Message-Id: <1310336374-31727-2-git-send-email-ccross@android.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1310336374-31727-1-git-send-email-ccross@android.com> References: <1310336374-31727-1-git-send-email-ccross@android.com> X-System-Of-Record: true X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110710_181949_897275_C5C139F0 X-CRM114-Status: GOOD ( 12.45 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.121.67 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Olof Johansson , Colin Cross , Mike Rapoport , linux-arm-kernel@lists.infradead.org, Marc Dietrich X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 10 Jul 2011 22:20:29 +0000 (UTC) trimslice and paz00 both have functionally identical platform data for the tegra-ehci driver. Move the platform data into devices.c, and remove it from all the board files. Signed-off-by: Colin Cross Tested-by: Konstantin Sinyuk Acked-By: Marc Dietrich --- arch/arm/mach-tegra/board-paz00.c | 26 -------------------------- arch/arm/mach-tegra/board-trimslice.c | 19 ------------------- arch/arm/mach-tegra/devices.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 45 deletions(-) diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c index 465768e..ea2f79c 100644 --- a/arch/arm/mach-tegra/board-paz00.c +++ b/arch/arm/mach-tegra/board-paz00.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -36,7 +35,6 @@ #include #include #include -#include #include #include "board.h" @@ -80,32 +78,8 @@ static void paz00_i2c_init(void) platform_device_register(&tegra_i2c_device4); } -static struct tegra_ulpi_config ulpi_phy_config = { - .reset_gpio = TEGRA_ULPI_RST, - .clk = "cdev2", -}; - -static struct tegra_ehci_platform_data tegra_ehci_pdata[] = { - [0] = { - .operating_mode = TEGRA_USB_OTG, - .power_down_on_bus_suspend = 1, - }, - [1] = { - .phy_config = &ulpi_phy_config, - .operating_mode = TEGRA_USB_HOST, - .power_down_on_bus_suspend = 1, - }, - [2] = { - .operating_mode = TEGRA_USB_HOST, - .power_down_on_bus_suspend = 1, - }, -}; - static void paz00_usb_init(void) { - tegra_ehci2_device.dev.platform_data = &tegra_ehci_pdata[1]; - tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata[2]; - platform_device_register(&tegra_ehci2_device); platform_device_register(&tegra_ehci3_device); } diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c index e1d7e67..89a6d2a 100644 --- a/arch/arm/mach-tegra/board-trimslice.c +++ b/arch/arm/mach-tegra/board-trimslice.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -33,7 +32,6 @@ #include #include -#include #include #include "board.h" @@ -110,28 +108,12 @@ static void trimslice_i2c_init(void) ARRAY_SIZE(trimslice_i2c3_board_info)); } -struct tegra_ulpi_config ehci2_phy_config = { - .reset_gpio = TRIMSLICE_GPIO_USB2_RST, - .clk = "cdev2", -}; - -static struct tegra_ehci_platform_data ehci_ulpi_data = { - .operating_mode = TEGRA_USB_HOST, - .phy_config = &ehci2_phy_config, -}; - -static struct tegra_ehci_platform_data ehci_utmi_data = { - .operating_mode = TEGRA_USB_HOST, -}; - static void trimslice_usb_init(void) { int err; - tegra_ehci3_device.dev.platform_data = &ehci_utmi_data; platform_device_register(&tegra_ehci3_device); - tegra_ehci2_device.dev.platform_data = &ehci_ulpi_data; platform_device_register(&tegra_ehci2_device); err = gpio_request_one(TRIMSLICE_GPIO_USB1_MODE, GPIOF_OUT_INIT_HIGH, @@ -141,7 +123,6 @@ static void trimslice_usb_init(void) return; } - tegra_ehci1_device.dev.platform_data = &ehci_utmi_data; platform_device_register(&tegra_ehci1_device); } diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index 066eaf9..57e35d2 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c @@ -23,10 +23,13 @@ #include #include #include +#include #include #include #include #include +#include +#include "gpio-names.h" static struct resource i2c_resource1[] = { [0] = { @@ -351,6 +354,28 @@ static struct resource tegra_usb3_resources[] = { }, }; +static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = { + /* All existing boards use GPIO PV0 for phy reset */ + .reset_gpio = TEGRA_GPIO_PV0, + .clk = "cdev2", +}; + +static struct tegra_ehci_platform_data tegra_ehci1_pdata = { + .operating_mode = TEGRA_USB_OTG, + .power_down_on_bus_suspend = 1, +}; + +static struct tegra_ehci_platform_data tegra_ehci2_pdata = { + .phy_config = &tegra_ehci2_ulpi_phy_config, + .operating_mode = TEGRA_USB_HOST, + .power_down_on_bus_suspend = 1, +}; + +static struct tegra_ehci_platform_data tegra_ehci3_pdata = { + .operating_mode = TEGRA_USB_HOST, + .power_down_on_bus_suspend = 1, +}; + static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32); struct platform_device tegra_ehci1_device = { @@ -359,6 +384,7 @@ struct platform_device tegra_ehci1_device = { .dev = { .dma_mask = &tegra_ehci_dmamask, .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &tegra_ehci1_pdata, }, .resource = tegra_usb1_resources, .num_resources = ARRAY_SIZE(tegra_usb1_resources), @@ -370,6 +396,7 @@ struct platform_device tegra_ehci2_device = { .dev = { .dma_mask = &tegra_ehci_dmamask, .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &tegra_ehci2_pdata, }, .resource = tegra_usb2_resources, .num_resources = ARRAY_SIZE(tegra_usb2_resources), @@ -381,6 +408,7 @@ struct platform_device tegra_ehci3_device = { .dev = { .dma_mask = &tegra_ehci_dmamask, .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &tegra_ehci3_pdata, }, .resource = tegra_usb3_resources, .num_resources = ARRAY_SIZE(tegra_usb3_resources),