diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-06-07 03:28:54 -0400 |
---|---|---|
committer | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-07-04 11:43:38 -0400 |
commit | 827ed9aef2f13000d58616384ea6a22497e787b6 (patch) | |
tree | fd6d117feaa7ac9c9e6195224efff07f230e867a /arch/arm | |
parent | b22f954bae35be115a10c6426dc070f7d652b32e (diff) |
OMAP3: Move common twl configuration to twl-common
Reduce the amount of duplicated code by moving the common
configuration for twl4030/5030/tpsxx to the twl-common file.
Use the omap3_pmic_get_config function from board files to
properly configure the PMIC with the common fields.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/board-3430sdp.c | 42 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-cm-t35.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-devkit8000.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-igep0020.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-ldp.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3pandora.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3stalker.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3touchbook.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-overo.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-rm680.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-zoom-peripherals.c | 51 | ||||
-rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 53 | ||||
-rw-r--r-- | arch/arm/mach-omap2/twl-common.h | 6 |
16 files changed, 99 insertions, 257 deletions
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 12fae21346cf..8bbd4e0246b0 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -231,22 +231,6 @@ static void __init omap_3430sdp_init_early(void) | |||
231 | omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); | 231 | omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); |
232 | } | 232 | } |
233 | 233 | ||
234 | static int sdp3430_batt_table[] = { | ||
235 | /* 0 C*/ | ||
236 | 30800, 29500, 28300, 27100, | ||
237 | 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900, | ||
238 | 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100, | ||
239 | 11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310, | ||
240 | 8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830, | ||
241 | 5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170, | ||
242 | 4040, 3910, 3790, 3670, 3550 | ||
243 | }; | ||
244 | |||
245 | static struct twl4030_bci_platform_data sdp3430_bci_data = { | ||
246 | .battery_tmp_tbl = sdp3430_batt_table, | ||
247 | .tblsize = ARRAY_SIZE(sdp3430_batt_table), | ||
248 | }; | ||
249 | |||
250 | static struct omap2_hsmmc_info mmc[] = { | 234 | static struct omap2_hsmmc_info mmc[] = { |
251 | { | 235 | { |
252 | .mmc = 1, | 236 | .mmc = 1, |
@@ -292,14 +276,6 @@ static struct twl4030_gpio_platform_data sdp3430_gpio_data = { | |||
292 | .setup = sdp3430_twl_gpio_setup, | 276 | .setup = sdp3430_twl_gpio_setup, |
293 | }; | 277 | }; |
294 | 278 | ||
295 | static struct twl4030_usb_data sdp3430_usb_data = { | ||
296 | .usb_mode = T2_USB_MODE_ULPI, | ||
297 | }; | ||
298 | |||
299 | static struct twl4030_madc_platform_data sdp3430_madc_data = { | ||
300 | .irq_line = 1, | ||
301 | }; | ||
302 | |||
303 | /* regulator consumer mappings */ | 279 | /* regulator consumer mappings */ |
304 | 280 | ||
305 | /* ads7846 on SPI */ | 281 | /* ads7846 on SPI */ |
@@ -463,24 +439,10 @@ static struct regulator_init_data sdp3430_vpll2 = { | |||
463 | .consumer_supplies = sdp3430_vpll2_supplies, | 439 | .consumer_supplies = sdp3430_vpll2_supplies, |
464 | }; | 440 | }; |
465 | 441 | ||
466 | static struct twl4030_codec_audio_data sdp3430_audio; | ||
467 | |||
468 | static struct twl4030_codec_data sdp3430_codec = { | ||
469 | .audio_mclk = 26000000, | ||
470 | .audio = &sdp3430_audio, | ||
471 | }; | ||
472 | |||
473 | static struct twl4030_platform_data sdp3430_twldata = { | 442 | static struct twl4030_platform_data sdp3430_twldata = { |
474 | .irq_base = TWL4030_IRQ_BASE, | ||
475 | .irq_end = TWL4030_IRQ_END, | ||
476 | |||
477 | /* platform_data for children goes here */ | 443 | /* platform_data for children goes here */ |
478 | .bci = &sdp3430_bci_data, | ||
479 | .gpio = &sdp3430_gpio_data, | 444 | .gpio = &sdp3430_gpio_data, |
480 | .madc = &sdp3430_madc_data, | ||
481 | .keypad = &sdp3430_kp_data, | 445 | .keypad = &sdp3430_kp_data, |
482 | .usb = &sdp3430_usb_data, | ||
483 | .codec = &sdp3430_codec, | ||
484 | 446 | ||
485 | .vaux1 = &sdp3430_vaux1, | 447 | .vaux1 = &sdp3430_vaux1, |
486 | .vaux2 = &sdp3430_vaux2, | 448 | .vaux2 = &sdp3430_vaux2, |
@@ -496,7 +458,11 @@ static struct twl4030_platform_data sdp3430_twldata = { | |||
496 | static int __init omap3430_i2c_init(void) | 458 | static int __init omap3430_i2c_init(void) |
497 | { | 459 | { |
498 | /* i2c1 for PMIC only */ | 460 | /* i2c1 for PMIC only */ |
461 | omap3_pmic_get_config(&sdp3430_twldata, | ||
462 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI | | ||
463 | TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, 0); | ||
499 | omap3_pmic_init("twl4030", &sdp3430_twldata); | 464 | omap3_pmic_init("twl4030", &sdp3430_twldata); |
465 | |||
500 | /* i2c2 on camera connector (for sensor control) and optional isp1301 */ | 466 | /* i2c2 on camera connector (for sensor control) and optional isp1301 */ |
501 | omap_register_i2c_bus(2, 400, NULL, 0); | 467 | omap_register_i2c_bus(2, 400, NULL, 0); |
502 | /* i2c3 on display connector (for DVI, tfp410) */ | 468 | /* i2c3 on display connector (for DVI, tfp410) */ |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index d76dca788540..cb00abc4dd5d 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -410,10 +410,6 @@ static struct regulator_init_data cm_t35_vpll2 = { | |||
410 | .consumer_supplies = cm_t35_vdvi_supply, | 410 | .consumer_supplies = cm_t35_vdvi_supply, |
411 | }; | 411 | }; |
412 | 412 | ||
413 | static struct twl4030_usb_data cm_t35_usb_data = { | ||
414 | .usb_mode = T2_USB_MODE_ULPI, | ||
415 | }; | ||
416 | |||
417 | static uint32_t cm_t35_keymap[] = { | 413 | static uint32_t cm_t35_keymap[] = { |
418 | KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT), | 414 | KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT), |
419 | KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN), | 415 | KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN), |
@@ -492,12 +488,8 @@ static struct twl4030_gpio_platform_data cm_t35_gpio_data = { | |||
492 | }; | 488 | }; |
493 | 489 | ||
494 | static struct twl4030_platform_data cm_t35_twldata = { | 490 | static struct twl4030_platform_data cm_t35_twldata = { |
495 | .irq_base = TWL4030_IRQ_BASE, | ||
496 | .irq_end = TWL4030_IRQ_END, | ||
497 | |||
498 | /* platform_data for children goes here */ | 491 | /* platform_data for children goes here */ |
499 | .keypad = &cm_t35_kp_data, | 492 | .keypad = &cm_t35_kp_data, |
500 | .usb = &cm_t35_usb_data, | ||
501 | .gpio = &cm_t35_gpio_data, | 493 | .gpio = &cm_t35_gpio_data, |
502 | .vmmc1 = &cm_t35_vmmc1, | 494 | .vmmc1 = &cm_t35_vmmc1, |
503 | .vsim = &cm_t35_vsim, | 495 | .vsim = &cm_t35_vsim, |
@@ -507,6 +499,7 @@ static struct twl4030_platform_data cm_t35_twldata = { | |||
507 | 499 | ||
508 | static void __init cm_t35_init_i2c(void) | 500 | static void __init cm_t35_init_i2c(void) |
509 | { | 501 | { |
502 | omap3_pmic_get_config(&cm_t35_twldata, TWL_COMMON_PDATA_USB, 0); | ||
510 | omap3_pmic_init("tps65930", &cm_t35_twldata); | 503 | omap3_pmic_init("tps65930", &cm_t35_twldata); |
511 | } | 504 | } |
512 | 505 | ||
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 949dbeabab26..364942ed36cc 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -332,25 +332,9 @@ static struct regulator_init_data devkit8000_vio = { | |||
332 | .consumer_supplies = devkit8000_vio_supply, | 332 | .consumer_supplies = devkit8000_vio_supply, |
333 | }; | 333 | }; |
334 | 334 | ||
335 | static struct twl4030_usb_data devkit8000_usb_data = { | ||
336 | .usb_mode = T2_USB_MODE_ULPI, | ||
337 | }; | ||
338 | |||
339 | static struct twl4030_codec_audio_data devkit8000_audio_data; | ||
340 | |||
341 | static struct twl4030_codec_data devkit8000_codec_data = { | ||
342 | .audio_mclk = 26000000, | ||
343 | .audio = &devkit8000_audio_data, | ||
344 | }; | ||
345 | |||
346 | static struct twl4030_platform_data devkit8000_twldata = { | 335 | static struct twl4030_platform_data devkit8000_twldata = { |
347 | .irq_base = TWL4030_IRQ_BASE, | ||
348 | .irq_end = TWL4030_IRQ_END, | ||
349 | |||
350 | /* platform_data for children goes here */ | 336 | /* platform_data for children goes here */ |
351 | .usb = &devkit8000_usb_data, | ||
352 | .gpio = &devkit8000_gpio_data, | 337 | .gpio = &devkit8000_gpio_data, |
353 | .codec = &devkit8000_codec_data, | ||
354 | .vmmc1 = &devkit8000_vmmc1, | 338 | .vmmc1 = &devkit8000_vmmc1, |
355 | .vdac = &devkit8000_vdac, | 339 | .vdac = &devkit8000_vdac, |
356 | .vpll1 = &devkit8000_vpll1, | 340 | .vpll1 = &devkit8000_vpll1, |
@@ -360,6 +344,8 @@ static struct twl4030_platform_data devkit8000_twldata = { | |||
360 | 344 | ||
361 | static int __init devkit8000_i2c_init(void) | 345 | static int __init devkit8000_i2c_init(void) |
362 | { | 346 | { |
347 | omap3_pmic_get_config(&devkit8000_twldata, | ||
348 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0); | ||
363 | omap3_pmic_init("tps65930", &devkit8000_twldata); | 349 | omap3_pmic_init("tps65930", &devkit8000_twldata); |
364 | /* Bus 3 is attached to the DVI port where devices like the pico DLP | 350 | /* Bus 3 is attached to the DVI port where devices like the pico DLP |
365 | * projector don't work reliably with 400kHz */ | 351 | * projector don't work reliably with 400kHz */ |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index f683835f936c..e0a66878112b 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -443,10 +443,6 @@ static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = { | |||
443 | .setup = igep_twl_gpio_setup, | 443 | .setup = igep_twl_gpio_setup, |
444 | }; | 444 | }; |
445 | 445 | ||
446 | static struct twl4030_usb_data igep_usb_data = { | ||
447 | .usb_mode = T2_USB_MODE_ULPI, | ||
448 | }; | ||
449 | |||
450 | static int igep2_enable_dvi(struct omap_dss_device *dssdev) | 446 | static int igep2_enable_dvi(struct omap_dss_device *dssdev) |
451 | { | 447 | { |
452 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1); | 448 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1); |
@@ -522,13 +518,6 @@ static void __init igep_init_early(void) | |||
522 | m65kxxxxam_sdrc_params); | 518 | m65kxxxxam_sdrc_params); |
523 | } | 519 | } |
524 | 520 | ||
525 | static struct twl4030_codec_audio_data igep2_audio_data; | ||
526 | |||
527 | static struct twl4030_codec_data igep2_codec_data = { | ||
528 | .audio_mclk = 26000000, | ||
529 | .audio = &igep2_audio_data, | ||
530 | }; | ||
531 | |||
532 | static int igep2_keymap[] = { | 521 | static int igep2_keymap[] = { |
533 | KEY(0, 0, KEY_LEFT), | 522 | KEY(0, 0, KEY_LEFT), |
534 | KEY(0, 1, KEY_RIGHT), | 523 | KEY(0, 1, KEY_RIGHT), |
@@ -561,11 +550,7 @@ static struct twl4030_keypad_data igep2_keypad_pdata = { | |||
561 | }; | 550 | }; |
562 | 551 | ||
563 | static struct twl4030_platform_data igep_twldata = { | 552 | static struct twl4030_platform_data igep_twldata = { |
564 | .irq_base = TWL4030_IRQ_BASE, | ||
565 | .irq_end = TWL4030_IRQ_END, | ||
566 | |||
567 | /* platform_data for children goes here */ | 553 | /* platform_data for children goes here */ |
568 | .usb = &igep_usb_data, | ||
569 | .gpio = &igep_twl4030_gpio_pdata, | 554 | .gpio = &igep_twl4030_gpio_pdata, |
570 | .vmmc1 = &igep_vmmc1, | 555 | .vmmc1 = &igep_vmmc1, |
571 | .vio = &igep_vio, | 556 | .vio = &igep_vio, |
@@ -581,6 +566,8 @@ static void __init igep_i2c_init(void) | |||
581 | { | 566 | { |
582 | int ret; | 567 | int ret; |
583 | 568 | ||
569 | omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_USB, 0); | ||
570 | |||
584 | if (machine_is_igep0020()) { | 571 | if (machine_is_igep0020()) { |
585 | /* | 572 | /* |
586 | * Bus 3 is attached to the DVI port where devices like the | 573 | * Bus 3 is attached to the DVI port where devices like the |
@@ -591,9 +578,10 @@ static void __init igep_i2c_init(void) | |||
591 | if (ret) | 578 | if (ret) |
592 | pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret); | 579 | pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret); |
593 | 580 | ||
594 | igep_twldata.codec = &igep2_codec_data; | ||
595 | igep_twldata.keypad = &igep2_keypad_pdata; | 581 | igep_twldata.keypad = &igep2_keypad_pdata; |
596 | igep_twldata.vpll2 = &igep2_vpll2; | 582 | igep_twldata.vpll2 = &igep2_vpll2; |
583 | /* Use common codec data */ | ||
584 | omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_AUDIO, 0); | ||
597 | } | 585 | } |
598 | 586 | ||
599 | omap3_pmic_init("twl4030", &igep_twldata); | 587 | omap3_pmic_init("twl4030", &igep_twldata); |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 5d4328f19c0f..218764c9377e 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -199,20 +199,12 @@ static void __init omap_ldp_init_early(void) | |||
199 | omap2_init_common_devices(NULL, NULL); | 199 | omap2_init_common_devices(NULL, NULL); |
200 | } | 200 | } |
201 | 201 | ||
202 | static struct twl4030_usb_data ldp_usb_data = { | ||
203 | .usb_mode = T2_USB_MODE_ULPI, | ||
204 | }; | ||
205 | |||
206 | static struct twl4030_gpio_platform_data ldp_gpio_data = { | 202 | static struct twl4030_gpio_platform_data ldp_gpio_data = { |
207 | .gpio_base = OMAP_MAX_GPIO_LINES, | 203 | .gpio_base = OMAP_MAX_GPIO_LINES, |
208 | .irq_base = TWL4030_GPIO_IRQ_BASE, | 204 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
209 | .irq_end = TWL4030_GPIO_IRQ_END, | 205 | .irq_end = TWL4030_GPIO_IRQ_END, |
210 | }; | 206 | }; |
211 | 207 | ||
212 | static struct twl4030_madc_platform_data ldp_madc_data = { | ||
213 | .irq_line = 1, | ||
214 | }; | ||
215 | |||
216 | static struct regulator_consumer_supply ldp_vmmc1_supply[] = { | 208 | static struct regulator_consumer_supply ldp_vmmc1_supply[] = { |
217 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | 209 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
218 | }; | 210 | }; |
@@ -253,12 +245,7 @@ static struct regulator_init_data ldp_vaux1 = { | |||
253 | }; | 245 | }; |
254 | 246 | ||
255 | static struct twl4030_platform_data ldp_twldata = { | 247 | static struct twl4030_platform_data ldp_twldata = { |
256 | .irq_base = TWL4030_IRQ_BASE, | ||
257 | .irq_end = TWL4030_IRQ_END, | ||
258 | |||
259 | /* platform_data for children goes here */ | 248 | /* platform_data for children goes here */ |
260 | .madc = &ldp_madc_data, | ||
261 | .usb = &ldp_usb_data, | ||
262 | .vmmc1 = &ldp_vmmc1, | 249 | .vmmc1 = &ldp_vmmc1, |
263 | .vaux1 = &ldp_vaux1, | 250 | .vaux1 = &ldp_vaux1, |
264 | .gpio = &ldp_gpio_data, | 251 | .gpio = &ldp_gpio_data, |
@@ -267,6 +254,8 @@ static struct twl4030_platform_data ldp_twldata = { | |||
267 | 254 | ||
268 | static int __init omap_i2c_init(void) | 255 | static int __init omap_i2c_init(void) |
269 | { | 256 | { |
257 | omap3_pmic_get_config(&ldp_twldata, | ||
258 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC, 0); | ||
270 | omap3_pmic_init("twl4030", &ldp_twldata); | 259 | omap3_pmic_init("twl4030", &ldp_twldata); |
271 | omap_register_i2c_bus(2, 400, NULL, 0); | 260 | omap_register_i2c_bus(2, 400, NULL, 0); |
272 | omap_register_i2c_bus(3, 400, NULL, 0); | 261 | omap_register_i2c_bus(3, 400, NULL, 0); |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 2d8dfb3213bf..ec61e9c460b2 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -380,25 +380,9 @@ static struct regulator_init_data beagle_vpll2 = { | |||
380 | .consumer_supplies = beagle_vdvi_supplies, | 380 | .consumer_supplies = beagle_vdvi_supplies, |
381 | }; | 381 | }; |
382 | 382 | ||
383 | static struct twl4030_usb_data beagle_usb_data = { | ||
384 | .usb_mode = T2_USB_MODE_ULPI, | ||
385 | }; | ||
386 | |||
387 | static struct twl4030_codec_audio_data beagle_audio_data; | ||
388 | |||
389 | static struct twl4030_codec_data beagle_codec_data = { | ||
390 | .audio_mclk = 26000000, | ||
391 | .audio = &beagle_audio_data, | ||
392 | }; | ||
393 | |||
394 | static struct twl4030_platform_data beagle_twldata = { | 383 | static struct twl4030_platform_data beagle_twldata = { |
395 | .irq_base = TWL4030_IRQ_BASE, | ||
396 | .irq_end = TWL4030_IRQ_END, | ||
397 | |||
398 | /* platform_data for children goes here */ | 384 | /* platform_data for children goes here */ |
399 | .usb = &beagle_usb_data, | ||
400 | .gpio = &beagle_gpio_data, | 385 | .gpio = &beagle_gpio_data, |
401 | .codec = &beagle_codec_data, | ||
402 | .vmmc1 = &beagle_vmmc1, | 386 | .vmmc1 = &beagle_vmmc1, |
403 | .vsim = &beagle_vsim, | 387 | .vsim = &beagle_vsim, |
404 | .vdac = &beagle_vdac, | 388 | .vdac = &beagle_vdac, |
@@ -413,6 +397,8 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { | |||
413 | 397 | ||
414 | static int __init omap3_beagle_i2c_init(void) | 398 | static int __init omap3_beagle_i2c_init(void) |
415 | { | 399 | { |
400 | omap3_pmic_get_config(&beagle_twldata, | ||
401 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0); | ||
416 | omap3_pmic_init("twl4030", &beagle_twldata); | 402 | omap3_pmic_init("twl4030", &beagle_twldata); |
417 | /* Bus 3 is attached to the DVI port where devices like the pico DLP | 403 | /* Bus 3 is attached to the DVI port where devices like the pico DLP |
418 | * projector don't work reliably with 400kHz */ | 404 | * projector don't work reliably with 400kHz */ |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 57bce0f2e195..1ca298a17623 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -396,10 +396,6 @@ static struct twl4030_gpio_platform_data omap3evm_gpio_data = { | |||
396 | .setup = omap3evm_twl_gpio_setup, | 396 | .setup = omap3evm_twl_gpio_setup, |
397 | }; | 397 | }; |
398 | 398 | ||
399 | static struct twl4030_usb_data omap3evm_usb_data = { | ||
400 | .usb_mode = T2_USB_MODE_ULPI, | ||
401 | }; | ||
402 | |||
403 | static uint32_t board_keymap[] = { | 399 | static uint32_t board_keymap[] = { |
404 | KEY(0, 0, KEY_LEFT), | 400 | KEY(0, 0, KEY_LEFT), |
405 | KEY(0, 1, KEY_DOWN), | 401 | KEY(0, 1, KEY_DOWN), |
@@ -434,17 +430,6 @@ static struct twl4030_keypad_data omap3evm_kp_data = { | |||
434 | .rep = 1, | 430 | .rep = 1, |
435 | }; | 431 | }; |
436 | 432 | ||
437 | static struct twl4030_madc_platform_data omap3evm_madc_data = { | ||
438 | .irq_line = 1, | ||
439 | }; | ||
440 | |||
441 | static struct twl4030_codec_audio_data omap3evm_audio_data; | ||
442 | |||
443 | static struct twl4030_codec_data omap3evm_codec_data = { | ||
444 | .audio_mclk = 26000000, | ||
445 | .audio = &omap3evm_audio_data, | ||
446 | }; | ||
447 | |||
448 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply[] = { | 433 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply[] = { |
449 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), | 434 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
450 | }; | 435 | }; |
@@ -547,15 +532,9 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = { | |||
547 | #endif | 532 | #endif |
548 | 533 | ||
549 | static struct twl4030_platform_data omap3evm_twldata = { | 534 | static struct twl4030_platform_data omap3evm_twldata = { |
550 | .irq_base = TWL4030_IRQ_BASE, | ||
551 | .irq_end = TWL4030_IRQ_END, | ||
552 | |||
553 | /* platform_data for children goes here */ | 535 | /* platform_data for children goes here */ |
554 | .keypad = &omap3evm_kp_data, | 536 | .keypad = &omap3evm_kp_data, |
555 | .madc = &omap3evm_madc_data, | ||
556 | .usb = &omap3evm_usb_data, | ||
557 | .gpio = &omap3evm_gpio_data, | 537 | .gpio = &omap3evm_gpio_data, |
558 | .codec = &omap3evm_codec_data, | ||
559 | .vdac = &omap3_evm_vdac, | 538 | .vdac = &omap3_evm_vdac, |
560 | .vpll2 = &omap3_evm_vpll2, | 539 | .vpll2 = &omap3_evm_vpll2, |
561 | .vio = &omap3evm_vio, | 540 | .vio = &omap3evm_vio, |
@@ -565,6 +544,9 @@ static struct twl4030_platform_data omap3evm_twldata = { | |||
565 | 544 | ||
566 | static int __init omap3_evm_i2c_init(void) | 545 | static int __init omap3_evm_i2c_init(void) |
567 | { | 546 | { |
547 | omap3_pmic_get_config(&omap3evm_twldata, | ||
548 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC | | ||
549 | TWL_COMMON_PDATA_AUDIO, 0); | ||
568 | omap3_pmic_init("twl4030", &omap3evm_twldata); | 550 | omap3_pmic_init("twl4030", &omap3evm_twldata); |
569 | omap_register_i2c_bus(2, 400, NULL, 0); | 551 | omap_register_i2c_bus(2, 400, NULL, 0); |
570 | omap_register_i2c_bus(3, 400, NULL, 0); | 552 | omap_register_i2c_bus(3, 400, NULL, 0); |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index d4ea9408560e..f5abf766db4f 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -508,25 +508,10 @@ static struct platform_device pandora_vwlan_device = { | |||
508 | }, | 508 | }, |
509 | }; | 509 | }; |
510 | 510 | ||
511 | static struct twl4030_usb_data omap3pandora_usb_data = { | ||
512 | .usb_mode = T2_USB_MODE_ULPI, | ||
513 | }; | ||
514 | |||
515 | static struct twl4030_codec_audio_data omap3pandora_audio_data; | ||
516 | |||
517 | static struct twl4030_codec_data omap3pandora_codec_data = { | ||
518 | .audio_mclk = 26000000, | ||
519 | .audio = &omap3pandora_audio_data, | ||
520 | }; | ||
521 | |||
522 | static struct twl4030_bci_platform_data pandora_bci_data; | 511 | static struct twl4030_bci_platform_data pandora_bci_data; |
523 | 512 | ||
524 | static struct twl4030_platform_data omap3pandora_twldata = { | 513 | static struct twl4030_platform_data omap3pandora_twldata = { |
525 | .irq_base = TWL4030_IRQ_BASE, | ||
526 | .irq_end = TWL4030_IRQ_END, | ||
527 | .gpio = &omap3pandora_gpio_data, | 514 | .gpio = &omap3pandora_gpio_data, |
528 | .usb = &omap3pandora_usb_data, | ||
529 | .codec = &omap3pandora_codec_data, | ||
530 | .vmmc1 = &pandora_vmmc1, | 515 | .vmmc1 = &pandora_vmmc1, |
531 | .vmmc2 = &pandora_vmmc2, | 516 | .vmmc2 = &pandora_vmmc2, |
532 | .vdac = &pandora_vdac, | 517 | .vdac = &pandora_vdac, |
@@ -548,6 +533,8 @@ static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = { | |||
548 | 533 | ||
549 | static int __init omap3pandora_i2c_init(void) | 534 | static int __init omap3pandora_i2c_init(void) |
550 | { | 535 | { |
536 | omap3_pmic_get_config(&omap3pandora_twldata, | ||
537 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0); | ||
551 | omap3_pmic_init("tps65950", &omap3pandora_twldata); | 538 | omap3_pmic_init("tps65950", &omap3pandora_twldata); |
552 | /* i2c2 pins are not connected */ | 539 | /* i2c2 pins are not connected */ |
553 | omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo, | 540 | omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo, |
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index b8ad4dd5bbbf..6e59e59c0fbb 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -349,10 +349,6 @@ static struct twl4030_gpio_platform_data omap3stalker_gpio_data = { | |||
349 | .setup = omap3stalker_twl_gpio_setup, | 349 | .setup = omap3stalker_twl_gpio_setup, |
350 | }; | 350 | }; |
351 | 351 | ||
352 | static struct twl4030_usb_data omap3stalker_usb_data = { | ||
353 | .usb_mode = T2_USB_MODE_ULPI, | ||
354 | }; | ||
355 | |||
356 | static uint32_t board_keymap[] = { | 352 | static uint32_t board_keymap[] = { |
357 | KEY(0, 0, KEY_LEFT), | 353 | KEY(0, 0, KEY_LEFT), |
358 | KEY(0, 1, KEY_DOWN), | 354 | KEY(0, 1, KEY_DOWN), |
@@ -387,17 +383,6 @@ static struct twl4030_keypad_data omap3stalker_kp_data = { | |||
387 | .rep = 1, | 383 | .rep = 1, |
388 | }; | 384 | }; |
389 | 385 | ||
390 | static struct twl4030_madc_platform_data omap3stalker_madc_data = { | ||
391 | .irq_line = 1, | ||
392 | }; | ||
393 | |||
394 | static struct twl4030_codec_audio_data omap3stalker_audio_data; | ||
395 | |||
396 | static struct twl4030_codec_data omap3stalker_codec_data = { | ||
397 | .audio_mclk = 26000000, | ||
398 | .audio = &omap3stalker_audio_data, | ||
399 | }; | ||
400 | |||
401 | static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply[] = { | 386 | static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply[] = { |
402 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), | 387 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), |
403 | }; | 388 | }; |
@@ -439,15 +424,9 @@ static struct regulator_init_data omap3_stalker_vpll2 = { | |||
439 | }; | 424 | }; |
440 | 425 | ||
441 | static struct twl4030_platform_data omap3stalker_twldata = { | 426 | static struct twl4030_platform_data omap3stalker_twldata = { |
442 | .irq_base = TWL4030_IRQ_BASE, | ||
443 | .irq_end = TWL4030_IRQ_END, | ||
444 | |||
445 | /* platform_data for children goes here */ | 427 | /* platform_data for children goes here */ |
446 | .keypad = &omap3stalker_kp_data, | 428 | .keypad = &omap3stalker_kp_data, |
447 | .madc = &omap3stalker_madc_data, | ||
448 | .usb = &omap3stalker_usb_data, | ||
449 | .gpio = &omap3stalker_gpio_data, | 429 | .gpio = &omap3stalker_gpio_data, |
450 | .codec = &omap3stalker_codec_data, | ||
451 | .vdac = &omap3_stalker_vdac, | 430 | .vdac = &omap3_stalker_vdac, |
452 | .vpll2 = &omap3_stalker_vpll2, | 431 | .vpll2 = &omap3_stalker_vpll2, |
453 | .vmmc1 = &omap3stalker_vmmc1, | 432 | .vmmc1 = &omap3stalker_vmmc1, |
@@ -470,6 +449,9 @@ static struct i2c_board_info __initdata omap3stalker_i2c_boardinfo3[] = { | |||
470 | 449 | ||
471 | static int __init omap3_stalker_i2c_init(void) | 450 | static int __init omap3_stalker_i2c_init(void) |
472 | { | 451 | { |
452 | omap3_pmic_get_config(&omap3stalker_twldata, | ||
453 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC | | ||
454 | TWL_COMMON_PDATA_AUDIO, 0); | ||
473 | omap3_pmic_init("twl4030", &omap3stalker_twldata); | 455 | omap3_pmic_init("twl4030", &omap3stalker_twldata); |
474 | omap_register_i2c_bus(2, 400, NULL, 0); | 456 | omap_register_i2c_bus(2, 400, NULL, 0); |
475 | omap_register_i2c_bus(3, 400, omap3stalker_i2c_boardinfo3, | 457 | omap_register_i2c_bus(3, 400, omap3stalker_i2c_boardinfo3, |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 57e6ed34ebbc..717972c5ce3e 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -235,25 +235,9 @@ static struct regulator_init_data touchbook_vpll2 = { | |||
235 | .consumer_supplies = touchbook_vdvi_supply, | 235 | .consumer_supplies = touchbook_vdvi_supply, |
236 | }; | 236 | }; |
237 | 237 | ||
238 | static struct twl4030_usb_data touchbook_usb_data = { | ||
239 | .usb_mode = T2_USB_MODE_ULPI, | ||
240 | }; | ||
241 | |||
242 | static struct twl4030_codec_audio_data touchbook_audio_data; | ||
243 | |||
244 | static struct twl4030_codec_data touchbook_codec_data = { | ||
245 | .audio_mclk = 26000000, | ||
246 | .audio = &touchbook_audio_data, | ||
247 | }; | ||
248 | |||
249 | static struct twl4030_platform_data touchbook_twldata = { | 238 | static struct twl4030_platform_data touchbook_twldata = { |
250 | .irq_base = TWL4030_IRQ_BASE, | ||
251 | .irq_end = TWL4030_IRQ_END, | ||
252 | |||
253 | /* platform_data for children goes here */ | 239 | /* platform_data for children goes here */ |
254 | .usb = &touchbook_usb_data, | ||
255 | .gpio = &touchbook_gpio_data, | 240 | .gpio = &touchbook_gpio_data, |
256 | .codec = &touchbook_codec_data, | ||
257 | .vmmc1 = &touchbook_vmmc1, | 241 | .vmmc1 = &touchbook_vmmc1, |
258 | .vsim = &touchbook_vsim, | 242 | .vsim = &touchbook_vsim, |
259 | .vdac = &touchbook_vdac, | 243 | .vdac = &touchbook_vdac, |
@@ -269,8 +253,9 @@ static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = { | |||
269 | static int __init omap3_touchbook_i2c_init(void) | 253 | static int __init omap3_touchbook_i2c_init(void) |
270 | { | 254 | { |
271 | /* Standard TouchBook bus */ | 255 | /* Standard TouchBook bus */ |
256 | omap3_pmic_get_config(&touchbook_twldata, | ||
257 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0); | ||
272 | omap3_pmic_init("twl4030", &touchbook_twldata); | 258 | omap3_pmic_init("twl4030", &touchbook_twldata); |
273 | |||
274 | /* Additional TouchBook bus */ | 259 | /* Additional TouchBook bus */ |
275 | omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo, | 260 | omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo, |
276 | ARRAY_SIZE(touchBook_i2c_boardinfo)); | 261 | ARRAY_SIZE(touchBook_i2c_boardinfo)); |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 1bf2f39b9d0e..776b44412db1 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -433,10 +433,6 @@ static struct twl4030_gpio_platform_data overo_gpio_data = { | |||
433 | .setup = overo_twl_gpio_setup, | 433 | .setup = overo_twl_gpio_setup, |
434 | }; | 434 | }; |
435 | 435 | ||
436 | static struct twl4030_usb_data overo_usb_data = { | ||
437 | .usb_mode = T2_USB_MODE_ULPI, | ||
438 | }; | ||
439 | |||
440 | static struct regulator_init_data overo_vmmc1 = { | 436 | static struct regulator_init_data overo_vmmc1 = { |
441 | .constraints = { | 437 | .constraints = { |
442 | .min_uV = 1850000, | 438 | .min_uV = 1850000, |
@@ -480,19 +476,8 @@ static struct regulator_init_data overo_vpll2 = { | |||
480 | .consumer_supplies = overo_vdds_dsi_supply, | 476 | .consumer_supplies = overo_vdds_dsi_supply, |
481 | }; | 477 | }; |
482 | 478 | ||
483 | static struct twl4030_codec_audio_data overo_audio_data; | ||
484 | |||
485 | static struct twl4030_codec_data overo_codec_data = { | ||
486 | .audio_mclk = 26000000, | ||
487 | .audio = &overo_audio_data, | ||
488 | }; | ||
489 | |||
490 | static struct twl4030_platform_data overo_twldata = { | 479 | static struct twl4030_platform_data overo_twldata = { |
491 | .irq_base = TWL4030_IRQ_BASE, | ||
492 | .irq_end = TWL4030_IRQ_END, | ||
493 | .gpio = &overo_gpio_data, | 480 | .gpio = &overo_gpio_data, |
494 | .usb = &overo_usb_data, | ||
495 | .codec = &overo_codec_data, | ||
496 | .vmmc1 = &overo_vmmc1, | 481 | .vmmc1 = &overo_vmmc1, |
497 | .vdac = &overo_vdac, | 482 | .vdac = &overo_vdac, |
498 | .vpll2 = &overo_vpll2, | 483 | .vpll2 = &overo_vpll2, |
@@ -500,6 +485,8 @@ static struct twl4030_platform_data overo_twldata = { | |||
500 | 485 | ||
501 | static int __init overo_i2c_init(void) | 486 | static int __init overo_i2c_init(void) |
502 | { | 487 | { |
488 | omap3_pmic_get_config(&overo_twldata, | ||
489 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 0); | ||
503 | omap3_pmic_init("tps65950", &overo_twldata); | 490 | omap3_pmic_init("tps65950", &overo_twldata); |
504 | /* i2c2 pins are used for gpio */ | 491 | /* i2c2 pins are used for gpio */ |
505 | omap_register_i2c_bus(3, 400, NULL, 0); | 492 | omap_register_i2c_bus(3, 400, NULL, 0); |
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c index 54dceb163415..7dfed24ee12e 100644 --- a/arch/arm/mach-omap2/board-rm680.c +++ b/arch/arm/mach-omap2/board-rm680.c | |||
@@ -79,20 +79,14 @@ static struct twl4030_gpio_platform_data rm680_gpio_data = { | |||
79 | .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15), | 79 | .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15), |
80 | }; | 80 | }; |
81 | 81 | ||
82 | static struct twl4030_usb_data rm680_usb_data = { | ||
83 | .usb_mode = T2_USB_MODE_ULPI, | ||
84 | }; | ||
85 | |||
86 | static struct twl4030_platform_data rm680_twl_data = { | 82 | static struct twl4030_platform_data rm680_twl_data = { |
87 | .irq_base = TWL4030_IRQ_BASE, | ||
88 | .irq_end = TWL4030_IRQ_END, | ||
89 | .gpio = &rm680_gpio_data, | 83 | .gpio = &rm680_gpio_data, |
90 | .usb = &rm680_usb_data, | ||
91 | /* add rest of the children here */ | 84 | /* add rest of the children here */ |
92 | }; | 85 | }; |
93 | 86 | ||
94 | static void __init rm680_i2c_init(void) | 87 | static void __init rm680_i2c_init(void) |
95 | { | 88 | { |
89 | omap3_pmic_get_config(&rm680_twl_data, TWL_COMMON_PDATA_USB, 0); | ||
96 | omap_pmic_init(1, 2900, "twl5031", INT_34XX_SYS_NIRQ, &rm680_twl_data); | 90 | omap_pmic_init(1, 2900, "twl5031", INT_34XX_SYS_NIRQ, &rm680_twl_data); |
97 | omap_register_i2c_bus(2, 400, NULL, 0); | 91 | omap_register_i2c_bus(2, 400, NULL, 0); |
98 | omap_register_i2c_bus(3, 400, NULL, 0); | 92 | omap_register_i2c_bus(3, 400, NULL, 0); |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 5e559dda3cc3..e0a2804e2b71 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -288,10 +288,6 @@ static struct twl4030_keypad_data rx51_kp_data = { | |||
288 | .rep = 1, | 288 | .rep = 1, |
289 | }; | 289 | }; |
290 | 290 | ||
291 | static struct twl4030_madc_platform_data rx51_madc_data = { | ||
292 | .irq_line = 1, | ||
293 | }; | ||
294 | |||
295 | /* Enable input logic and pull all lines up when eMMC is on. */ | 291 | /* Enable input logic and pull all lines up when eMMC is on. */ |
296 | static struct omap_board_mux rx51_mmc2_on_mux[] = { | 292 | static struct omap_board_mux rx51_mmc2_on_mux[] = { |
297 | OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | 293 | OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), |
@@ -603,10 +599,6 @@ static struct twl4030_gpio_platform_data rx51_gpio_data = { | |||
603 | .setup = rx51_twlgpio_setup, | 599 | .setup = rx51_twlgpio_setup, |
604 | }; | 600 | }; |
605 | 601 | ||
606 | static struct twl4030_usb_data rx51_usb_data = { | ||
607 | .usb_mode = T2_USB_MODE_ULPI, | ||
608 | }; | ||
609 | |||
610 | static struct twl4030_ins sleep_on_seq[] __initdata = { | 602 | static struct twl4030_ins sleep_on_seq[] __initdata = { |
611 | /* | 603 | /* |
612 | * Turn off everything | 604 | * Turn off everything |
@@ -778,14 +770,9 @@ struct twl4030_codec_data rx51_codec_data __initdata = { | |||
778 | }; | 770 | }; |
779 | 771 | ||
780 | static struct twl4030_platform_data rx51_twldata __initdata = { | 772 | static struct twl4030_platform_data rx51_twldata __initdata = { |
781 | .irq_base = TWL4030_IRQ_BASE, | ||
782 | .irq_end = TWL4030_IRQ_END, | ||
783 | |||
784 | /* platform_data for children goes here */ | 773 | /* platform_data for children goes here */ |
785 | .gpio = &rx51_gpio_data, | 774 | .gpio = &rx51_gpio_data, |
786 | .keypad = &rx51_kp_data, | 775 | .keypad = &rx51_kp_data, |
787 | .madc = &rx51_madc_data, | ||
788 | .usb = &rx51_usb_data, | ||
789 | .power = &rx51_t2scripts_data, | 776 | .power = &rx51_t2scripts_data, |
790 | .codec = &rx51_codec_data, | 777 | .codec = &rx51_codec_data, |
791 | 778 | ||
@@ -850,6 +837,8 @@ static int __init rx51_i2c_init(void) | |||
850 | rx51_twldata.vaux3 = &rx51_vaux3_cam; | 837 | rx51_twldata.vaux3 = &rx51_vaux3_cam; |
851 | } | 838 | } |
852 | rx51_twldata.vmmc2 = &rx51_vmmc2; | 839 | rx51_twldata.vmmc2 = &rx51_vmmc2; |
840 | omap3_pmic_get_config(&rx51_twldata, | ||
841 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC, 0); | ||
853 | omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); | 842 | omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); |
854 | omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, | 843 | omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, |
855 | ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); | 844 | ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); |
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 8495f82fcbab..6d8df1b40d86 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
@@ -285,26 +285,6 @@ static void zoom2_set_hs_extmute(int mute) | |||
285 | gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute); | 285 | gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute); |
286 | } | 286 | } |
287 | 287 | ||
288 | static int zoom_batt_table[] = { | ||
289 | /* 0 C*/ | ||
290 | 30800, 29500, 28300, 27100, | ||
291 | 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900, | ||
292 | 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100, | ||
293 | 11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310, | ||
294 | 8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830, | ||
295 | 5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170, | ||
296 | 4040, 3910, 3790, 3670, 3550 | ||
297 | }; | ||
298 | |||
299 | static struct twl4030_bci_platform_data zoom_bci_data = { | ||
300 | .battery_tmp_tbl = zoom_batt_table, | ||
301 | .tblsize = ARRAY_SIZE(zoom_batt_table), | ||
302 | }; | ||
303 | |||
304 | static struct twl4030_usb_data zoom_usb_data = { | ||
305 | .usb_mode = T2_USB_MODE_ULPI, | ||
306 | }; | ||
307 | |||
308 | static struct twl4030_gpio_platform_data zoom_gpio_data = { | 288 | static struct twl4030_gpio_platform_data zoom_gpio_data = { |
309 | .gpio_base = OMAP_MAX_GPIO_LINES, | 289 | .gpio_base = OMAP_MAX_GPIO_LINES, |
310 | .irq_base = TWL4030_GPIO_IRQ_BASE, | 290 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
@@ -312,28 +292,10 @@ static struct twl4030_gpio_platform_data zoom_gpio_data = { | |||
312 | .setup = zoom_twl_gpio_setup, | 292 | .setup = zoom_twl_gpio_setup, |
313 | }; | 293 | }; |
314 | 294 | ||
315 | static struct twl4030_madc_platform_data zoom_madc_data = { | ||
316 | .irq_line = 1, | ||
317 | }; | ||
318 | |||
319 | static struct twl4030_codec_audio_data zoom_audio_data; | ||
320 | |||
321 | static struct twl4030_codec_data zoom_codec_data = { | ||
322 | .audio_mclk = 26000000, | ||
323 | .audio = &zoom_audio_data, | ||
324 | }; | ||
325 | |||
326 | static struct twl4030_platform_data zoom_twldata = { | 295 | static struct twl4030_platform_data zoom_twldata = { |
327 | .irq_base = TWL4030_IRQ_BASE, | ||
328 | .irq_end = TWL4030_IRQ_END, | ||
329 | |||
330 | /* platform_data for children goes here */ | 296 | /* platform_data for children goes here */ |
331 | .bci = &zoom_bci_data, | ||
332 | .madc = &zoom_madc_data, | ||
333 | .usb = &zoom_usb_data, | ||
334 | .gpio = &zoom_gpio_data, | 297 | .gpio = &zoom_gpio_data, |
335 | .keypad = &zoom_kp_twl4030_data, | 298 | .keypad = &zoom_kp_twl4030_data, |
336 | .codec = &zoom_codec_data, | ||
337 | .vmmc1 = &zoom_vmmc1, | 299 | .vmmc1 = &zoom_vmmc1, |
338 | .vmmc2 = &zoom_vmmc2, | 300 | .vmmc2 = &zoom_vmmc2, |
339 | .vsim = &zoom_vsim, | 301 | .vsim = &zoom_vsim, |
@@ -343,10 +305,17 @@ static struct twl4030_platform_data zoom_twldata = { | |||
343 | 305 | ||
344 | static int __init omap_i2c_init(void) | 306 | static int __init omap_i2c_init(void) |
345 | { | 307 | { |
308 | omap3_pmic_get_config(&zoom_twldata, | ||
309 | TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI | | ||
310 | TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, 0); | ||
311 | |||
346 | if (machine_is_omap_zoom2()) { | 312 | if (machine_is_omap_zoom2()) { |
347 | zoom_audio_data.ramp_delay_value = 3; /* 161 ms */ | 313 | struct twl4030_codec_audio_data *audio_data; |
348 | zoom_audio_data.hs_extmute = 1; | 314 | audio_data = zoom_twldata.codec->audio; |
349 | zoom_audio_data.set_hs_extmute = zoom2_set_hs_extmute; | 315 | |
316 | audio_data->ramp_delay_value = 3; /* 161 ms */ | ||
317 | audio_data->hs_extmute = 1; | ||
318 | audio_data->set_hs_extmute = zoom2_set_hs_extmute; | ||
350 | } | 319 | } |
351 | omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata); | 320 | omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata); |
352 | omap_register_i2c_bus(2, 400, NULL, 0); | 321 | omap_register_i2c_bus(2, 400, NULL, 0); |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index cf80f4cad729..9e8decf14a22 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -56,6 +56,37 @@ static struct twl4030_usb_data omap4_usb_pdata = { | |||
56 | .phy_suspend = omap4430_phy_suspend, | 56 | .phy_suspend = omap4430_phy_suspend, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static struct twl4030_usb_data omap3_usb_pdata = { | ||
60 | .usb_mode = T2_USB_MODE_ULPI, | ||
61 | }; | ||
62 | |||
63 | static int omap3_batt_table[] = { | ||
64 | /* 0 C */ | ||
65 | 30800, 29500, 28300, 27100, | ||
66 | 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900, | ||
67 | 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100, | ||
68 | 11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310, | ||
69 | 8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830, | ||
70 | 5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170, | ||
71 | 4040, 3910, 3790, 3670, 3550 | ||
72 | }; | ||
73 | |||
74 | static struct twl4030_bci_platform_data omap3_bci_pdata = { | ||
75 | .battery_tmp_tbl = omap3_batt_table, | ||
76 | .tblsize = ARRAY_SIZE(omap3_batt_table), | ||
77 | }; | ||
78 | |||
79 | static struct twl4030_madc_platform_data omap3_madc_pdata = { | ||
80 | .irq_line = 1, | ||
81 | }; | ||
82 | |||
83 | static struct twl4030_codec_audio_data omap3_audio; | ||
84 | |||
85 | static struct twl4030_codec_data omap3_codec_pdata = { | ||
86 | .audio_mclk = 26000000, | ||
87 | .audio = &omap3_audio, | ||
88 | }; | ||
89 | |||
59 | static struct regulator_init_data omap4_vdac_idata = { | 90 | static struct regulator_init_data omap4_vdac_idata = { |
60 | .constraints = { | 91 | .constraints = { |
61 | .min_uV = 1800000, | 92 | .min_uV = 1800000, |
@@ -207,3 +238,25 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, | |||
207 | !pmic_data->clk32kg) | 238 | !pmic_data->clk32kg) |
208 | pmic_data->clk32kg = &omap4_clk32kg_idata; | 239 | pmic_data->clk32kg = &omap4_clk32kg_idata; |
209 | } | 240 | } |
241 | |||
242 | void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, | ||
243 | u32 pdata_flags, u32 regulators_flags) | ||
244 | { | ||
245 | if (!pmic_data->irq_base) | ||
246 | pmic_data->irq_base = TWL4030_IRQ_BASE; | ||
247 | if (!pmic_data->irq_end) | ||
248 | pmic_data->irq_end = TWL4030_IRQ_END; | ||
249 | |||
250 | /* Common platform data configurations */ | ||
251 | if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb) | ||
252 | pmic_data->usb = &omap3_usb_pdata; | ||
253 | |||
254 | if (pdata_flags & TWL_COMMON_PDATA_BCI && !pmic_data->bci) | ||
255 | pmic_data->bci = &omap3_bci_pdata; | ||
256 | |||
257 | if (pdata_flags & TWL_COMMON_PDATA_MADC && !pmic_data->madc) | ||
258 | pmic_data->madc = &omap3_madc_pdata; | ||
259 | |||
260 | if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->codec) | ||
261 | pmic_data->codec = &omap3_codec_pdata; | ||
262 | } | ||
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h index d96c28987638..3b4b05d529ba 100644 --- a/arch/arm/mach-omap2/twl-common.h +++ b/arch/arm/mach-omap2/twl-common.h | |||
@@ -2,6 +2,9 @@ | |||
2 | #define __OMAP_PMIC_COMMON__ | 2 | #define __OMAP_PMIC_COMMON__ |
3 | 3 | ||
4 | #define TWL_COMMON_PDATA_USB (1 << 0) | 4 | #define TWL_COMMON_PDATA_USB (1 << 0) |
5 | #define TWL_COMMON_PDATA_BCI (1 << 1) | ||
6 | #define TWL_COMMON_PDATA_MADC (1 << 2) | ||
7 | #define TWL_COMMON_PDATA_AUDIO (1 << 3) | ||
5 | 8 | ||
6 | /* Common LDO regulators for TWL4030/TWL6030 */ | 9 | /* Common LDO regulators for TWL4030/TWL6030 */ |
7 | #define TWL_COMMON_REGULATOR_VDAC (1 << 0) | 10 | #define TWL_COMMON_REGULATOR_VDAC (1 << 0) |
@@ -42,6 +45,9 @@ static inline void omap4_pmic_init(const char *pmic_type, | |||
42 | omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data); | 45 | omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data); |
43 | } | 46 | } |
44 | 47 | ||
48 | void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, | ||
49 | u32 pdata_flags, u32 regulators_flags); | ||
50 | |||
45 | void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, | 51 | void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, |
46 | u32 pdata_flags, u32 regulators_flags); | 52 | u32 pdata_flags, u32 regulators_flags); |
47 | 53 | ||