aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-07-10 17:37:22 -0400
committerColin Cross <ccross@android.com>2011-07-12 23:39:02 -0400
commit78702e43c1cadd600e35374411caba82ad9354b6 (patch)
tree3ec6156ccc3eb814e8b2e0d17d337557be91775e
parent4c755997ea1eb3e3c2df7ef657494d8188d0c120 (diff)
ARM: tegra: remove copy-and-pasted i2c platform data in boards
Every board file includes the same platform data definition for the i2c-tegra driver's bus speed. 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>
-rw-r--r--arch/arm/mach-tegra/board-harmony.c22
-rw-r--r--arch/arm/mach-tegra/board-paz00.c17
-rw-r--r--arch/arm/mach-tegra/board-seaboard.c22
-rw-r--r--arch/arm/mach-tegra/board-trimslice.c17
-rw-r--r--arch/arm/mach-tegra/devices.c25
5 files changed, 21 insertions, 82 deletions
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index 30e18bc60647..846cd7d69e3e 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -25,7 +25,6 @@
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/i2c.h> 27#include <linux/i2c.h>
28#include <linux/i2c-tegra.h>
29 28
30#include <sound/wm8903.h> 29#include <sound/wm8903.h>
31 30
@@ -83,22 +82,6 @@ static struct platform_device harmony_audio_device = {
83 }, 82 },
84}; 83};
85 84
86static struct tegra_i2c_platform_data harmony_i2c1_platform_data = {
87 .bus_clk_rate = 400000,
88};
89
90static struct tegra_i2c_platform_data harmony_i2c2_platform_data = {
91 .bus_clk_rate = 400000,
92};
93
94static struct tegra_i2c_platform_data harmony_i2c3_platform_data = {
95 .bus_clk_rate = 400000,
96};
97
98static struct tegra_i2c_platform_data harmony_dvc_platform_data = {
99 .bus_clk_rate = 400000,
100};
101
102static struct wm8903_platform_data harmony_wm8903_pdata = { 85static struct wm8903_platform_data harmony_wm8903_pdata = {
103 .irq_active_low = 0, 86 .irq_active_low = 0,
104 .micdet_cfg = 0, 87 .micdet_cfg = 0,
@@ -121,11 +104,6 @@ static struct i2c_board_info __initdata wm8903_board_info = {
121 104
122static void __init harmony_i2c_init(void) 105static void __init harmony_i2c_init(void)
123{ 106{
124 tegra_i2c_device1.dev.platform_data = &harmony_i2c1_platform_data;
125 tegra_i2c_device2.dev.platform_data = &harmony_i2c2_platform_data;
126 tegra_i2c_device3.dev.platform_data = &harmony_i2c3_platform_data;
127 tegra_i2c_device4.dev.platform_data = &harmony_dvc_platform_data;
128
129 platform_device_register(&tegra_i2c_device1); 107 platform_device_register(&tegra_i2c_device1);
130 platform_device_register(&tegra_i2c_device2); 108 platform_device_register(&tegra_i2c_device2);
131 platform_device_register(&tegra_i2c_device3); 109 platform_device_register(&tegra_i2c_device3);
diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
index 1b076f6f23d1..465768eebacd 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/i2c-tegra.h>
30#include <linux/platform_data/tegra_usb.h> 29#include <linux/platform_data/tegra_usb.h>
31 30
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
@@ -74,24 +73,8 @@ static struct platform_device *paz00_devices[] __initdata = {
74 &tegra_sdhci_device4, 73 &tegra_sdhci_device4,
75}; 74};
76 75
77static struct tegra_i2c_platform_data paz00_i2c1_platform_data = {
78 .bus_clk_rate = 400000,
79};
80
81static struct tegra_i2c_platform_data paz00_i2c2_platform_data = {
82 .bus_clk_rate = 400000,
83};
84
85static struct tegra_i2c_platform_data paz00_dvc_platform_data = {
86 .bus_clk_rate = 400000,
87};
88
89static void paz00_i2c_init(void) 76static void paz00_i2c_init(void)
90{ 77{
91 tegra_i2c_device1.dev.platform_data = &paz00_i2c1_platform_data;
92 tegra_i2c_device2.dev.platform_data = &paz00_i2c2_platform_data;
93 tegra_i2c_device4.dev.platform_data = &paz00_dvc_platform_data;
94
95 platform_device_register(&tegra_i2c_device1); 78 platform_device_register(&tegra_i2c_device1);
96 platform_device_register(&tegra_i2c_device2); 79 platform_device_register(&tegra_i2c_device2);
97 platform_device_register(&tegra_i2c_device4); 80 platform_device_register(&tegra_i2c_device4);
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
index 783de172c0eb..46d5df90c79e 100644
--- a/arch/arm/mach-tegra/board-seaboard.c
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -19,7 +19,6 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/serial_8250.h> 20#include <linux/serial_8250.h>
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22#include <linux/i2c-tegra.h>
23#include <linux/delay.h> 22#include <linux/delay.h>
24#include <linux/input.h> 23#include <linux/input.h>
25#include <linux/io.h> 24#include <linux/io.h>
@@ -66,22 +65,6 @@ static __initdata struct tegra_clk_init_table seaboard_clk_init_table[] = {
66 { NULL, NULL, 0, 0}, 65 { NULL, NULL, 0, 0},
67}; 66};
68 67
69static struct tegra_i2c_platform_data seaboard_i2c1_platform_data = {
70 .bus_clk_rate = 400000.
71};
72
73static struct tegra_i2c_platform_data seaboard_i2c2_platform_data = {
74 .bus_clk_rate = 400000,
75};
76
77static struct tegra_i2c_platform_data seaboard_i2c3_platform_data = {
78 .bus_clk_rate = 400000,
79};
80
81static struct tegra_i2c_platform_data seaboard_dvc_platform_data = {
82 .bus_clk_rate = 400000,
83};
84
85static struct gpio_keys_button seaboard_gpio_keys_buttons[] = { 68static struct gpio_keys_button seaboard_gpio_keys_buttons[] = {
86 { 69 {
87 .code = SW_LID, 70 .code = SW_LID,
@@ -161,11 +144,6 @@ static void __init seaboard_i2c_init(void)
161 144
162 i2c_register_board_info(4, &adt7461_device, 1); 145 i2c_register_board_info(4, &adt7461_device, 1);
163 146
164 tegra_i2c_device1.dev.platform_data = &seaboard_i2c1_platform_data;
165 tegra_i2c_device2.dev.platform_data = &seaboard_i2c2_platform_data;
166 tegra_i2c_device3.dev.platform_data = &seaboard_i2c3_platform_data;
167 tegra_i2c_device4.dev.platform_data = &seaboard_dvc_platform_data;
168
169 platform_device_register(&tegra_i2c_device1); 147 platform_device_register(&tegra_i2c_device1);
170 platform_device_register(&tegra_i2c_device2); 148 platform_device_register(&tegra_i2c_device2);
171 platform_device_register(&tegra_i2c_device3); 149 platform_device_register(&tegra_i2c_device3);
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
index a8fff429fb4a..e1d7e67ca85c 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/i2c-tegra.h>
28#include <linux/platform_data/tegra_usb.h> 27#include <linux/platform_data/tegra_usb.h>
29#include <linux/gpio.h> 28#include <linux/gpio.h>
30 29
@@ -92,18 +91,6 @@ static struct platform_device *trimslice_devices[] __initdata = {
92 &trimslice_audio_device, 91 &trimslice_audio_device,
93}; 92};
94 93
95static struct tegra_i2c_platform_data trimslice_i2c1_platform_data = {
96 .bus_clk_rate = 400000,
97};
98
99static struct tegra_i2c_platform_data trimslice_i2c2_platform_data = {
100 .bus_clk_rate = 400000,
101};
102
103static struct tegra_i2c_platform_data trimslice_i2c3_platform_data = {
104 .bus_clk_rate = 400000,
105};
106
107static struct i2c_board_info trimslice_i2c3_board_info[] = { 94static struct i2c_board_info trimslice_i2c3_board_info[] = {
108 { 95 {
109 I2C_BOARD_INFO("tlv320aic23", 0x1a), 96 I2C_BOARD_INFO("tlv320aic23", 0x1a),
@@ -115,10 +102,6 @@ static struct i2c_board_info trimslice_i2c3_board_info[] = {
115 102
116static void trimslice_i2c_init(void) 103static void trimslice_i2c_init(void)
117{ 104{
118 tegra_i2c_device1.dev.platform_data = &trimslice_i2c1_platform_data;
119 tegra_i2c_device2.dev.platform_data = &trimslice_i2c2_platform_data;
120 tegra_i2c_device3.dev.platform_data = &trimslice_i2c3_platform_data;
121
122 platform_device_register(&tegra_i2c_device1); 105 platform_device_register(&tegra_i2c_device1);
123 platform_device_register(&tegra_i2c_device2); 106 platform_device_register(&tegra_i2c_device2);
124 platform_device_register(&tegra_i2c_device3); 107 platform_device_register(&tegra_i2c_device3);
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
index 1528f9daef1f..066eaf9533fe 100644
--- a/arch/arm/mach-tegra/devices.c
+++ b/arch/arm/mach-tegra/devices.c
@@ -22,6 +22,7 @@
22#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
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 <asm/pmu.h> 26#include <asm/pmu.h>
26#include <mach/irqs.h> 27#include <mach/irqs.h>
27#include <mach/iomap.h> 28#include <mach/iomap.h>
@@ -79,13 +80,29 @@ static struct resource i2c_resource4[] = {
79 }, 80 },
80}; 81};
81 82
83static struct tegra_i2c_platform_data tegra_i2c1_platform_data = {
84 .bus_clk_rate = 400000,
85};
86
87static struct tegra_i2c_platform_data tegra_i2c2_platform_data = {
88 .bus_clk_rate = 400000,
89};
90
91static struct tegra_i2c_platform_data tegra_i2c3_platform_data = {
92 .bus_clk_rate = 400000,
93};
94
95static struct tegra_i2c_platform_data tegra_dvc_platform_data = {
96 .bus_clk_rate = 400000,
97};
98
82struct platform_device tegra_i2c_device1 = { 99struct platform_device tegra_i2c_device1 = {
83 .name = "tegra-i2c", 100 .name = "tegra-i2c",
84 .id = 0, 101 .id = 0,
85 .resource = i2c_resource1, 102 .resource = i2c_resource1,
86 .num_resources = ARRAY_SIZE(i2c_resource1), 103 .num_resources = ARRAY_SIZE(i2c_resource1),
87 .dev = { 104 .dev = {
88 .platform_data = 0, 105 .platform_data = &tegra_i2c1_platform_data,
89 }, 106 },
90}; 107};
91 108
@@ -95,7 +112,7 @@ struct platform_device tegra_i2c_device2 = {
95 .resource = i2c_resource2, 112 .resource = i2c_resource2,
96 .num_resources = ARRAY_SIZE(i2c_resource2), 113 .num_resources = ARRAY_SIZE(i2c_resource2),
97 .dev = { 114 .dev = {
98 .platform_data = 0, 115 .platform_data = &tegra_i2c2_platform_data,
99 }, 116 },
100}; 117};
101 118
@@ -105,7 +122,7 @@ struct platform_device tegra_i2c_device3 = {
105 .resource = i2c_resource3, 122 .resource = i2c_resource3,
106 .num_resources = ARRAY_SIZE(i2c_resource3), 123 .num_resources = ARRAY_SIZE(i2c_resource3),
107 .dev = { 124 .dev = {
108 .platform_data = 0, 125 .platform_data = &tegra_i2c3_platform_data,
109 }, 126 },
110}; 127};
111 128
@@ -115,7 +132,7 @@ struct platform_device tegra_i2c_device4 = {
115 .resource = i2c_resource4, 132 .resource = i2c_resource4,
116 .num_resources = ARRAY_SIZE(i2c_resource4), 133 .num_resources = ARRAY_SIZE(i2c_resource4),
117 .dev = { 134 .dev = {
118 .platform_data = 0, 135 .platform_data = &tegra_dvc_platform_data,
119 }, 136 },
120}; 137};
121 138