summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0024-OMAP3-Move-common-twl-configuration-to-twl-common.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-07-21 14:52:50 +0200
committerKoen Kooi <koen@dominion.thruhere.net>2011-07-21 14:52:50 +0200
commitaf058e57f1f7d20c389e3e8ef14a998b66e28d56 (patch)
treea6654d7e4de70bfeb5fc94ed87c34efe83721819 /recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0024-OMAP3-Move-common-twl-configuration-to-twl-common.patch
parent6587ff852abbea125dc57b2701540136d6e5fb92 (diff)
downloadmeta-ti-af058e57f1f7d20c389e3e8ef14a998b66e28d56.tar.gz
linux 3.0: updates
* Bump SRCREV to latest 3.0rc from Linux * Merge in pm-voltdm patches * Merge in ABB support * Merge in expansion-board support (unfished) * Add hack for switch to GPTIMER1 * Set default cpufreq governor to performance Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0024-OMAP3-Move-common-twl-configuration-to-twl-common.patch')
-rw-r--r--recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0024-OMAP3-Move-common-twl-configuration-to-twl-common.patch827
1 files changed, 827 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0024-OMAP3-Move-common-twl-configuration-to-twl-common.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0024-OMAP3-Move-common-twl-configuration-to-twl-common.patch
new file mode 100644
index 00000000..db07db28
--- /dev/null
+++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0024-OMAP3-Move-common-twl-configuration-to-twl-common.patch
@@ -0,0 +1,827 @@
1From 7f52cd416de3100e27599382f8dfea45ed1a6d45 Mon Sep 17 00:00:00 2001
2From: Peter Ujfalusi <peter.ujfalusi@ti.com>
3Date: Tue, 7 Jun 2011 10:28:54 +0300
4Subject: [PATCH 024/149] OMAP3: Move common twl configuration to twl-common
5
6Reduce the amount of duplicated code by moving the common
7configuration for twl4030/5030/tpsxx to the twl-common file.
8Use the omap3_pmic_get_config function from board files to
9properly configure the PMIC with the common fields.
10
11Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
12Acked-by: Tony Lindgren <tony@atomide.com>
13---
14 arch/arm/mach-omap2/board-3430sdp.c | 42 ++------------------
15 arch/arm/mach-omap2/board-cm-t35.c | 9 +----
16 arch/arm/mach-omap2/board-devkit8000.c | 18 +--------
17 arch/arm/mach-omap2/board-igep0020.c | 20 ++--------
18 arch/arm/mach-omap2/board-ldp.c | 15 +------
19 arch/arm/mach-omap2/board-omap3beagle.c | 18 +--------
20 arch/arm/mach-omap2/board-omap3evm.c | 24 +----------
21 arch/arm/mach-omap2/board-omap3pandora.c | 17 +-------
22 arch/arm/mach-omap2/board-omap3stalker.c | 24 +----------
23 arch/arm/mach-omap2/board-omap3touchbook.c | 19 +--------
24 arch/arm/mach-omap2/board-overo.c | 17 +-------
25 arch/arm/mach-omap2/board-rm680.c | 8 +---
26 arch/arm/mach-omap2/board-rx51-peripherals.c | 15 +------
27 arch/arm/mach-omap2/board-zoom-peripherals.c | 51 +++++--------------------
28 arch/arm/mach-omap2/twl-common.c | 53 ++++++++++++++++++++++++++
29 arch/arm/mach-omap2/twl-common.h | 6 +++
30 16 files changed, 99 insertions(+), 257 deletions(-)
31
32diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
33index 12fae21..8bbd4e0 100644
34--- a/arch/arm/mach-omap2/board-3430sdp.c
35+++ b/arch/arm/mach-omap2/board-3430sdp.c
36@@ -231,22 +231,6 @@ static void __init omap_3430sdp_init_early(void)
37 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
38 }
39
40-static int sdp3430_batt_table[] = {
41-/* 0 C*/
42-30800, 29500, 28300, 27100,
43-26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
44-17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
45-11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
46-8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
47-5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
48-4040, 3910, 3790, 3670, 3550
49-};
50-
51-static struct twl4030_bci_platform_data sdp3430_bci_data = {
52- .battery_tmp_tbl = sdp3430_batt_table,
53- .tblsize = ARRAY_SIZE(sdp3430_batt_table),
54-};
55-
56 static struct omap2_hsmmc_info mmc[] = {
57 {
58 .mmc = 1,
59@@ -292,14 +276,6 @@ static struct twl4030_gpio_platform_data sdp3430_gpio_data = {
60 .setup = sdp3430_twl_gpio_setup,
61 };
62
63-static struct twl4030_usb_data sdp3430_usb_data = {
64- .usb_mode = T2_USB_MODE_ULPI,
65-};
66-
67-static struct twl4030_madc_platform_data sdp3430_madc_data = {
68- .irq_line = 1,
69-};
70-
71 /* regulator consumer mappings */
72
73 /* ads7846 on SPI */
74@@ -463,24 +439,10 @@ static struct regulator_init_data sdp3430_vpll2 = {
75 .consumer_supplies = sdp3430_vpll2_supplies,
76 };
77
78-static struct twl4030_codec_audio_data sdp3430_audio;
79-
80-static struct twl4030_codec_data sdp3430_codec = {
81- .audio_mclk = 26000000,
82- .audio = &sdp3430_audio,
83-};
84-
85 static struct twl4030_platform_data sdp3430_twldata = {
86- .irq_base = TWL4030_IRQ_BASE,
87- .irq_end = TWL4030_IRQ_END,
88-
89 /* platform_data for children goes here */
90- .bci = &sdp3430_bci_data,
91 .gpio = &sdp3430_gpio_data,
92- .madc = &sdp3430_madc_data,
93 .keypad = &sdp3430_kp_data,
94- .usb = &sdp3430_usb_data,
95- .codec = &sdp3430_codec,
96
97 .vaux1 = &sdp3430_vaux1,
98 .vaux2 = &sdp3430_vaux2,
99@@ -496,7 +458,11 @@ static struct twl4030_platform_data sdp3430_twldata = {
100 static int __init omap3430_i2c_init(void)
101 {
102 /* i2c1 for PMIC only */
103+ omap3_pmic_get_config(&sdp3430_twldata,
104+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
105+ TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, 0);
106 omap3_pmic_init("twl4030", &sdp3430_twldata);
107+
108 /* i2c2 on camera connector (for sensor control) and optional isp1301 */
109 omap_register_i2c_bus(2, 400, NULL, 0);
110 /* i2c3 on display connector (for DVI, tfp410) */
111diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
112index d76dca7..cb00abc 100644
113--- a/arch/arm/mach-omap2/board-cm-t35.c
114+++ b/arch/arm/mach-omap2/board-cm-t35.c
115@@ -410,10 +410,6 @@ static struct regulator_init_data cm_t35_vpll2 = {
116 .consumer_supplies = cm_t35_vdvi_supply,
117 };
118
119-static struct twl4030_usb_data cm_t35_usb_data = {
120- .usb_mode = T2_USB_MODE_ULPI,
121-};
122-
123 static uint32_t cm_t35_keymap[] = {
124 KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT),
125 KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN),
126@@ -492,12 +488,8 @@ static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
127 };
128
129 static struct twl4030_platform_data cm_t35_twldata = {
130- .irq_base = TWL4030_IRQ_BASE,
131- .irq_end = TWL4030_IRQ_END,
132-
133 /* platform_data for children goes here */
134 .keypad = &cm_t35_kp_data,
135- .usb = &cm_t35_usb_data,
136 .gpio = &cm_t35_gpio_data,
137 .vmmc1 = &cm_t35_vmmc1,
138 .vsim = &cm_t35_vsim,
139@@ -507,6 +499,7 @@ static struct twl4030_platform_data cm_t35_twldata = {
140
141 static void __init cm_t35_init_i2c(void)
142 {
143+ omap3_pmic_get_config(&cm_t35_twldata, TWL_COMMON_PDATA_USB, 0);
144 omap3_pmic_init("tps65930", &cm_t35_twldata);
145 }
146
147diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
148index 949dbea..364942e 100644
149--- a/arch/arm/mach-omap2/board-devkit8000.c
150+++ b/arch/arm/mach-omap2/board-devkit8000.c
151@@ -332,25 +332,9 @@ static struct regulator_init_data devkit8000_vio = {
152 .consumer_supplies = devkit8000_vio_supply,
153 };
154
155-static struct twl4030_usb_data devkit8000_usb_data = {
156- .usb_mode = T2_USB_MODE_ULPI,
157-};
158-
159-static struct twl4030_codec_audio_data devkit8000_audio_data;
160-
161-static struct twl4030_codec_data devkit8000_codec_data = {
162- .audio_mclk = 26000000,
163- .audio = &devkit8000_audio_data,
164-};
165-
166 static struct twl4030_platform_data devkit8000_twldata = {
167- .irq_base = TWL4030_IRQ_BASE,
168- .irq_end = TWL4030_IRQ_END,
169-
170 /* platform_data for children goes here */
171- .usb = &devkit8000_usb_data,
172 .gpio = &devkit8000_gpio_data,
173- .codec = &devkit8000_codec_data,
174 .vmmc1 = &devkit8000_vmmc1,
175 .vdac = &devkit8000_vdac,
176 .vpll1 = &devkit8000_vpll1,
177@@ -360,6 +344,8 @@ static struct twl4030_platform_data devkit8000_twldata = {
178
179 static int __init devkit8000_i2c_init(void)
180 {
181+ omap3_pmic_get_config(&devkit8000_twldata,
182+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0);
183 omap3_pmic_init("tps65930", &devkit8000_twldata);
184 /* Bus 3 is attached to the DVI port where devices like the pico DLP
185 * projector don't work reliably with 400kHz */
186diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
187index f683835..e0a6687 100644
188--- a/arch/arm/mach-omap2/board-igep0020.c
189+++ b/arch/arm/mach-omap2/board-igep0020.c
190@@ -443,10 +443,6 @@ static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = {
191 .setup = igep_twl_gpio_setup,
192 };
193
194-static struct twl4030_usb_data igep_usb_data = {
195- .usb_mode = T2_USB_MODE_ULPI,
196-};
197-
198 static int igep2_enable_dvi(struct omap_dss_device *dssdev)
199 {
200 gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1);
201@@ -522,13 +518,6 @@ static void __init igep_init_early(void)
202 m65kxxxxam_sdrc_params);
203 }
204
205-static struct twl4030_codec_audio_data igep2_audio_data;
206-
207-static struct twl4030_codec_data igep2_codec_data = {
208- .audio_mclk = 26000000,
209- .audio = &igep2_audio_data,
210-};
211-
212 static int igep2_keymap[] = {
213 KEY(0, 0, KEY_LEFT),
214 KEY(0, 1, KEY_RIGHT),
215@@ -561,11 +550,7 @@ static struct twl4030_keypad_data igep2_keypad_pdata = {
216 };
217
218 static struct twl4030_platform_data igep_twldata = {
219- .irq_base = TWL4030_IRQ_BASE,
220- .irq_end = TWL4030_IRQ_END,
221-
222 /* platform_data for children goes here */
223- .usb = &igep_usb_data,
224 .gpio = &igep_twl4030_gpio_pdata,
225 .vmmc1 = &igep_vmmc1,
226 .vio = &igep_vio,
227@@ -581,6 +566,8 @@ static void __init igep_i2c_init(void)
228 {
229 int ret;
230
231+ omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_USB, 0);
232+
233 if (machine_is_igep0020()) {
234 /*
235 * Bus 3 is attached to the DVI port where devices like the
236@@ -591,9 +578,10 @@ static void __init igep_i2c_init(void)
237 if (ret)
238 pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
239
240- igep_twldata.codec = &igep2_codec_data;
241 igep_twldata.keypad = &igep2_keypad_pdata;
242 igep_twldata.vpll2 = &igep2_vpll2;
243+ /* Use common codec data */
244+ omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_AUDIO, 0);
245 }
246
247 omap3_pmic_init("twl4030", &igep_twldata);
248diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
249index 5d4328f..218764c 100644
250--- a/arch/arm/mach-omap2/board-ldp.c
251+++ b/arch/arm/mach-omap2/board-ldp.c
252@@ -199,20 +199,12 @@ static void __init omap_ldp_init_early(void)
253 omap2_init_common_devices(NULL, NULL);
254 }
255
256-static struct twl4030_usb_data ldp_usb_data = {
257- .usb_mode = T2_USB_MODE_ULPI,
258-};
259-
260 static struct twl4030_gpio_platform_data ldp_gpio_data = {
261 .gpio_base = OMAP_MAX_GPIO_LINES,
262 .irq_base = TWL4030_GPIO_IRQ_BASE,
263 .irq_end = TWL4030_GPIO_IRQ_END,
264 };
265
266-static struct twl4030_madc_platform_data ldp_madc_data = {
267- .irq_line = 1,
268-};
269-
270 static struct regulator_consumer_supply ldp_vmmc1_supply[] = {
271 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
272 };
273@@ -253,12 +245,7 @@ static struct regulator_init_data ldp_vaux1 = {
274 };
275
276 static struct twl4030_platform_data ldp_twldata = {
277- .irq_base = TWL4030_IRQ_BASE,
278- .irq_end = TWL4030_IRQ_END,
279-
280 /* platform_data for children goes here */
281- .madc = &ldp_madc_data,
282- .usb = &ldp_usb_data,
283 .vmmc1 = &ldp_vmmc1,
284 .vaux1 = &ldp_vaux1,
285 .gpio = &ldp_gpio_data,
286@@ -267,6 +254,8 @@ static struct twl4030_platform_data ldp_twldata = {
287
288 static int __init omap_i2c_init(void)
289 {
290+ omap3_pmic_get_config(&ldp_twldata,
291+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC, 0);
292 omap3_pmic_init("twl4030", &ldp_twldata);
293 omap_register_i2c_bus(2, 400, NULL, 0);
294 omap_register_i2c_bus(3, 400, NULL, 0);
295diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
296index 2d8dfb3..ec61e9c 100644
297--- a/arch/arm/mach-omap2/board-omap3beagle.c
298+++ b/arch/arm/mach-omap2/board-omap3beagle.c
299@@ -380,25 +380,9 @@ static struct regulator_init_data beagle_vpll2 = {
300 .consumer_supplies = beagle_vdvi_supplies,
301 };
302
303-static struct twl4030_usb_data beagle_usb_data = {
304- .usb_mode = T2_USB_MODE_ULPI,
305-};
306-
307-static struct twl4030_codec_audio_data beagle_audio_data;
308-
309-static struct twl4030_codec_data beagle_codec_data = {
310- .audio_mclk = 26000000,
311- .audio = &beagle_audio_data,
312-};
313-
314 static struct twl4030_platform_data beagle_twldata = {
315- .irq_base = TWL4030_IRQ_BASE,
316- .irq_end = TWL4030_IRQ_END,
317-
318 /* platform_data for children goes here */
319- .usb = &beagle_usb_data,
320 .gpio = &beagle_gpio_data,
321- .codec = &beagle_codec_data,
322 .vmmc1 = &beagle_vmmc1,
323 .vsim = &beagle_vsim,
324 .vdac = &beagle_vdac,
325@@ -413,6 +397,8 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
326
327 static int __init omap3_beagle_i2c_init(void)
328 {
329+ omap3_pmic_get_config(&beagle_twldata,
330+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0);
331 omap3_pmic_init("twl4030", &beagle_twldata);
332 /* Bus 3 is attached to the DVI port where devices like the pico DLP
333 * projector don't work reliably with 400kHz */
334diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
335index 57bce0f..1ca298a 100644
336--- a/arch/arm/mach-omap2/board-omap3evm.c
337+++ b/arch/arm/mach-omap2/board-omap3evm.c
338@@ -396,10 +396,6 @@ static struct twl4030_gpio_platform_data omap3evm_gpio_data = {
339 .setup = omap3evm_twl_gpio_setup,
340 };
341
342-static struct twl4030_usb_data omap3evm_usb_data = {
343- .usb_mode = T2_USB_MODE_ULPI,
344-};
345-
346 static uint32_t board_keymap[] = {
347 KEY(0, 0, KEY_LEFT),
348 KEY(0, 1, KEY_DOWN),
349@@ -434,17 +430,6 @@ static struct twl4030_keypad_data omap3evm_kp_data = {
350 .rep = 1,
351 };
352
353-static struct twl4030_madc_platform_data omap3evm_madc_data = {
354- .irq_line = 1,
355-};
356-
357-static struct twl4030_codec_audio_data omap3evm_audio_data;
358-
359-static struct twl4030_codec_data omap3evm_codec_data = {
360- .audio_mclk = 26000000,
361- .audio = &omap3evm_audio_data,
362-};
363-
364 static struct regulator_consumer_supply omap3_evm_vdda_dac_supply[] = {
365 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
366 };
367@@ -547,15 +532,9 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
368 #endif
369
370 static struct twl4030_platform_data omap3evm_twldata = {
371- .irq_base = TWL4030_IRQ_BASE,
372- .irq_end = TWL4030_IRQ_END,
373-
374 /* platform_data for children goes here */
375 .keypad = &omap3evm_kp_data,
376- .madc = &omap3evm_madc_data,
377- .usb = &omap3evm_usb_data,
378 .gpio = &omap3evm_gpio_data,
379- .codec = &omap3evm_codec_data,
380 .vdac = &omap3_evm_vdac,
381 .vpll2 = &omap3_evm_vpll2,
382 .vio = &omap3evm_vio,
383@@ -565,6 +544,9 @@ static struct twl4030_platform_data omap3evm_twldata = {
384
385 static int __init omap3_evm_i2c_init(void)
386 {
387+ omap3_pmic_get_config(&omap3evm_twldata,
388+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC |
389+ TWL_COMMON_PDATA_AUDIO, 0);
390 omap3_pmic_init("twl4030", &omap3evm_twldata);
391 omap_register_i2c_bus(2, 400, NULL, 0);
392 omap_register_i2c_bus(3, 400, NULL, 0);
393diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
394index d4ea940..f5abf76 100644
395--- a/arch/arm/mach-omap2/board-omap3pandora.c
396+++ b/arch/arm/mach-omap2/board-omap3pandora.c
397@@ -508,25 +508,10 @@ static struct platform_device pandora_vwlan_device = {
398 },
399 };
400
401-static struct twl4030_usb_data omap3pandora_usb_data = {
402- .usb_mode = T2_USB_MODE_ULPI,
403-};
404-
405-static struct twl4030_codec_audio_data omap3pandora_audio_data;
406-
407-static struct twl4030_codec_data omap3pandora_codec_data = {
408- .audio_mclk = 26000000,
409- .audio = &omap3pandora_audio_data,
410-};
411-
412 static struct twl4030_bci_platform_data pandora_bci_data;
413
414 static struct twl4030_platform_data omap3pandora_twldata = {
415- .irq_base = TWL4030_IRQ_BASE,
416- .irq_end = TWL4030_IRQ_END,
417 .gpio = &omap3pandora_gpio_data,
418- .usb = &omap3pandora_usb_data,
419- .codec = &omap3pandora_codec_data,
420 .vmmc1 = &pandora_vmmc1,
421 .vmmc2 = &pandora_vmmc2,
422 .vdac = &pandora_vdac,
423@@ -548,6 +533,8 @@ static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = {
424
425 static int __init omap3pandora_i2c_init(void)
426 {
427+ omap3_pmic_get_config(&omap3pandora_twldata,
428+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0);
429 omap3_pmic_init("tps65950", &omap3pandora_twldata);
430 /* i2c2 pins are not connected */
431 omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo,
432diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
433index b8ad4dd..6e59e59 100644
434--- a/arch/arm/mach-omap2/board-omap3stalker.c
435+++ b/arch/arm/mach-omap2/board-omap3stalker.c
436@@ -349,10 +349,6 @@ static struct twl4030_gpio_platform_data omap3stalker_gpio_data = {
437 .setup = omap3stalker_twl_gpio_setup,
438 };
439
440-static struct twl4030_usb_data omap3stalker_usb_data = {
441- .usb_mode = T2_USB_MODE_ULPI,
442-};
443-
444 static uint32_t board_keymap[] = {
445 KEY(0, 0, KEY_LEFT),
446 KEY(0, 1, KEY_DOWN),
447@@ -387,17 +383,6 @@ static struct twl4030_keypad_data omap3stalker_kp_data = {
448 .rep = 1,
449 };
450
451-static struct twl4030_madc_platform_data omap3stalker_madc_data = {
452- .irq_line = 1,
453-};
454-
455-static struct twl4030_codec_audio_data omap3stalker_audio_data;
456-
457-static struct twl4030_codec_data omap3stalker_codec_data = {
458- .audio_mclk = 26000000,
459- .audio = &omap3stalker_audio_data,
460-};
461-
462 static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply[] = {
463 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
464 };
465@@ -439,15 +424,9 @@ static struct regulator_init_data omap3_stalker_vpll2 = {
466 };
467
468 static struct twl4030_platform_data omap3stalker_twldata = {
469- .irq_base = TWL4030_IRQ_BASE,
470- .irq_end = TWL4030_IRQ_END,
471-
472 /* platform_data for children goes here */
473 .keypad = &omap3stalker_kp_data,
474- .madc = &omap3stalker_madc_data,
475- .usb = &omap3stalker_usb_data,
476 .gpio = &omap3stalker_gpio_data,
477- .codec = &omap3stalker_codec_data,
478 .vdac = &omap3_stalker_vdac,
479 .vpll2 = &omap3_stalker_vpll2,
480 .vmmc1 = &omap3stalker_vmmc1,
481@@ -470,6 +449,9 @@ static struct i2c_board_info __initdata omap3stalker_i2c_boardinfo3[] = {
482
483 static int __init omap3_stalker_i2c_init(void)
484 {
485+ omap3_pmic_get_config(&omap3stalker_twldata,
486+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC |
487+ TWL_COMMON_PDATA_AUDIO, 0);
488 omap3_pmic_init("twl4030", &omap3stalker_twldata);
489 omap_register_i2c_bus(2, 400, NULL, 0);
490 omap_register_i2c_bus(3, 400, omap3stalker_i2c_boardinfo3,
491diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
492index 57e6ed3..717972c 100644
493--- a/arch/arm/mach-omap2/board-omap3touchbook.c
494+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
495@@ -235,25 +235,9 @@ static struct regulator_init_data touchbook_vpll2 = {
496 .consumer_supplies = touchbook_vdvi_supply,
497 };
498
499-static struct twl4030_usb_data touchbook_usb_data = {
500- .usb_mode = T2_USB_MODE_ULPI,
501-};
502-
503-static struct twl4030_codec_audio_data touchbook_audio_data;
504-
505-static struct twl4030_codec_data touchbook_codec_data = {
506- .audio_mclk = 26000000,
507- .audio = &touchbook_audio_data,
508-};
509-
510 static struct twl4030_platform_data touchbook_twldata = {
511- .irq_base = TWL4030_IRQ_BASE,
512- .irq_end = TWL4030_IRQ_END,
513-
514 /* platform_data for children goes here */
515- .usb = &touchbook_usb_data,
516 .gpio = &touchbook_gpio_data,
517- .codec = &touchbook_codec_data,
518 .vmmc1 = &touchbook_vmmc1,
519 .vsim = &touchbook_vsim,
520 .vdac = &touchbook_vdac,
521@@ -269,8 +253,9 @@ static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = {
522 static int __init omap3_touchbook_i2c_init(void)
523 {
524 /* Standard TouchBook bus */
525+ omap3_pmic_get_config(&touchbook_twldata,
526+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0);
527 omap3_pmic_init("twl4030", &touchbook_twldata);
528-
529 /* Additional TouchBook bus */
530 omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo,
531 ARRAY_SIZE(touchBook_i2c_boardinfo));
532diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
533index 1bf2f39..776b444 100644
534--- a/arch/arm/mach-omap2/board-overo.c
535+++ b/arch/arm/mach-omap2/board-overo.c
536@@ -433,10 +433,6 @@ static struct twl4030_gpio_platform_data overo_gpio_data = {
537 .setup = overo_twl_gpio_setup,
538 };
539
540-static struct twl4030_usb_data overo_usb_data = {
541- .usb_mode = T2_USB_MODE_ULPI,
542-};
543-
544 static struct regulator_init_data overo_vmmc1 = {
545 .constraints = {
546 .min_uV = 1850000,
547@@ -480,19 +476,8 @@ static struct regulator_init_data overo_vpll2 = {
548 .consumer_supplies = overo_vdds_dsi_supply,
549 };
550
551-static struct twl4030_codec_audio_data overo_audio_data;
552-
553-static struct twl4030_codec_data overo_codec_data = {
554- .audio_mclk = 26000000,
555- .audio = &overo_audio_data,
556-};
557-
558 static struct twl4030_platform_data overo_twldata = {
559- .irq_base = TWL4030_IRQ_BASE,
560- .irq_end = TWL4030_IRQ_END,
561 .gpio = &overo_gpio_data,
562- .usb = &overo_usb_data,
563- .codec = &overo_codec_data,
564 .vmmc1 = &overo_vmmc1,
565 .vdac = &overo_vdac,
566 .vpll2 = &overo_vpll2,
567@@ -500,6 +485,8 @@ static struct twl4030_platform_data overo_twldata = {
568
569 static int __init overo_i2c_init(void)
570 {
571+ omap3_pmic_get_config(&overo_twldata,
572+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0);
573 omap3_pmic_init("tps65950", &overo_twldata);
574 /* i2c2 pins are used for gpio */
575 omap_register_i2c_bus(3, 400, NULL, 0);
576diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
577index 54dceb1..7dfed24 100644
578--- a/arch/arm/mach-omap2/board-rm680.c
579+++ b/arch/arm/mach-omap2/board-rm680.c
580@@ -79,20 +79,14 @@ static struct twl4030_gpio_platform_data rm680_gpio_data = {
581 .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15),
582 };
583
584-static struct twl4030_usb_data rm680_usb_data = {
585- .usb_mode = T2_USB_MODE_ULPI,
586-};
587-
588 static struct twl4030_platform_data rm680_twl_data = {
589- .irq_base = TWL4030_IRQ_BASE,
590- .irq_end = TWL4030_IRQ_END,
591 .gpio = &rm680_gpio_data,
592- .usb = &rm680_usb_data,
593 /* add rest of the children here */
594 };
595
596 static void __init rm680_i2c_init(void)
597 {
598+ omap3_pmic_get_config(&rm680_twl_data, TWL_COMMON_PDATA_USB, 0);
599 omap_pmic_init(1, 2900, "twl5031", INT_34XX_SYS_NIRQ, &rm680_twl_data);
600 omap_register_i2c_bus(2, 400, NULL, 0);
601 omap_register_i2c_bus(3, 400, NULL, 0);
602diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
603index 7810b1e..75be074 100644
604--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
605+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
606@@ -288,10 +288,6 @@ static struct twl4030_keypad_data rx51_kp_data = {
607 .rep = 1,
608 };
609
610-static struct twl4030_madc_platform_data rx51_madc_data = {
611- .irq_line = 1,
612-};
613-
614 /* Enable input logic and pull all lines up when eMMC is on. */
615 static struct omap_board_mux rx51_mmc2_on_mux[] = {
616 OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
617@@ -603,10 +599,6 @@ static struct twl4030_gpio_platform_data rx51_gpio_data = {
618 .setup = rx51_twlgpio_setup,
619 };
620
621-static struct twl4030_usb_data rx51_usb_data = {
622- .usb_mode = T2_USB_MODE_ULPI,
623-};
624-
625 static struct twl4030_ins sleep_on_seq[] __initdata = {
626 /*
627 * Turn off everything
628@@ -778,14 +770,9 @@ struct twl4030_codec_data rx51_codec_data __initdata = {
629 };
630
631 static struct twl4030_platform_data rx51_twldata __initdata = {
632- .irq_base = TWL4030_IRQ_BASE,
633- .irq_end = TWL4030_IRQ_END,
634-
635 /* platform_data for children goes here */
636 .gpio = &rx51_gpio_data,
637 .keypad = &rx51_kp_data,
638- .madc = &rx51_madc_data,
639- .usb = &rx51_usb_data,
640 .power = &rx51_t2scripts_data,
641 .codec = &rx51_codec_data,
642
643@@ -850,6 +837,8 @@ static int __init rx51_i2c_init(void)
644 rx51_twldata.vaux3 = &rx51_vaux3_cam;
645 }
646 rx51_twldata.vmmc2 = &rx51_vmmc2;
647+ omap3_pmic_get_config(&rx51_twldata,
648+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC, 0);
649 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata);
650 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
651 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
652diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
653index 8495f82..6d8df1b 100644
654--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
655+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
656@@ -285,26 +285,6 @@ static void zoom2_set_hs_extmute(int mute)
657 gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute);
658 }
659
660-static int zoom_batt_table[] = {
661-/* 0 C*/
662-30800, 29500, 28300, 27100,
663-26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
664-17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
665-11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
666-8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
667-5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
668-4040, 3910, 3790, 3670, 3550
669-};
670-
671-static struct twl4030_bci_platform_data zoom_bci_data = {
672- .battery_tmp_tbl = zoom_batt_table,
673- .tblsize = ARRAY_SIZE(zoom_batt_table),
674-};
675-
676-static struct twl4030_usb_data zoom_usb_data = {
677- .usb_mode = T2_USB_MODE_ULPI,
678-};
679-
680 static struct twl4030_gpio_platform_data zoom_gpio_data = {
681 .gpio_base = OMAP_MAX_GPIO_LINES,
682 .irq_base = TWL4030_GPIO_IRQ_BASE,
683@@ -312,28 +292,10 @@ static struct twl4030_gpio_platform_data zoom_gpio_data = {
684 .setup = zoom_twl_gpio_setup,
685 };
686
687-static struct twl4030_madc_platform_data zoom_madc_data = {
688- .irq_line = 1,
689-};
690-
691-static struct twl4030_codec_audio_data zoom_audio_data;
692-
693-static struct twl4030_codec_data zoom_codec_data = {
694- .audio_mclk = 26000000,
695- .audio = &zoom_audio_data,
696-};
697-
698 static struct twl4030_platform_data zoom_twldata = {
699- .irq_base = TWL4030_IRQ_BASE,
700- .irq_end = TWL4030_IRQ_END,
701-
702 /* platform_data for children goes here */
703- .bci = &zoom_bci_data,
704- .madc = &zoom_madc_data,
705- .usb = &zoom_usb_data,
706 .gpio = &zoom_gpio_data,
707 .keypad = &zoom_kp_twl4030_data,
708- .codec = &zoom_codec_data,
709 .vmmc1 = &zoom_vmmc1,
710 .vmmc2 = &zoom_vmmc2,
711 .vsim = &zoom_vsim,
712@@ -343,10 +305,17 @@ static struct twl4030_platform_data zoom_twldata = {
713
714 static int __init omap_i2c_init(void)
715 {
716+ omap3_pmic_get_config(&zoom_twldata,
717+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
718+ TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, 0);
719+
720 if (machine_is_omap_zoom2()) {
721- zoom_audio_data.ramp_delay_value = 3; /* 161 ms */
722- zoom_audio_data.hs_extmute = 1;
723- zoom_audio_data.set_hs_extmute = zoom2_set_hs_extmute;
724+ struct twl4030_codec_audio_data *audio_data;
725+ audio_data = zoom_twldata.codec->audio;
726+
727+ audio_data->ramp_delay_value = 3; /* 161 ms */
728+ audio_data->hs_extmute = 1;
729+ audio_data->set_hs_extmute = zoom2_set_hs_extmute;
730 }
731 omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata);
732 omap_register_i2c_bus(2, 400, NULL, 0);
733diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
734index cf80f4c..9e8decf 100644
735--- a/arch/arm/mach-omap2/twl-common.c
736+++ b/arch/arm/mach-omap2/twl-common.c
737@@ -56,6 +56,37 @@ static struct twl4030_usb_data omap4_usb_pdata = {
738 .phy_suspend = omap4430_phy_suspend,
739 };
740
741+static struct twl4030_usb_data omap3_usb_pdata = {
742+ .usb_mode = T2_USB_MODE_ULPI,
743+};
744+
745+static int omap3_batt_table[] = {
746+/* 0 C */
747+30800, 29500, 28300, 27100,
748+26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
749+17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
750+11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
751+8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
752+5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
753+4040, 3910, 3790, 3670, 3550
754+};
755+
756+static struct twl4030_bci_platform_data omap3_bci_pdata = {
757+ .battery_tmp_tbl = omap3_batt_table,
758+ .tblsize = ARRAY_SIZE(omap3_batt_table),
759+};
760+
761+static struct twl4030_madc_platform_data omap3_madc_pdata = {
762+ .irq_line = 1,
763+};
764+
765+static struct twl4030_codec_audio_data omap3_audio;
766+
767+static struct twl4030_codec_data omap3_codec_pdata = {
768+ .audio_mclk = 26000000,
769+ .audio = &omap3_audio,
770+};
771+
772 static struct regulator_init_data omap4_vdac_idata = {
773 .constraints = {
774 .min_uV = 1800000,
775@@ -207,3 +238,25 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
776 !pmic_data->clk32kg)
777 pmic_data->clk32kg = &omap4_clk32kg_idata;
778 }
779+
780+void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
781+ u32 pdata_flags, u32 regulators_flags)
782+{
783+ if (!pmic_data->irq_base)
784+ pmic_data->irq_base = TWL4030_IRQ_BASE;
785+ if (!pmic_data->irq_end)
786+ pmic_data->irq_end = TWL4030_IRQ_END;
787+
788+ /* Common platform data configurations */
789+ if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)
790+ pmic_data->usb = &omap3_usb_pdata;
791+
792+ if (pdata_flags & TWL_COMMON_PDATA_BCI && !pmic_data->bci)
793+ pmic_data->bci = &omap3_bci_pdata;
794+
795+ if (pdata_flags & TWL_COMMON_PDATA_MADC && !pmic_data->madc)
796+ pmic_data->madc = &omap3_madc_pdata;
797+
798+ if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->codec)
799+ pmic_data->codec = &omap3_codec_pdata;
800+}
801diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
802index d96c289..3b4b05d 100644
803--- a/arch/arm/mach-omap2/twl-common.h
804+++ b/arch/arm/mach-omap2/twl-common.h
805@@ -2,6 +2,9 @@
806 #define __OMAP_PMIC_COMMON__
807
808 #define TWL_COMMON_PDATA_USB (1 << 0)
809+#define TWL_COMMON_PDATA_BCI (1 << 1)
810+#define TWL_COMMON_PDATA_MADC (1 << 2)
811+#define TWL_COMMON_PDATA_AUDIO (1 << 3)
812
813 /* Common LDO regulators for TWL4030/TWL6030 */
814 #define TWL_COMMON_REGULATOR_VDAC (1 << 0)
815@@ -42,6 +45,9 @@ static inline void omap4_pmic_init(const char *pmic_type,
816 omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data);
817 }
818
819+void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
820+ u32 pdata_flags, u32 regulators_flags);
821+
822 void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
823 u32 pdata_flags, u32 regulators_flags);
824
825--
8261.6.6.1
827