aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-07-10 17:59:45 -0400
committerColin Cross <ccross@android.com>2011-07-12 23:39:40 -0400
commit681e6edc25a452e26e263386caaa4afb02b5f131 (patch)
tree1937aaf7057031bda8d03608314e422aa818fd0f /arch/arm/mach-tegra
parent78702e43c1cadd600e35374411caba82ad9354b6 (diff)
ARM: tegra: remove copy-and-pasted usb platform data from boards
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 <ccross@android.com> Tested-by: Konstantin Sinyuk <kostyas@compulab.co.il> Acked-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-paz00.c26
-rw-r--r--arch/arm/mach-tegra/board-trimslice.c19
-rw-r--r--arch/arm/mach-tegra/devices.c28
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 465768eebacd..ea2f79c9879b 100644
--- a/arch/arm/mach-tegra/board-paz00.c
+++ b/arch/arm/mach-tegra/board-paz00.c
@@ -26,7 +26,6 @@
26#include <linux/pda_power.h> 26#include <linux/pda_power.h>
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/platform_data/tegra_usb.h>
30 29
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -36,7 +35,6 @@
36#include <mach/iomap.h> 35#include <mach/iomap.h>
37#include <mach/irqs.h> 36#include <mach/irqs.h>
38#include <mach/sdhci.h> 37#include <mach/sdhci.h>
39#include <mach/usb_phy.h>
40#include <mach/gpio.h> 38#include <mach/gpio.h>
41 39
42#include "board.h" 40#include "board.h"
@@ -80,32 +78,8 @@ static void paz00_i2c_init(void)
80 platform_device_register(&tegra_i2c_device4); 78 platform_device_register(&tegra_i2c_device4);
81} 79}
82 80
83static struct tegra_ulpi_config ulpi_phy_config = {
84 .reset_gpio = TEGRA_ULPI_RST,
85 .clk = "cdev2",
86};
87
88static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
89 [0] = {
90 .operating_mode = TEGRA_USB_OTG,
91 .power_down_on_bus_suspend = 1,
92 },
93 [1] = {
94 .phy_config = &ulpi_phy_config,
95 .operating_mode = TEGRA_USB_HOST,
96 .power_down_on_bus_suspend = 1,
97 },
98 [2] = {
99 .operating_mode = TEGRA_USB_HOST,
100 .power_down_on_bus_suspend = 1,
101 },
102};
103
104static void paz00_usb_init(void) 81static void paz00_usb_init(void)
105{ 82{
106 tegra_ehci2_device.dev.platform_data = &tegra_ehci_pdata[1];
107 tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata[2];
108
109 platform_device_register(&tegra_ehci2_device); 83 platform_device_register(&tegra_ehci2_device);
110 platform_device_register(&tegra_ehci3_device); 84 platform_device_register(&tegra_ehci3_device);
111} 85}
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
index e1d7e67ca85c..89a6d2adc1de 100644
--- a/arch/arm/mach-tegra/board-trimslice.c
+++ b/arch/arm/mach-tegra/board-trimslice.c
@@ -24,7 +24,6 @@
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/platform_data/tegra_usb.h>
28#include <linux/gpio.h> 27#include <linux/gpio.h>
29 28
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -33,7 +32,6 @@
33 32
34#include <mach/iomap.h> 33#include <mach/iomap.h>
35#include <mach/sdhci.h> 34#include <mach/sdhci.h>
36#include <mach/usb_phy.h>
37#include <mach/gpio.h> 35#include <mach/gpio.h>
38 36
39#include "board.h" 37#include "board.h"
@@ -110,28 +108,12 @@ static void trimslice_i2c_init(void)
110 ARRAY_SIZE(trimslice_i2c3_board_info)); 108 ARRAY_SIZE(trimslice_i2c3_board_info));
111} 109}
112 110
113struct tegra_ulpi_config ehci2_phy_config = {
114 .reset_gpio = TRIMSLICE_GPIO_USB2_RST,
115 .clk = "cdev2",
116};
117
118static struct tegra_ehci_platform_data ehci_ulpi_data = {
119 .operating_mode = TEGRA_USB_HOST,
120 .phy_config = &ehci2_phy_config,
121};
122
123static struct tegra_ehci_platform_data ehci_utmi_data = {
124 .operating_mode = TEGRA_USB_HOST,
125};
126
127static void trimslice_usb_init(void) 111static void trimslice_usb_init(void)
128{ 112{
129 int err; 113 int err;
130 114
131 tegra_ehci3_device.dev.platform_data = &ehci_utmi_data;
132 platform_device_register(&tegra_ehci3_device); 115 platform_device_register(&tegra_ehci3_device);
133 116
134 tegra_ehci2_device.dev.platform_data = &ehci_ulpi_data;
135 platform_device_register(&tegra_ehci2_device); 117 platform_device_register(&tegra_ehci2_device);
136 118
137 err = gpio_request_one(TRIMSLICE_GPIO_USB1_MODE, GPIOF_OUT_INIT_HIGH, 119 err = gpio_request_one(TRIMSLICE_GPIO_USB1_MODE, GPIOF_OUT_INIT_HIGH,
@@ -141,7 +123,6 @@ static void trimslice_usb_init(void)
141 return; 123 return;
142 } 124 }
143 125
144 tegra_ehci1_device.dev.platform_data = &ehci_utmi_data;
145 platform_device_register(&tegra_ehci1_device); 126 platform_device_register(&tegra_ehci1_device);
146} 127}
147 128
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
index 066eaf9533fe..57e35d20c24c 100644
--- a/arch/arm/mach-tegra/devices.c
+++ b/arch/arm/mach-tegra/devices.c
@@ -23,10 +23,13 @@
23#include <linux/fsl_devices.h> 23#include <linux/fsl_devices.h>
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25#include <linux/i2c-tegra.h> 25#include <linux/i2c-tegra.h>
26#include <linux/platform_data/tegra_usb.h>
26#include <asm/pmu.h> 27#include <asm/pmu.h>
27#include <mach/irqs.h> 28#include <mach/irqs.h>
28#include <mach/iomap.h> 29#include <mach/iomap.h>
29#include <mach/dma.h> 30#include <mach/dma.h>
31#include <mach/usb_phy.h>
32#include "gpio-names.h"
30 33
31static struct resource i2c_resource1[] = { 34static struct resource i2c_resource1[] = {
32 [0] = { 35 [0] = {
@@ -351,6 +354,28 @@ static struct resource tegra_usb3_resources[] = {
351 }, 354 },
352}; 355};
353 356
357static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
358 /* All existing boards use GPIO PV0 for phy reset */
359 .reset_gpio = TEGRA_GPIO_PV0,
360 .clk = "cdev2",
361};
362
363static struct tegra_ehci_platform_data tegra_ehci1_pdata = {
364 .operating_mode = TEGRA_USB_OTG,
365 .power_down_on_bus_suspend = 1,
366};
367
368static struct tegra_ehci_platform_data tegra_ehci2_pdata = {
369 .phy_config = &tegra_ehci2_ulpi_phy_config,
370 .operating_mode = TEGRA_USB_HOST,
371 .power_down_on_bus_suspend = 1,
372};
373
374static struct tegra_ehci_platform_data tegra_ehci3_pdata = {
375 .operating_mode = TEGRA_USB_HOST,
376 .power_down_on_bus_suspend = 1,
377};
378
354static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32); 379static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32);
355 380
356struct platform_device tegra_ehci1_device = { 381struct platform_device tegra_ehci1_device = {
@@ -359,6 +384,7 @@ struct platform_device tegra_ehci1_device = {
359 .dev = { 384 .dev = {
360 .dma_mask = &tegra_ehci_dmamask, 385 .dma_mask = &tegra_ehci_dmamask,
361 .coherent_dma_mask = DMA_BIT_MASK(32), 386 .coherent_dma_mask = DMA_BIT_MASK(32),
387 .platform_data = &tegra_ehci1_pdata,
362 }, 388 },
363 .resource = tegra_usb1_resources, 389 .resource = tegra_usb1_resources,
364 .num_resources = ARRAY_SIZE(tegra_usb1_resources), 390 .num_resources = ARRAY_SIZE(tegra_usb1_resources),
@@ -370,6 +396,7 @@ struct platform_device tegra_ehci2_device = {
370 .dev = { 396 .dev = {
371 .dma_mask = &tegra_ehci_dmamask, 397 .dma_mask = &tegra_ehci_dmamask,
372 .coherent_dma_mask = DMA_BIT_MASK(32), 398 .coherent_dma_mask = DMA_BIT_MASK(32),
399 .platform_data = &tegra_ehci2_pdata,
373 }, 400 },
374 .resource = tegra_usb2_resources, 401 .resource = tegra_usb2_resources,
375 .num_resources = ARRAY_SIZE(tegra_usb2_resources), 402 .num_resources = ARRAY_SIZE(tegra_usb2_resources),
@@ -381,6 +408,7 @@ struct platform_device tegra_ehci3_device = {
381 .dev = { 408 .dev = {
382 .dma_mask = &tegra_ehci_dmamask, 409 .dma_mask = &tegra_ehci_dmamask,
383 .coherent_dma_mask = DMA_BIT_MASK(32), 410 .coherent_dma_mask = DMA_BIT_MASK(32),
411 .platform_data = &tegra_ehci3_pdata,
384 }, 412 },
385 .resource = tegra_usb3_resources, 413 .resource = tegra_usb3_resources,
386 .num_resources = ARRAY_SIZE(tegra_usb3_resources), 414 .num_resources = ARRAY_SIZE(tegra_usb3_resources),