aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-07-08 11:01:45 -0400
committerArnd Bergmann <arnd@arndb.de>2011-07-08 11:01:45 -0400
commitecba3287b4121dcf3ca7607fe71c205913edec06 (patch)
tree3e48c8b049d462f739893ce33272ee546ee147db /arch/arm
parent13340b2a1ef64891572c10927e5626e2b6a81b64 (diff)
parent727e18b429e3badda12d1de74f492bfa363a2e94 (diff)
Merge branch 'cleanup-part-2' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into omap/cleanup
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap1/mcbsp.c4
-rw-r--r--arch/arm/mach-omap2/Makefile2
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c89
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c141
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c51
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c38
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c44
-rw-r--r--arch/arm/mach-omap2/board-ldp.c15
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c62
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c70
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c62
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c72
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c61
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c146
-rw-r--r--arch/arm/mach-omap2/board-overo.c61
-rw-r--r--arch/arm/mach-omap2/board-rm680.c8
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c40
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c89
-rw-r--r--arch/arm/mach-omap2/common-board-devices.c21
-rw-r--r--arch/arm/mach-omap2/common-board-devices.h26
-rw-r--r--arch/arm/mach-omap2/twl-common.c304
-rw-r--r--arch/arm/mach-omap2/twl-common.h59
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h12
-rw-r--r--arch/arm/plat-omap/mcbsp.c3
24 files changed, 492 insertions, 988 deletions
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index d9af9811dedd..ab7395d84bc8 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -38,7 +38,7 @@ static void omap1_mcbsp_request(unsigned int id)
38 * On 1510, 1610 and 1710, McBSP1 and McBSP3 38 * On 1510, 1610 and 1710, McBSP1 and McBSP3
39 * are DSP public peripherals. 39 * are DSP public peripherals.
40 */ 40 */
41 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { 41 if (id == 0 || id == 2) {
42 if (dsp_use++ == 0) { 42 if (dsp_use++ == 0) {
43 api_clk = clk_get(NULL, "api_ck"); 43 api_clk = clk_get(NULL, "api_ck");
44 dsp_clk = clk_get(NULL, "dsp_ck"); 44 dsp_clk = clk_get(NULL, "dsp_ck");
@@ -59,7 +59,7 @@ static void omap1_mcbsp_request(unsigned int id)
59 59
60static void omap1_mcbsp_free(unsigned int id) 60static void omap1_mcbsp_free(unsigned int id)
61{ 61{
62 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { 62 if (id == 0 || id == 2) {
63 if (--dsp_use == 0) { 63 if (--dsp_use == 0) {
64 if (!IS_ERR(api_clk)) { 64 if (!IS_ERR(api_clk)) {
65 clk_disable(api_clk); 65 clk_disable(api_clk);
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index adbe82d72d4e..ff1466fbf5c5 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -269,4 +269,4 @@ obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o
269disp-$(CONFIG_OMAP2_DSS) := display.o 269disp-$(CONFIG_OMAP2_DSS) := display.o
270obj-y += $(disp-m) $(disp-y) 270obj-y += $(disp-m) $(disp-y)
271 271
272obj-y += common-board-devices.o 272obj-y += common-board-devices.o twl-common.o
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 12fae21346cf..bd600cfb7f80 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
234static int sdp3430_batt_table[] = {
235/* 0 C*/
23630800, 29500, 28300, 27100,
23726000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
23817200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
23911600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
2408020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
2415640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
2424040, 3910, 3790, 3670, 3550
243};
244
245static struct twl4030_bci_platform_data sdp3430_bci_data = {
246 .battery_tmp_tbl = sdp3430_batt_table,
247 .tblsize = ARRAY_SIZE(sdp3430_batt_table),
248};
249
250static struct omap2_hsmmc_info mmc[] = { 234static 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
295static struct twl4030_usb_data sdp3430_usb_data = {
296 .usb_mode = T2_USB_MODE_ULPI,
297};
298
299static 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 */
@@ -307,16 +283,6 @@ static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = {
307 REGULATOR_SUPPLY("vcc", "spi1.0"), 283 REGULATOR_SUPPLY("vcc", "spi1.0"),
308}; 284};
309 285
310static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
311 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
312};
313
314/* VPLL2 for digital video outputs */
315static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
316 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
317 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
318};
319
320static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = { 286static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
321 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 287 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
322}; 288};
@@ -433,54 +399,10 @@ static struct regulator_init_data sdp3430_vsim = {
433 .consumer_supplies = sdp3430_vsim_supplies, 399 .consumer_supplies = sdp3430_vsim_supplies,
434}; 400};
435 401
436/* VDAC for DSS driving S-Video */
437static struct regulator_init_data sdp3430_vdac = {
438 .constraints = {
439 .min_uV = 1800000,
440 .max_uV = 1800000,
441 .apply_uV = true,
442 .valid_modes_mask = REGULATOR_MODE_NORMAL
443 | REGULATOR_MODE_STANDBY,
444 .valid_ops_mask = REGULATOR_CHANGE_MODE
445 | REGULATOR_CHANGE_STATUS,
446 },
447 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vdda_dac_supplies),
448 .consumer_supplies = sdp3430_vdda_dac_supplies,
449};
450
451static struct regulator_init_data sdp3430_vpll2 = {
452 .constraints = {
453 .name = "VDVI",
454 .min_uV = 1800000,
455 .max_uV = 1800000,
456 .apply_uV = true,
457 .valid_modes_mask = REGULATOR_MODE_NORMAL
458 | REGULATOR_MODE_STANDBY,
459 .valid_ops_mask = REGULATOR_CHANGE_MODE
460 | REGULATOR_CHANGE_STATUS,
461 },
462 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vpll2_supplies),
463 .consumer_supplies = sdp3430_vpll2_supplies,
464};
465
466static struct twl4030_codec_audio_data sdp3430_audio;
467
468static struct twl4030_codec_data sdp3430_codec = {
469 .audio_mclk = 26000000,
470 .audio = &sdp3430_audio,
471};
472
473static struct twl4030_platform_data sdp3430_twldata = { 402static 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 */ 403 /* platform_data for children goes here */
478 .bci = &sdp3430_bci_data,
479 .gpio = &sdp3430_gpio_data, 404 .gpio = &sdp3430_gpio_data,
480 .madc = &sdp3430_madc_data,
481 .keypad = &sdp3430_kp_data, 405 .keypad = &sdp3430_kp_data,
482 .usb = &sdp3430_usb_data,
483 .codec = &sdp3430_codec,
484 406
485 .vaux1 = &sdp3430_vaux1, 407 .vaux1 = &sdp3430_vaux1,
486 .vaux2 = &sdp3430_vaux2, 408 .vaux2 = &sdp3430_vaux2,
@@ -489,14 +411,21 @@ static struct twl4030_platform_data sdp3430_twldata = {
489 .vmmc1 = &sdp3430_vmmc1, 411 .vmmc1 = &sdp3430_vmmc1,
490 .vmmc2 = &sdp3430_vmmc2, 412 .vmmc2 = &sdp3430_vmmc2,
491 .vsim = &sdp3430_vsim, 413 .vsim = &sdp3430_vsim,
492 .vdac = &sdp3430_vdac,
493 .vpll2 = &sdp3430_vpll2,
494}; 414};
495 415
496static int __init omap3430_i2c_init(void) 416static int __init omap3430_i2c_init(void)
497{ 417{
498 /* i2c1 for PMIC only */ 418 /* i2c1 for PMIC only */
419 omap3_pmic_get_config(&sdp3430_twldata,
420 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
421 TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
422 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
423 sdp3430_twldata.vdac->constraints.apply_uV = true;
424 sdp3430_twldata.vpll2->constraints.apply_uV = true;
425 sdp3430_twldata.vpll2->constraints.name = "VDVI";
426
499 omap3_pmic_init("twl4030", &sdp3430_twldata); 427 omap3_pmic_init("twl4030", &sdp3430_twldata);
428
500 /* i2c2 on camera connector (for sensor control) and optional isp1301 */ 429 /* i2c2 on camera connector (for sensor control) and optional isp1301 */
501 omap_register_i2c_bus(2, 400, NULL, 0); 430 omap_register_i2c_bus(2, 400, NULL, 0);
502 /* i2c3 on display connector (for DVI, tfp410) */ 431 /* i2c3 on display connector (for DVI, tfp410) */
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index d7df07ef2cea..933b25bb10de 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -302,14 +302,6 @@ static struct omap_musb_board_data musb_board_data = {
302 .power = 100, 302 .power = 100,
303}; 303};
304 304
305static struct twl4030_usb_data omap4_usbphy_data = {
306 .phy_init = omap4430_phy_init,
307 .phy_exit = omap4430_phy_exit,
308 .phy_power = omap4430_phy_power,
309 .phy_set_clock = omap4430_phy_set_clk,
310 .phy_suspend = omap4430_phy_suspend,
311};
312
313static struct omap2_hsmmc_info mmc[] = { 305static struct omap2_hsmmc_info mmc[] = {
314 { 306 {
315 .mmc = 2, 307 .mmc = 2,
@@ -332,10 +324,6 @@ static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
332 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), 324 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
333}; 325};
334 326
335static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
336 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
337};
338
339static int omap4_twl6030_hsmmc_late_init(struct device *dev) 327static int omap4_twl6030_hsmmc_late_init(struct device *dev)
340{ 328{
341 int ret = 0; 329 int ret = 0;
@@ -394,61 +382,6 @@ static struct regulator_init_data sdp4430_vaux1 = {
394 .consumer_supplies = sdp4430_vaux_supply, 382 .consumer_supplies = sdp4430_vaux_supply,
395}; 383};
396 384
397static struct regulator_init_data sdp4430_vaux2 = {
398 .constraints = {
399 .min_uV = 1200000,
400 .max_uV = 2800000,
401 .apply_uV = true,
402 .valid_modes_mask = REGULATOR_MODE_NORMAL
403 | REGULATOR_MODE_STANDBY,
404 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
405 | REGULATOR_CHANGE_MODE
406 | REGULATOR_CHANGE_STATUS,
407 },
408};
409
410static struct regulator_init_data sdp4430_vaux3 = {
411 .constraints = {
412 .min_uV = 1000000,
413 .max_uV = 3000000,
414 .apply_uV = true,
415 .valid_modes_mask = REGULATOR_MODE_NORMAL
416 | REGULATOR_MODE_STANDBY,
417 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
418 | REGULATOR_CHANGE_MODE
419 | REGULATOR_CHANGE_STATUS,
420 },
421};
422
423/* VMMC1 for MMC1 card */
424static struct regulator_init_data sdp4430_vmmc = {
425 .constraints = {
426 .min_uV = 1200000,
427 .max_uV = 3000000,
428 .apply_uV = true,
429 .valid_modes_mask = REGULATOR_MODE_NORMAL
430 | REGULATOR_MODE_STANDBY,
431 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
432 | REGULATOR_CHANGE_MODE
433 | REGULATOR_CHANGE_STATUS,
434 },
435 .num_consumer_supplies = 1,
436 .consumer_supplies = sdp4430_vmmc_supply,
437};
438
439static struct regulator_init_data sdp4430_vpp = {
440 .constraints = {
441 .min_uV = 1800000,
442 .max_uV = 2500000,
443 .apply_uV = true,
444 .valid_modes_mask = REGULATOR_MODE_NORMAL
445 | REGULATOR_MODE_STANDBY,
446 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
447 | REGULATOR_CHANGE_MODE
448 | REGULATOR_CHANGE_STATUS,
449 },
450};
451
452static struct regulator_init_data sdp4430_vusim = { 385static struct regulator_init_data sdp4430_vusim = {
453 .constraints = { 386 .constraints = {
454 .min_uV = 1200000, 387 .min_uV = 1200000,
@@ -462,74 +395,10 @@ static struct regulator_init_data sdp4430_vusim = {
462 }, 395 },
463}; 396};
464 397
465static struct regulator_init_data sdp4430_vana = {
466 .constraints = {
467 .min_uV = 2100000,
468 .max_uV = 2100000,
469 .valid_modes_mask = REGULATOR_MODE_NORMAL
470 | REGULATOR_MODE_STANDBY,
471 .valid_ops_mask = REGULATOR_CHANGE_MODE
472 | REGULATOR_CHANGE_STATUS,
473 },
474};
475
476static struct regulator_init_data sdp4430_vcxio = {
477 .constraints = {
478 .min_uV = 1800000,
479 .max_uV = 1800000,
480 .valid_modes_mask = REGULATOR_MODE_NORMAL
481 | REGULATOR_MODE_STANDBY,
482 .valid_ops_mask = REGULATOR_CHANGE_MODE
483 | REGULATOR_CHANGE_STATUS,
484 },
485};
486
487static struct regulator_init_data sdp4430_vdac = {
488 .constraints = {
489 .min_uV = 1800000,
490 .max_uV = 1800000,
491 .valid_modes_mask = REGULATOR_MODE_NORMAL
492 | REGULATOR_MODE_STANDBY,
493 .valid_ops_mask = REGULATOR_CHANGE_MODE
494 | REGULATOR_CHANGE_STATUS,
495 },
496};
497
498static struct regulator_init_data sdp4430_vusb = {
499 .constraints = {
500 .min_uV = 3300000,
501 .max_uV = 3300000,
502 .apply_uV = true,
503 .valid_modes_mask = REGULATOR_MODE_NORMAL
504 | REGULATOR_MODE_STANDBY,
505 .valid_ops_mask = REGULATOR_CHANGE_MODE
506 | REGULATOR_CHANGE_STATUS,
507 },
508};
509
510static struct regulator_init_data sdp4430_clk32kg = {
511 .constraints = {
512 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
513 },
514};
515
516static struct twl4030_platform_data sdp4430_twldata = { 398static struct twl4030_platform_data sdp4430_twldata = {
517 .irq_base = TWL6030_IRQ_BASE,
518 .irq_end = TWL6030_IRQ_END,
519
520 /* Regulators */ 399 /* Regulators */
521 .vmmc = &sdp4430_vmmc,
522 .vpp = &sdp4430_vpp,
523 .vusim = &sdp4430_vusim, 400 .vusim = &sdp4430_vusim,
524 .vana = &sdp4430_vana,
525 .vcxio = &sdp4430_vcxio,
526 .vdac = &sdp4430_vdac,
527 .vusb = &sdp4430_vusb,
528 .vaux1 = &sdp4430_vaux1, 401 .vaux1 = &sdp4430_vaux1,
529 .vaux2 = &sdp4430_vaux2,
530 .vaux3 = &sdp4430_vaux3,
531 .clk32kg = &sdp4430_clk32kg,
532 .usb = &omap4_usbphy_data
533}; 402};
534 403
535static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { 404static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
@@ -547,6 +416,16 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
547}; 416};
548static int __init omap4_i2c_init(void) 417static int __init omap4_i2c_init(void)
549{ 418{
419 omap4_pmic_get_config(&sdp4430_twldata, TWL_COMMON_PDATA_USB,
420 TWL_COMMON_REGULATOR_VDAC |
421 TWL_COMMON_REGULATOR_VAUX2 |
422 TWL_COMMON_REGULATOR_VAUX3 |
423 TWL_COMMON_REGULATOR_VMMC |
424 TWL_COMMON_REGULATOR_VPP |
425 TWL_COMMON_REGULATOR_VANA |
426 TWL_COMMON_REGULATOR_VCXIO |
427 TWL_COMMON_REGULATOR_VUSB |
428 TWL_COMMON_REGULATOR_CLK32KG);
550 omap4_pmic_init("twl6030", &sdp4430_twldata); 429 omap4_pmic_init("twl6030", &sdp4430_twldata);
551 omap_register_i2c_bus(2, 400, NULL, 0); 430 omap_register_i2c_bus(2, 400, NULL, 0);
552 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, 431 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index d76dca788540..35891d49c631 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -343,10 +343,6 @@ static struct regulator_consumer_supply cm_t35_vsim_supply[] = {
343 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), 343 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
344}; 344};
345 345
346static struct regulator_consumer_supply cm_t35_vdac_supply[] = {
347 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
348};
349
350static struct regulator_consumer_supply cm_t35_vdvi_supply[] = { 346static struct regulator_consumer_supply cm_t35_vdvi_supply[] = {
351 REGULATOR_SUPPLY("vdvi", "omapdss"), 347 REGULATOR_SUPPLY("vdvi", "omapdss"),
352}; 348};
@@ -381,39 +377,6 @@ static struct regulator_init_data cm_t35_vsim = {
381 .consumer_supplies = cm_t35_vsim_supply, 377 .consumer_supplies = cm_t35_vsim_supply,
382}; 378};
383 379
384/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
385static struct regulator_init_data cm_t35_vdac = {
386 .constraints = {
387 .min_uV = 1800000,
388 .max_uV = 1800000,
389 .valid_modes_mask = REGULATOR_MODE_NORMAL
390 | REGULATOR_MODE_STANDBY,
391 .valid_ops_mask = REGULATOR_CHANGE_MODE
392 | REGULATOR_CHANGE_STATUS,
393 },
394 .num_consumer_supplies = ARRAY_SIZE(cm_t35_vdac_supply),
395 .consumer_supplies = cm_t35_vdac_supply,
396};
397
398/* VPLL2 for digital video outputs */
399static struct regulator_init_data cm_t35_vpll2 = {
400 .constraints = {
401 .name = "VDVI",
402 .min_uV = 1800000,
403 .max_uV = 1800000,
404 .valid_modes_mask = REGULATOR_MODE_NORMAL
405 | REGULATOR_MODE_STANDBY,
406 .valid_ops_mask = REGULATOR_CHANGE_MODE
407 | REGULATOR_CHANGE_STATUS,
408 },
409 .num_consumer_supplies = ARRAY_SIZE(cm_t35_vdvi_supply),
410 .consumer_supplies = cm_t35_vdvi_supply,
411};
412
413static struct twl4030_usb_data cm_t35_usb_data = {
414 .usb_mode = T2_USB_MODE_ULPI,
415};
416
417static uint32_t cm_t35_keymap[] = { 380static uint32_t cm_t35_keymap[] = {
418 KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT), 381 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), 382 KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN),
@@ -492,21 +455,23 @@ static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
492}; 455};
493 456
494static struct twl4030_platform_data cm_t35_twldata = { 457static 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 */ 458 /* platform_data for children goes here */
499 .keypad = &cm_t35_kp_data, 459 .keypad = &cm_t35_kp_data,
500 .usb = &cm_t35_usb_data,
501 .gpio = &cm_t35_gpio_data, 460 .gpio = &cm_t35_gpio_data,
502 .vmmc1 = &cm_t35_vmmc1, 461 .vmmc1 = &cm_t35_vmmc1,
503 .vsim = &cm_t35_vsim, 462 .vsim = &cm_t35_vsim,
504 .vdac = &cm_t35_vdac,
505 .vpll2 = &cm_t35_vpll2,
506}; 463};
507 464
508static void __init cm_t35_init_i2c(void) 465static void __init cm_t35_init_i2c(void)
509{ 466{
467 omap3_pmic_get_config(&cm_t35_twldata, TWL_COMMON_PDATA_USB,
468 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
469
470 cm_t35_twldata.vpll2->constraints.name = "VDVI";
471 cm_t35_twldata.vpll2->num_consumer_supplies =
472 ARRAY_SIZE(cm_t35_vdvi_supply);
473 cm_t35_twldata.vpll2->consumer_supplies = cm_t35_vdvi_supply;
474
510 omap3_pmic_init("tps65930", &cm_t35_twldata); 475 omap3_pmic_init("tps65930", &cm_t35_twldata);
511} 476}
512 477
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 949dbeabab26..b6002ec31c6a 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -186,10 +186,6 @@ static struct omap_dss_board_info devkit8000_dss_data = {
186 .default_device = &devkit8000_lcd_device, 186 .default_device = &devkit8000_lcd_device,
187}; 187};
188 188
189static struct regulator_consumer_supply devkit8000_vdda_dac_supply[] = {
190 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
191};
192
193static uint32_t board_keymap[] = { 189static uint32_t board_keymap[] = {
194 KEY(0, 0, KEY_1), 190 KEY(0, 0, KEY_1),
195 KEY(1, 0, KEY_2), 191 KEY(1, 0, KEY_2),
@@ -289,20 +285,6 @@ static struct regulator_init_data devkit8000_vmmc1 = {
289 .consumer_supplies = devkit8000_vmmc1_supply, 285 .consumer_supplies = devkit8000_vmmc1_supply,
290}; 286};
291 287
292/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
293static struct regulator_init_data devkit8000_vdac = {
294 .constraints = {
295 .min_uV = 1800000,
296 .max_uV = 1800000,
297 .valid_modes_mask = REGULATOR_MODE_NORMAL
298 | REGULATOR_MODE_STANDBY,
299 .valid_ops_mask = REGULATOR_CHANGE_MODE
300 | REGULATOR_CHANGE_STATUS,
301 },
302 .num_consumer_supplies = ARRAY_SIZE(devkit8000_vdda_dac_supply),
303 .consumer_supplies = devkit8000_vdda_dac_supply,
304};
305
306/* VPLL1 for digital video outputs */ 288/* VPLL1 for digital video outputs */
307static struct regulator_init_data devkit8000_vpll1 = { 289static struct regulator_init_data devkit8000_vpll1 = {
308 .constraints = { 290 .constraints = {
@@ -332,27 +314,10 @@ static struct regulator_init_data devkit8000_vio = {
332 .consumer_supplies = devkit8000_vio_supply, 314 .consumer_supplies = devkit8000_vio_supply,
333}; 315};
334 316
335static struct twl4030_usb_data devkit8000_usb_data = {
336 .usb_mode = T2_USB_MODE_ULPI,
337};
338
339static struct twl4030_codec_audio_data devkit8000_audio_data;
340
341static struct twl4030_codec_data devkit8000_codec_data = {
342 .audio_mclk = 26000000,
343 .audio = &devkit8000_audio_data,
344};
345
346static struct twl4030_platform_data devkit8000_twldata = { 317static 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 */ 318 /* platform_data for children goes here */
351 .usb = &devkit8000_usb_data,
352 .gpio = &devkit8000_gpio_data, 319 .gpio = &devkit8000_gpio_data,
353 .codec = &devkit8000_codec_data,
354 .vmmc1 = &devkit8000_vmmc1, 320 .vmmc1 = &devkit8000_vmmc1,
355 .vdac = &devkit8000_vdac,
356 .vpll1 = &devkit8000_vpll1, 321 .vpll1 = &devkit8000_vpll1,
357 .vio = &devkit8000_vio, 322 .vio = &devkit8000_vio,
358 .keypad = &devkit8000_kp_data, 323 .keypad = &devkit8000_kp_data,
@@ -360,6 +325,9 @@ static struct twl4030_platform_data devkit8000_twldata = {
360 325
361static int __init devkit8000_i2c_init(void) 326static int __init devkit8000_i2c_init(void)
362{ 327{
328 omap3_pmic_get_config(&devkit8000_twldata,
329 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
330 TWL_COMMON_REGULATOR_VDAC);
363 omap3_pmic_init("tps65930", &devkit8000_twldata); 331 omap3_pmic_init("tps65930", &devkit8000_twldata);
364 /* Bus 3 is attached to the DVI port where devices like the pico DLP 332 /* Bus 3 is attached to the DVI port where devices like the pico DLP
365 * projector don't work reliably with 400kHz */ 333 * 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..35be778caf1b 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
446static struct twl4030_usb_data igep_usb_data = {
447 .usb_mode = T2_USB_MODE_ULPI,
448};
449
450static int igep2_enable_dvi(struct omap_dss_device *dssdev) 446static 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);
@@ -483,26 +479,6 @@ static struct omap_dss_board_info igep2_dss_data = {
483 .default_device = &igep2_dvi_device, 479 .default_device = &igep2_dvi_device,
484}; 480};
485 481
486static struct regulator_consumer_supply igep2_vpll2_supplies[] = {
487 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
488 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
489};
490
491static struct regulator_init_data igep2_vpll2 = {
492 .constraints = {
493 .name = "VDVI",
494 .min_uV = 1800000,
495 .max_uV = 1800000,
496 .apply_uV = true,
497 .valid_modes_mask = REGULATOR_MODE_NORMAL
498 | REGULATOR_MODE_STANDBY,
499 .valid_ops_mask = REGULATOR_CHANGE_MODE
500 | REGULATOR_CHANGE_STATUS,
501 },
502 .num_consumer_supplies = ARRAY_SIZE(igep2_vpll2_supplies),
503 .consumer_supplies = igep2_vpll2_supplies,
504};
505
506static void __init igep2_display_init(void) 482static void __init igep2_display_init(void)
507{ 483{
508 int err = gpio_request_one(IGEP2_GPIO_DVI_PUP, GPIOF_OUT_INIT_HIGH, 484 int err = gpio_request_one(IGEP2_GPIO_DVI_PUP, GPIOF_OUT_INIT_HIGH,
@@ -522,13 +498,6 @@ static void __init igep_init_early(void)
522 m65kxxxxam_sdrc_params); 498 m65kxxxxam_sdrc_params);
523} 499}
524 500
525static struct twl4030_codec_audio_data igep2_audio_data;
526
527static struct twl4030_codec_data igep2_codec_data = {
528 .audio_mclk = 26000000,
529 .audio = &igep2_audio_data,
530};
531
532static int igep2_keymap[] = { 501static int igep2_keymap[] = {
533 KEY(0, 0, KEY_LEFT), 502 KEY(0, 0, KEY_LEFT),
534 KEY(0, 1, KEY_RIGHT), 503 KEY(0, 1, KEY_RIGHT),
@@ -561,11 +530,7 @@ static struct twl4030_keypad_data igep2_keypad_pdata = {
561}; 530};
562 531
563static struct twl4030_platform_data igep_twldata = { 532static 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 */ 533 /* platform_data for children goes here */
568 .usb = &igep_usb_data,
569 .gpio = &igep_twl4030_gpio_pdata, 534 .gpio = &igep_twl4030_gpio_pdata,
570 .vmmc1 = &igep_vmmc1, 535 .vmmc1 = &igep_vmmc1,
571 .vio = &igep_vio, 536 .vio = &igep_vio,
@@ -581,6 +546,8 @@ static void __init igep_i2c_init(void)
581{ 546{
582 int ret; 547 int ret;
583 548
549 omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_USB, 0);
550
584 if (machine_is_igep0020()) { 551 if (machine_is_igep0020()) {
585 /* 552 /*
586 * Bus 3 is attached to the DVI port where devices like the 553 * Bus 3 is attached to the DVI port where devices like the
@@ -591,9 +558,12 @@ static void __init igep_i2c_init(void)
591 if (ret) 558 if (ret)
592 pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret); 559 pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
593 560
594 igep_twldata.codec = &igep2_codec_data;
595 igep_twldata.keypad = &igep2_keypad_pdata; 561 igep_twldata.keypad = &igep2_keypad_pdata;
596 igep_twldata.vpll2 = &igep2_vpll2; 562 /* Get common pmic data */
563 omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_AUDIO,
564 TWL_COMMON_REGULATOR_VPLL2);
565 igep_twldata.vpll2->constraints.apply_uV = true;
566 igep_twldata.vpll2->constraints.name = "VDVI";
597 } 567 }
598 568
599 omap3_pmic_init("twl4030", &igep_twldata); 569 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
202static struct twl4030_usb_data ldp_usb_data = {
203 .usb_mode = T2_USB_MODE_ULPI,
204};
205
206static struct twl4030_gpio_platform_data ldp_gpio_data = { 202static 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
212static struct twl4030_madc_platform_data ldp_madc_data = {
213 .irq_line = 1,
214};
215
216static struct regulator_consumer_supply ldp_vmmc1_supply[] = { 208static 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
255static struct twl4030_platform_data ldp_twldata = { 247static 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
268static int __init omap_i2c_init(void) 255static 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..34f841112768 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -209,15 +209,6 @@ static struct omap_dss_board_info beagle_dss_data = {
209 .default_device = &beagle_dvi_device, 209 .default_device = &beagle_dvi_device,
210}; 210};
211 211
212static struct regulator_consumer_supply beagle_vdac_supply[] = {
213 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
214};
215
216static struct regulator_consumer_supply beagle_vdvi_supplies[] = {
217 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
218 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
219};
220
221static void __init beagle_display_init(void) 212static void __init beagle_display_init(void)
222{ 213{
223 int r; 214 int r;
@@ -351,58 +342,11 @@ static struct regulator_init_data beagle_vsim = {
351 .consumer_supplies = beagle_vsim_supply, 342 .consumer_supplies = beagle_vsim_supply,
352}; 343};
353 344
354/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
355static struct regulator_init_data beagle_vdac = {
356 .constraints = {
357 .min_uV = 1800000,
358 .max_uV = 1800000,
359 .valid_modes_mask = REGULATOR_MODE_NORMAL
360 | REGULATOR_MODE_STANDBY,
361 .valid_ops_mask = REGULATOR_CHANGE_MODE
362 | REGULATOR_CHANGE_STATUS,
363 },
364 .num_consumer_supplies = ARRAY_SIZE(beagle_vdac_supply),
365 .consumer_supplies = beagle_vdac_supply,
366};
367
368/* VPLL2 for digital video outputs */
369static struct regulator_init_data beagle_vpll2 = {
370 .constraints = {
371 .name = "VDVI",
372 .min_uV = 1800000,
373 .max_uV = 1800000,
374 .valid_modes_mask = REGULATOR_MODE_NORMAL
375 | REGULATOR_MODE_STANDBY,
376 .valid_ops_mask = REGULATOR_CHANGE_MODE
377 | REGULATOR_CHANGE_STATUS,
378 },
379 .num_consumer_supplies = ARRAY_SIZE(beagle_vdvi_supplies),
380 .consumer_supplies = beagle_vdvi_supplies,
381};
382
383static struct twl4030_usb_data beagle_usb_data = {
384 .usb_mode = T2_USB_MODE_ULPI,
385};
386
387static struct twl4030_codec_audio_data beagle_audio_data;
388
389static struct twl4030_codec_data beagle_codec_data = {
390 .audio_mclk = 26000000,
391 .audio = &beagle_audio_data,
392};
393
394static struct twl4030_platform_data beagle_twldata = { 345static 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 */ 346 /* platform_data for children goes here */
399 .usb = &beagle_usb_data,
400 .gpio = &beagle_gpio_data, 347 .gpio = &beagle_gpio_data,
401 .codec = &beagle_codec_data,
402 .vmmc1 = &beagle_vmmc1, 348 .vmmc1 = &beagle_vmmc1,
403 .vsim = &beagle_vsim, 349 .vsim = &beagle_vsim,
404 .vdac = &beagle_vdac,
405 .vpll2 = &beagle_vpll2,
406}; 350};
407 351
408static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { 352static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
@@ -413,6 +357,12 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
413 357
414static int __init omap3_beagle_i2c_init(void) 358static int __init omap3_beagle_i2c_init(void)
415{ 359{
360 omap3_pmic_get_config(&beagle_twldata,
361 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
362 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
363
364 beagle_twldata.vpll2->constraints.name = "VDVI";
365
416 omap3_pmic_init("twl4030", &beagle_twldata); 366 omap3_pmic_init("twl4030", &beagle_twldata);
417 /* Bus 3 is attached to the DVI port where devices like the pico DLP 367 /* Bus 3 is attached to the DVI port where devices like the pico DLP
418 * projector don't work reliably with 400kHz */ 368 * 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..c452b3f3331a 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
399static struct twl4030_usb_data omap3evm_usb_data = {
400 .usb_mode = T2_USB_MODE_ULPI,
401};
402
403static uint32_t board_keymap[] = { 399static 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,56 +430,6 @@ static struct twl4030_keypad_data omap3evm_kp_data = {
434 .rep = 1, 430 .rep = 1,
435}; 431};
436 432
437static struct twl4030_madc_platform_data omap3evm_madc_data = {
438 .irq_line = 1,
439};
440
441static struct twl4030_codec_audio_data omap3evm_audio_data;
442
443static struct twl4030_codec_data omap3evm_codec_data = {
444 .audio_mclk = 26000000,
445 .audio = &omap3evm_audio_data,
446};
447
448static struct regulator_consumer_supply omap3_evm_vdda_dac_supply[] = {
449 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
450};
451
452/* VDAC for DSS driving S-Video */
453static struct regulator_init_data omap3_evm_vdac = {
454 .constraints = {
455 .min_uV = 1800000,
456 .max_uV = 1800000,
457 .apply_uV = true,
458 .valid_modes_mask = REGULATOR_MODE_NORMAL
459 | REGULATOR_MODE_STANDBY,
460 .valid_ops_mask = REGULATOR_CHANGE_MODE
461 | REGULATOR_CHANGE_STATUS,
462 },
463 .num_consumer_supplies = ARRAY_SIZE(omap3_evm_vdda_dac_supply),
464 .consumer_supplies = omap3_evm_vdda_dac_supply,
465};
466
467/* VPLL2 for digital video outputs */
468static struct regulator_consumer_supply omap3_evm_vpll2_supplies[] = {
469 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
470 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
471};
472
473static struct regulator_init_data omap3_evm_vpll2 = {
474 .constraints = {
475 .min_uV = 1800000,
476 .max_uV = 1800000,
477 .apply_uV = true,
478 .valid_modes_mask = REGULATOR_MODE_NORMAL
479 | REGULATOR_MODE_STANDBY,
480 .valid_ops_mask = REGULATOR_CHANGE_MODE
481 | REGULATOR_CHANGE_STATUS,
482 },
483 .num_consumer_supplies = ARRAY_SIZE(omap3_evm_vpll2_supplies),
484 .consumer_supplies = omap3_evm_vpll2_supplies,
485};
486
487/* ads7846 on SPI */ 433/* ads7846 on SPI */
488static struct regulator_consumer_supply omap3evm_vio_supply[] = { 434static struct regulator_consumer_supply omap3evm_vio_supply[] = {
489 REGULATOR_SUPPLY("vcc", "spi1.0"), 435 REGULATOR_SUPPLY("vcc", "spi1.0"),
@@ -547,17 +493,9 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
547#endif 493#endif
548 494
549static struct twl4030_platform_data omap3evm_twldata = { 495static 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 */ 496 /* platform_data for children goes here */
554 .keypad = &omap3evm_kp_data, 497 .keypad = &omap3evm_kp_data,
555 .madc = &omap3evm_madc_data,
556 .usb = &omap3evm_usb_data,
557 .gpio = &omap3evm_gpio_data, 498 .gpio = &omap3evm_gpio_data,
558 .codec = &omap3evm_codec_data,
559 .vdac = &omap3_evm_vdac,
560 .vpll2 = &omap3_evm_vpll2,
561 .vio = &omap3evm_vio, 499 .vio = &omap3evm_vio,
562 .vmmc1 = &omap3evm_vmmc1, 500 .vmmc1 = &omap3evm_vmmc1,
563 .vsim = &omap3evm_vsim, 501 .vsim = &omap3evm_vsim,
@@ -565,6 +503,14 @@ static struct twl4030_platform_data omap3evm_twldata = {
565 503
566static int __init omap3_evm_i2c_init(void) 504static int __init omap3_evm_i2c_init(void)
567{ 505{
506 omap3_pmic_get_config(&omap3evm_twldata,
507 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC |
508 TWL_COMMON_PDATA_AUDIO,
509 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
510
511 omap3evm_twldata.vdac->constraints.apply_uV = true;
512 omap3evm_twldata.vpll2->constraints.apply_uV = true;
513
568 omap3_pmic_init("twl4030", &omap3evm_twldata); 514 omap3_pmic_init("twl4030", &omap3evm_twldata);
569 omap_register_i2c_bus(2, 400, NULL, 0); 515 omap_register_i2c_bus(2, 400, NULL, 0);
570 omap_register_i2c_bus(3, 400, NULL, 0); 516 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..080d7bd6795e 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -332,10 +332,6 @@ static struct regulator_consumer_supply pandora_vmmc3_supply[] = {
332 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"), 332 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"),
333}; 333};
334 334
335static struct regulator_consumer_supply pandora_vdda_dac_supply[] = {
336 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
337};
338
339static struct regulator_consumer_supply pandora_vdds_supplies[] = { 335static struct regulator_consumer_supply pandora_vdds_supplies[] = {
340 REGULATOR_SUPPLY("vdds_sdi", "omapdss"), 336 REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
341 REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 337 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
@@ -391,36 +387,6 @@ static struct regulator_init_data pandora_vmmc2 = {
391 .consumer_supplies = pandora_vmmc2_supply, 387 .consumer_supplies = pandora_vmmc2_supply,
392}; 388};
393 389
394/* VDAC for DSS driving S-Video */
395static struct regulator_init_data pandora_vdac = {
396 .constraints = {
397 .min_uV = 1800000,
398 .max_uV = 1800000,
399 .apply_uV = true,
400 .valid_modes_mask = REGULATOR_MODE_NORMAL
401 | REGULATOR_MODE_STANDBY,
402 .valid_ops_mask = REGULATOR_CHANGE_MODE
403 | REGULATOR_CHANGE_STATUS,
404 },
405 .num_consumer_supplies = ARRAY_SIZE(pandora_vdda_dac_supply),
406 .consumer_supplies = pandora_vdda_dac_supply,
407};
408
409/* VPLL2 for digital video outputs */
410static struct regulator_init_data pandora_vpll2 = {
411 .constraints = {
412 .min_uV = 1800000,
413 .max_uV = 1800000,
414 .apply_uV = true,
415 .valid_modes_mask = REGULATOR_MODE_NORMAL
416 | REGULATOR_MODE_STANDBY,
417 .valid_ops_mask = REGULATOR_CHANGE_MODE
418 | REGULATOR_CHANGE_STATUS,
419 },
420 .num_consumer_supplies = ARRAY_SIZE(pandora_vdds_supplies),
421 .consumer_supplies = pandora_vdds_supplies,
422};
423
424/* VAUX1 for LCD */ 390/* VAUX1 for LCD */
425static struct regulator_init_data pandora_vaux1 = { 391static struct regulator_init_data pandora_vaux1 = {
426 .constraints = { 392 .constraints = {
@@ -508,29 +474,12 @@ static struct platform_device pandora_vwlan_device = {
508 }, 474 },
509}; 475};
510 476
511static struct twl4030_usb_data omap3pandora_usb_data = {
512 .usb_mode = T2_USB_MODE_ULPI,
513};
514
515static struct twl4030_codec_audio_data omap3pandora_audio_data;
516
517static struct twl4030_codec_data omap3pandora_codec_data = {
518 .audio_mclk = 26000000,
519 .audio = &omap3pandora_audio_data,
520};
521
522static struct twl4030_bci_platform_data pandora_bci_data; 477static struct twl4030_bci_platform_data pandora_bci_data;
523 478
524static struct twl4030_platform_data omap3pandora_twldata = { 479static struct twl4030_platform_data omap3pandora_twldata = {
525 .irq_base = TWL4030_IRQ_BASE,
526 .irq_end = TWL4030_IRQ_END,
527 .gpio = &omap3pandora_gpio_data, 480 .gpio = &omap3pandora_gpio_data,
528 .usb = &omap3pandora_usb_data,
529 .codec = &omap3pandora_codec_data,
530 .vmmc1 = &pandora_vmmc1, 481 .vmmc1 = &pandora_vmmc1,
531 .vmmc2 = &pandora_vmmc2, 482 .vmmc2 = &pandora_vmmc2,
532 .vdac = &pandora_vdac,
533 .vpll2 = &pandora_vpll2,
534 .vaux1 = &pandora_vaux1, 483 .vaux1 = &pandora_vaux1,
535 .vaux2 = &pandora_vaux2, 484 .vaux2 = &pandora_vaux2,
536 .vaux4 = &pandora_vaux4, 485 .vaux4 = &pandora_vaux4,
@@ -548,6 +497,17 @@ static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = {
548 497
549static int __init omap3pandora_i2c_init(void) 498static int __init omap3pandora_i2c_init(void)
550{ 499{
500 omap3_pmic_get_config(&omap3pandora_twldata,
501 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
502 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
503
504 omap3pandora_twldata.vdac->constraints.apply_uV = true;
505
506 omap3pandora_twldata.vpll2->constraints.apply_uV = true;
507 omap3pandora_twldata.vpll2->num_consumer_supplies =
508 ARRAY_SIZE(pandora_vdds_supplies);
509 omap3pandora_twldata.vpll2->consumer_supplies = pandora_vdds_supplies;
510
551 omap3_pmic_init("tps65950", &omap3pandora_twldata); 511 omap3_pmic_init("tps65950", &omap3pandora_twldata);
552 /* i2c2 pins are not connected */ 512 /* i2c2 pins are not connected */
553 omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo, 513 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..8e104980ea26 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
352static struct twl4030_usb_data omap3stalker_usb_data = {
353 .usb_mode = T2_USB_MODE_ULPI,
354};
355
356static uint32_t board_keymap[] = { 352static 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,69 +383,10 @@ static struct twl4030_keypad_data omap3stalker_kp_data = {
387 .rep = 1, 383 .rep = 1,
388}; 384};
389 385
390static struct twl4030_madc_platform_data omap3stalker_madc_data = {
391 .irq_line = 1,
392};
393
394static struct twl4030_codec_audio_data omap3stalker_audio_data;
395
396static struct twl4030_codec_data omap3stalker_codec_data = {
397 .audio_mclk = 26000000,
398 .audio = &omap3stalker_audio_data,
399};
400
401static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply[] = {
402 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
403};
404
405/* VDAC for DSS driving S-Video */
406static struct regulator_init_data omap3_stalker_vdac = {
407 .constraints = {
408 .min_uV = 1800000,
409 .max_uV = 1800000,
410 .apply_uV = true,
411 .valid_modes_mask = REGULATOR_MODE_NORMAL
412 | REGULATOR_MODE_STANDBY,
413 .valid_ops_mask = REGULATOR_CHANGE_MODE
414 | REGULATOR_CHANGE_STATUS,
415 },
416 .num_consumer_supplies = ARRAY_SIZE(omap3_stalker_vdda_dac_supply),
417 .consumer_supplies = omap3_stalker_vdda_dac_supply,
418};
419
420/* VPLL2 for digital video outputs */
421static struct regulator_consumer_supply omap3_stalker_vpll2_supplies[] = {
422 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
423 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
424};
425
426static struct regulator_init_data omap3_stalker_vpll2 = {
427 .constraints = {
428 .name = "VDVI",
429 .min_uV = 1800000,
430 .max_uV = 1800000,
431 .apply_uV = true,
432 .valid_modes_mask = REGULATOR_MODE_NORMAL
433 | REGULATOR_MODE_STANDBY,
434 .valid_ops_mask = REGULATOR_CHANGE_MODE
435 | REGULATOR_CHANGE_STATUS,
436 },
437 .num_consumer_supplies = ARRAY_SIZE(omap3_stalker_vpll2_supplies),
438 .consumer_supplies = omap3_stalker_vpll2_supplies,
439};
440
441static struct twl4030_platform_data omap3stalker_twldata = { 386static 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 */ 387 /* platform_data for children goes here */
446 .keypad = &omap3stalker_kp_data, 388 .keypad = &omap3stalker_kp_data,
447 .madc = &omap3stalker_madc_data,
448 .usb = &omap3stalker_usb_data,
449 .gpio = &omap3stalker_gpio_data, 389 .gpio = &omap3stalker_gpio_data,
450 .codec = &omap3stalker_codec_data,
451 .vdac = &omap3_stalker_vdac,
452 .vpll2 = &omap3_stalker_vpll2,
453 .vmmc1 = &omap3stalker_vmmc1, 390 .vmmc1 = &omap3stalker_vmmc1,
454 .vsim = &omap3stalker_vsim, 391 .vsim = &omap3stalker_vsim,
455}; 392};
@@ -470,6 +407,15 @@ static struct i2c_board_info __initdata omap3stalker_i2c_boardinfo3[] = {
470 407
471static int __init omap3_stalker_i2c_init(void) 408static int __init omap3_stalker_i2c_init(void)
472{ 409{
410 omap3_pmic_get_config(&omap3stalker_twldata,
411 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC |
412 TWL_COMMON_PDATA_AUDIO,
413 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
414
415 omap3stalker_twldata.vdac->constraints.apply_uV = true;
416 omap3stalker_twldata.vpll2->constraints.apply_uV = true;
417 omap3stalker_twldata.vpll2->constraints.name = "VDVI";
418
473 omap3_pmic_init("twl4030", &omap3stalker_twldata); 419 omap3_pmic_init("twl4030", &omap3stalker_twldata);
474 omap_register_i2c_bus(2, 400, NULL, 0); 420 omap_register_i2c_bus(2, 400, NULL, 0);
475 omap_register_i2c_bus(3, 400, omap3stalker_i2c_boardinfo3, 421 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..852ea0464057 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -206,58 +206,11 @@ static struct regulator_init_data touchbook_vsim = {
206 .consumer_supplies = touchbook_vsim_supply, 206 .consumer_supplies = touchbook_vsim_supply,
207}; 207};
208 208
209/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
210static struct regulator_init_data touchbook_vdac = {
211 .constraints = {
212 .min_uV = 1800000,
213 .max_uV = 1800000,
214 .valid_modes_mask = REGULATOR_MODE_NORMAL
215 | REGULATOR_MODE_STANDBY,
216 .valid_ops_mask = REGULATOR_CHANGE_MODE
217 | REGULATOR_CHANGE_STATUS,
218 },
219 .num_consumer_supplies = ARRAY_SIZE(touchbook_vdac_supply),
220 .consumer_supplies = touchbook_vdac_supply,
221};
222
223/* VPLL2 for digital video outputs */
224static struct regulator_init_data touchbook_vpll2 = {
225 .constraints = {
226 .name = "VDVI",
227 .min_uV = 1800000,
228 .max_uV = 1800000,
229 .valid_modes_mask = REGULATOR_MODE_NORMAL
230 | REGULATOR_MODE_STANDBY,
231 .valid_ops_mask = REGULATOR_CHANGE_MODE
232 | REGULATOR_CHANGE_STATUS,
233 },
234 .num_consumer_supplies = ARRAY_SIZE(touchbook_vdvi_supply),
235 .consumer_supplies = touchbook_vdvi_supply,
236};
237
238static struct twl4030_usb_data touchbook_usb_data = {
239 .usb_mode = T2_USB_MODE_ULPI,
240};
241
242static struct twl4030_codec_audio_data touchbook_audio_data;
243
244static struct twl4030_codec_data touchbook_codec_data = {
245 .audio_mclk = 26000000,
246 .audio = &touchbook_audio_data,
247};
248
249static struct twl4030_platform_data touchbook_twldata = { 209static 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 */ 210 /* platform_data for children goes here */
254 .usb = &touchbook_usb_data,
255 .gpio = &touchbook_gpio_data, 211 .gpio = &touchbook_gpio_data,
256 .codec = &touchbook_codec_data,
257 .vmmc1 = &touchbook_vmmc1, 212 .vmmc1 = &touchbook_vmmc1,
258 .vsim = &touchbook_vsim, 213 .vsim = &touchbook_vsim,
259 .vdac = &touchbook_vdac,
260 .vpll2 = &touchbook_vpll2,
261}; 214};
262 215
263static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = { 216static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = {
@@ -269,8 +222,20 @@ static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = {
269static int __init omap3_touchbook_i2c_init(void) 222static int __init omap3_touchbook_i2c_init(void)
270{ 223{
271 /* Standard TouchBook bus */ 224 /* Standard TouchBook bus */
272 omap3_pmic_init("twl4030", &touchbook_twldata); 225 omap3_pmic_get_config(&touchbook_twldata,
226 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
227 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
273 228
229 touchbook_twldata.vdac->num_consumer_supplies =
230 ARRAY_SIZE(touchbook_vdac_supply);
231 touchbook_twldata.vdac->consumer_supplies = touchbook_vdac_supply;
232
233 touchbook_twldata.vpll2->constraints.name = "VDVI";
234 touchbook_twldata.vpll2->num_consumer_supplies =
235 ARRAY_SIZE(touchbook_vdvi_supply);
236 touchbook_twldata.vpll2->consumer_supplies = touchbook_vdvi_supply;
237
238 omap3_pmic_init("twl4030", &touchbook_twldata);
274 /* Additional TouchBook bus */ 239 /* Additional TouchBook bus */
275 omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo, 240 omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo,
276 ARRAY_SIZE(touchBook_i2c_boardinfo)); 241 ARRAY_SIZE(touchBook_i2c_boardinfo));
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index ee2034e37468..9aaa96057666 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -154,14 +154,6 @@ static struct omap_musb_board_data musb_board_data = {
154 .power = 100, 154 .power = 100,
155}; 155};
156 156
157static struct twl4030_usb_data omap4_usbphy_data = {
158 .phy_init = omap4430_phy_init,
159 .phy_exit = omap4430_phy_exit,
160 .phy_power = omap4430_phy_power,
161 .phy_set_clock = omap4430_phy_set_clk,
162 .phy_suspend = omap4430_phy_suspend,
163};
164
165static struct omap2_hsmmc_info mmc[] = { 157static struct omap2_hsmmc_info mmc[] = {
166 { 158 {
167 .mmc = 1, 159 .mmc = 1,
@@ -181,10 +173,6 @@ static struct omap2_hsmmc_info mmc[] = {
181 {} /* Terminator */ 173 {} /* Terminator */
182}; 174};
183 175
184static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = {
185 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
186};
187
188static struct regulator_consumer_supply omap4_panda_vmmc5_supply[] = { 176static struct regulator_consumer_supply omap4_panda_vmmc5_supply[] = {
189 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.4"), 177 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.4"),
190}; 178};
@@ -269,128 +257,8 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
269 return 0; 257 return 0;
270} 258}
271 259
272static struct regulator_init_data omap4_panda_vaux2 = { 260/* Panda board uses the common PMIC configuration */
273 .constraints = { 261static struct twl4030_platform_data omap4_panda_twldata;
274 .min_uV = 1200000,
275 .max_uV = 2800000,
276 .apply_uV = true,
277 .valid_modes_mask = REGULATOR_MODE_NORMAL
278 | REGULATOR_MODE_STANDBY,
279 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
280 | REGULATOR_CHANGE_MODE
281 | REGULATOR_CHANGE_STATUS,
282 },
283};
284
285static struct regulator_init_data omap4_panda_vaux3 = {
286 .constraints = {
287 .min_uV = 1000000,
288 .max_uV = 3000000,
289 .apply_uV = true,
290 .valid_modes_mask = REGULATOR_MODE_NORMAL
291 | REGULATOR_MODE_STANDBY,
292 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
293 | REGULATOR_CHANGE_MODE
294 | REGULATOR_CHANGE_STATUS,
295 },
296};
297
298/* VMMC1 for MMC1 card */
299static struct regulator_init_data omap4_panda_vmmc = {
300 .constraints = {
301 .min_uV = 1200000,
302 .max_uV = 3000000,
303 .apply_uV = true,
304 .valid_modes_mask = REGULATOR_MODE_NORMAL
305 | REGULATOR_MODE_STANDBY,
306 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
307 | REGULATOR_CHANGE_MODE
308 | REGULATOR_CHANGE_STATUS,
309 },
310 .num_consumer_supplies = ARRAY_SIZE(omap4_panda_vmmc_supply),
311 .consumer_supplies = omap4_panda_vmmc_supply,
312};
313
314static struct regulator_init_data omap4_panda_vpp = {
315 .constraints = {
316 .min_uV = 1800000,
317 .max_uV = 2500000,
318 .apply_uV = true,
319 .valid_modes_mask = REGULATOR_MODE_NORMAL
320 | REGULATOR_MODE_STANDBY,
321 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
322 | REGULATOR_CHANGE_MODE
323 | REGULATOR_CHANGE_STATUS,
324 },
325};
326
327static struct regulator_init_data omap4_panda_vana = {
328 .constraints = {
329 .min_uV = 2100000,
330 .max_uV = 2100000,
331 .valid_modes_mask = REGULATOR_MODE_NORMAL
332 | REGULATOR_MODE_STANDBY,
333 .valid_ops_mask = REGULATOR_CHANGE_MODE
334 | REGULATOR_CHANGE_STATUS,
335 },
336};
337
338static struct regulator_init_data omap4_panda_vcxio = {
339 .constraints = {
340 .min_uV = 1800000,
341 .max_uV = 1800000,
342 .valid_modes_mask = REGULATOR_MODE_NORMAL
343 | REGULATOR_MODE_STANDBY,
344 .valid_ops_mask = REGULATOR_CHANGE_MODE
345 | REGULATOR_CHANGE_STATUS,
346 },
347};
348
349static struct regulator_init_data omap4_panda_vdac = {
350 .constraints = {
351 .min_uV = 1800000,
352 .max_uV = 1800000,
353 .valid_modes_mask = REGULATOR_MODE_NORMAL
354 | REGULATOR_MODE_STANDBY,
355 .valid_ops_mask = REGULATOR_CHANGE_MODE
356 | REGULATOR_CHANGE_STATUS,
357 },
358};
359
360static struct regulator_init_data omap4_panda_vusb = {
361 .constraints = {
362 .min_uV = 3300000,
363 .max_uV = 3300000,
364 .apply_uV = true,
365 .valid_modes_mask = REGULATOR_MODE_NORMAL
366 | REGULATOR_MODE_STANDBY,
367 .valid_ops_mask = REGULATOR_CHANGE_MODE
368 | REGULATOR_CHANGE_STATUS,
369 },
370};
371
372static struct regulator_init_data omap4_panda_clk32kg = {
373 .constraints = {
374 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
375 },
376};
377
378static struct twl4030_platform_data omap4_panda_twldata = {
379 .irq_base = TWL6030_IRQ_BASE,
380 .irq_end = TWL6030_IRQ_END,
381
382 /* Regulators */
383 .vmmc = &omap4_panda_vmmc,
384 .vpp = &omap4_panda_vpp,
385 .vana = &omap4_panda_vana,
386 .vcxio = &omap4_panda_vcxio,
387 .vdac = &omap4_panda_vdac,
388 .vusb = &omap4_panda_vusb,
389 .vaux2 = &omap4_panda_vaux2,
390 .vaux3 = &omap4_panda_vaux3,
391 .clk32kg = &omap4_panda_clk32kg,
392 .usb = &omap4_usbphy_data,
393};
394 262
395/* 263/*
396 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM 264 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
@@ -404,6 +272,16 @@ static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
404 272
405static int __init omap4_panda_i2c_init(void) 273static int __init omap4_panda_i2c_init(void)
406{ 274{
275 omap4_pmic_get_config(&omap4_panda_twldata, TWL_COMMON_PDATA_USB,
276 TWL_COMMON_REGULATOR_VDAC |
277 TWL_COMMON_REGULATOR_VAUX2 |
278 TWL_COMMON_REGULATOR_VAUX3 |
279 TWL_COMMON_REGULATOR_VMMC |
280 TWL_COMMON_REGULATOR_VPP |
281 TWL_COMMON_REGULATOR_VANA |
282 TWL_COMMON_REGULATOR_VCXIO |
283 TWL_COMMON_REGULATOR_VUSB |
284 TWL_COMMON_REGULATOR_CLK32KG);
407 omap4_pmic_init("twl6030", &omap4_panda_twldata); 285 omap4_pmic_init("twl6030", &omap4_panda_twldata);
408 omap_register_i2c_bus(2, 400, NULL, 0); 286 omap_register_i2c_bus(2, 400, NULL, 0);
409 /* 287 /*
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 1bf2f39b9d0e..f1f18d03d24c 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -265,15 +265,6 @@ static struct omap_dss_board_info overo_dss_data = {
265 .default_device = &overo_dvi_device, 265 .default_device = &overo_dvi_device,
266}; 266};
267 267
268static struct regulator_consumer_supply overo_vdda_dac_supply[] = {
269 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
270};
271
272static struct regulator_consumer_supply overo_vdds_dsi_supply[] = {
273 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
274 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
275};
276
277static struct mtd_partition overo_nand_partitions[] = { 268static struct mtd_partition overo_nand_partitions[] = {
278 { 269 {
279 .name = "xloader", 270 .name = "xloader",
@@ -433,10 +424,6 @@ static struct twl4030_gpio_platform_data overo_gpio_data = {
433 .setup = overo_twl_gpio_setup, 424 .setup = overo_twl_gpio_setup,
434}; 425};
435 426
436static struct twl4030_usb_data overo_usb_data = {
437 .usb_mode = T2_USB_MODE_ULPI,
438};
439
440static struct regulator_init_data overo_vmmc1 = { 427static struct regulator_init_data overo_vmmc1 = {
441 .constraints = { 428 .constraints = {
442 .min_uV = 1850000, 429 .min_uV = 1850000,
@@ -451,55 +438,19 @@ static struct regulator_init_data overo_vmmc1 = {
451 .consumer_supplies = overo_vmmc1_supply, 438 .consumer_supplies = overo_vmmc1_supply,
452}; 439};
453 440
454/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
455static struct regulator_init_data overo_vdac = {
456 .constraints = {
457 .min_uV = 1800000,
458 .max_uV = 1800000,
459 .valid_modes_mask = REGULATOR_MODE_NORMAL
460 | REGULATOR_MODE_STANDBY,
461 .valid_ops_mask = REGULATOR_CHANGE_MODE
462 | REGULATOR_CHANGE_STATUS,
463 },
464 .num_consumer_supplies = ARRAY_SIZE(overo_vdda_dac_supply),
465 .consumer_supplies = overo_vdda_dac_supply,
466};
467
468/* VPLL2 for digital video outputs */
469static struct regulator_init_data overo_vpll2 = {
470 .constraints = {
471 .name = "VDVI",
472 .min_uV = 1800000,
473 .max_uV = 1800000,
474 .valid_modes_mask = REGULATOR_MODE_NORMAL
475 | REGULATOR_MODE_STANDBY,
476 .valid_ops_mask = REGULATOR_CHANGE_MODE
477 | REGULATOR_CHANGE_STATUS,
478 },
479 .num_consumer_supplies = ARRAY_SIZE(overo_vdds_dsi_supply),
480 .consumer_supplies = overo_vdds_dsi_supply,
481};
482
483static struct twl4030_codec_audio_data overo_audio_data;
484
485static struct twl4030_codec_data overo_codec_data = {
486 .audio_mclk = 26000000,
487 .audio = &overo_audio_data,
488};
489
490static struct twl4030_platform_data overo_twldata = { 441static struct twl4030_platform_data overo_twldata = {
491 .irq_base = TWL4030_IRQ_BASE,
492 .irq_end = TWL4030_IRQ_END,
493 .gpio = &overo_gpio_data, 442 .gpio = &overo_gpio_data,
494 .usb = &overo_usb_data,
495 .codec = &overo_codec_data,
496 .vmmc1 = &overo_vmmc1, 443 .vmmc1 = &overo_vmmc1,
497 .vdac = &overo_vdac,
498 .vpll2 = &overo_vpll2,
499}; 444};
500 445
501static int __init overo_i2c_init(void) 446static int __init overo_i2c_init(void)
502{ 447{
448 omap3_pmic_get_config(&overo_twldata,
449 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
450 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
451
452 overo_twldata.vpll2->constraints.name = "VDVI";
453
503 omap3_pmic_init("tps65950", &overo_twldata); 454 omap3_pmic_init("tps65950", &overo_twldata);
504 /* i2c2 pins are used for gpio */ 455 /* i2c2 pins are used for gpio */
505 omap_register_i2c_bus(3, 400, NULL, 0); 456 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
82static struct twl4030_usb_data rm680_usb_data = {
83 .usb_mode = T2_USB_MODE_ULPI,
84};
85
86static struct twl4030_platform_data rm680_twl_data = { 82static 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
94static void __init rm680_i2c_init(void) 87static 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..6140290721a0 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
291static 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. */
296static struct omap_board_mux rx51_mmc2_on_mux[] = { 292static 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),
@@ -398,10 +394,6 @@ static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
398 REGULATOR_SUPPLY("vdd", "2-0063"), 394 REGULATOR_SUPPLY("vdd", "2-0063"),
399}; 395};
400 396
401static struct regulator_consumer_supply rx51_vdac_supply[] = {
402 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
403};
404
405static struct regulator_init_data rx51_vaux1 = { 397static struct regulator_init_data rx51_vaux1 = {
406 .constraints = { 398 .constraints = {
407 .name = "V28", 399 .name = "V28",
@@ -518,21 +510,6 @@ static struct regulator_init_data rx51_vsim = {
518 .consumer_supplies = rx51_vsim_supply, 510 .consumer_supplies = rx51_vsim_supply,
519}; 511};
520 512
521static struct regulator_init_data rx51_vdac = {
522 .constraints = {
523 .name = "VDAC",
524 .min_uV = 1800000,
525 .max_uV = 1800000,
526 .apply_uV = true,
527 .valid_modes_mask = REGULATOR_MODE_NORMAL
528 | REGULATOR_MODE_STANDBY,
529 .valid_ops_mask = REGULATOR_CHANGE_MODE
530 | REGULATOR_CHANGE_STATUS,
531 },
532 .num_consumer_supplies = ARRAY_SIZE(rx51_vdac_supply),
533 .consumer_supplies = rx51_vdac_supply,
534};
535
536static struct regulator_init_data rx51_vio = { 513static struct regulator_init_data rx51_vio = {
537 .constraints = { 514 .constraints = {
538 .min_uV = 1800000, 515 .min_uV = 1800000,
@@ -603,10 +580,6 @@ static struct twl4030_gpio_platform_data rx51_gpio_data = {
603 .setup = rx51_twlgpio_setup, 580 .setup = rx51_twlgpio_setup,
604}; 581};
605 582
606static struct twl4030_usb_data rx51_usb_data = {
607 .usb_mode = T2_USB_MODE_ULPI,
608};
609
610static struct twl4030_ins sleep_on_seq[] __initdata = { 583static struct twl4030_ins sleep_on_seq[] __initdata = {
611/* 584/*
612 * Turn off everything 585 * Turn off everything
@@ -778,14 +751,9 @@ struct twl4030_codec_data rx51_codec_data __initdata = {
778}; 751};
779 752
780static struct twl4030_platform_data rx51_twldata __initdata = { 753static 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 */ 754 /* platform_data for children goes here */
785 .gpio = &rx51_gpio_data, 755 .gpio = &rx51_gpio_data,
786 .keypad = &rx51_kp_data, 756 .keypad = &rx51_kp_data,
787 .madc = &rx51_madc_data,
788 .usb = &rx51_usb_data,
789 .power = &rx51_t2scripts_data, 757 .power = &rx51_t2scripts_data,
790 .codec = &rx51_codec_data, 758 .codec = &rx51_codec_data,
791 759
@@ -794,7 +762,6 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
794 .vaux4 = &rx51_vaux4, 762 .vaux4 = &rx51_vaux4,
795 .vmmc1 = &rx51_vmmc1, 763 .vmmc1 = &rx51_vmmc1,
796 .vsim = &rx51_vsim, 764 .vsim = &rx51_vsim,
797 .vdac = &rx51_vdac,
798 .vio = &rx51_vio, 765 .vio = &rx51_vio,
799}; 766};
800 767
@@ -850,6 +817,13 @@ static int __init rx51_i2c_init(void)
850 rx51_twldata.vaux3 = &rx51_vaux3_cam; 817 rx51_twldata.vaux3 = &rx51_vaux3_cam;
851 } 818 }
852 rx51_twldata.vmmc2 = &rx51_vmmc2; 819 rx51_twldata.vmmc2 = &rx51_vmmc2;
820 omap3_pmic_get_config(&rx51_twldata,
821 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC,
822 TWL_COMMON_REGULATOR_VDAC);
823
824 rx51_twldata.vdac->constraints.apply_uV = true;
825 rx51_twldata.vdac->constraints.name = "VDAC";
826
853 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); 827 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, 828 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
855 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 829 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..13a644233667 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -226,41 +226,6 @@ static struct omap2_hsmmc_info mmc[] = {
226 {} /* Terminator */ 226 {} /* Terminator */
227}; 227};
228 228
229static struct regulator_consumer_supply zoom_vpll2_supplies[] = {
230 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
231 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
232};
233
234static struct regulator_consumer_supply zoom_vdda_dac_supply[] = {
235 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
236};
237
238static struct regulator_init_data zoom_vpll2 = {
239 .constraints = {
240 .min_uV = 1800000,
241 .max_uV = 1800000,
242 .valid_modes_mask = REGULATOR_MODE_NORMAL
243 | REGULATOR_MODE_STANDBY,
244 .valid_ops_mask = REGULATOR_CHANGE_MODE
245 | REGULATOR_CHANGE_STATUS,
246 },
247 .num_consumer_supplies = ARRAY_SIZE(zoom_vpll2_supplies),
248 .consumer_supplies = zoom_vpll2_supplies,
249};
250
251static struct regulator_init_data zoom_vdac = {
252 .constraints = {
253 .min_uV = 1800000,
254 .max_uV = 1800000,
255 .valid_modes_mask = REGULATOR_MODE_NORMAL
256 | REGULATOR_MODE_STANDBY,
257 .valid_ops_mask = REGULATOR_CHANGE_MODE
258 | REGULATOR_CHANGE_STATUS,
259 },
260 .num_consumer_supplies = ARRAY_SIZE(zoom_vdda_dac_supply),
261 .consumer_supplies = zoom_vdda_dac_supply,
262};
263
264static int zoom_twl_gpio_setup(struct device *dev, 229static int zoom_twl_gpio_setup(struct device *dev,
265 unsigned gpio, unsigned ngpio) 230 unsigned gpio, unsigned ngpio)
266{ 231{
@@ -285,26 +250,6 @@ static void zoom2_set_hs_extmute(int mute)
285 gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute); 250 gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute);
286} 251}
287 252
288static int zoom_batt_table[] = {
289/* 0 C*/
29030800, 29500, 28300, 27100,
29126000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
29217200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
29311600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
2948020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
2955640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
2964040, 3910, 3790, 3670, 3550
297};
298
299static struct twl4030_bci_platform_data zoom_bci_data = {
300 .battery_tmp_tbl = zoom_batt_table,
301 .tblsize = ARRAY_SIZE(zoom_batt_table),
302};
303
304static struct twl4030_usb_data zoom_usb_data = {
305 .usb_mode = T2_USB_MODE_ULPI,
306};
307
308static struct twl4030_gpio_platform_data zoom_gpio_data = { 253static struct twl4030_gpio_platform_data zoom_gpio_data = {
309 .gpio_base = OMAP_MAX_GPIO_LINES, 254 .gpio_base = OMAP_MAX_GPIO_LINES,
310 .irq_base = TWL4030_GPIO_IRQ_BASE, 255 .irq_base = TWL4030_GPIO_IRQ_BASE,
@@ -312,41 +257,29 @@ static struct twl4030_gpio_platform_data zoom_gpio_data = {
312 .setup = zoom_twl_gpio_setup, 257 .setup = zoom_twl_gpio_setup,
313}; 258};
314 259
315static struct twl4030_madc_platform_data zoom_madc_data = {
316 .irq_line = 1,
317};
318
319static struct twl4030_codec_audio_data zoom_audio_data;
320
321static struct twl4030_codec_data zoom_codec_data = {
322 .audio_mclk = 26000000,
323 .audio = &zoom_audio_data,
324};
325
326static struct twl4030_platform_data zoom_twldata = { 260static 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 */ 261 /* 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, 262 .gpio = &zoom_gpio_data,
335 .keypad = &zoom_kp_twl4030_data, 263 .keypad = &zoom_kp_twl4030_data,
336 .codec = &zoom_codec_data,
337 .vmmc1 = &zoom_vmmc1, 264 .vmmc1 = &zoom_vmmc1,
338 .vmmc2 = &zoom_vmmc2, 265 .vmmc2 = &zoom_vmmc2,
339 .vsim = &zoom_vsim, 266 .vsim = &zoom_vsim,
340 .vpll2 = &zoom_vpll2,
341 .vdac = &zoom_vdac,
342}; 267};
343 268
344static int __init omap_i2c_init(void) 269static int __init omap_i2c_init(void)
345{ 270{
271 omap3_pmic_get_config(&zoom_twldata,
272 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
273 TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
274 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
275
346 if (machine_is_omap_zoom2()) { 276 if (machine_is_omap_zoom2()) {
347 zoom_audio_data.ramp_delay_value = 3; /* 161 ms */ 277 struct twl4030_codec_audio_data *audio_data;
348 zoom_audio_data.hs_extmute = 1; 278 audio_data = zoom_twldata.codec->audio;
349 zoom_audio_data.set_hs_extmute = zoom2_set_hs_extmute; 279
280 audio_data->ramp_delay_value = 3; /* 161 ms */
281 audio_data->hs_extmute = 1;
282 audio_data->set_hs_extmute = zoom2_set_hs_extmute;
350 } 283 }
351 omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata); 284 omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata);
352 omap_register_i2c_bus(2, 400, NULL, 0); 285 omap_register_i2c_bus(2, 400, NULL, 0);
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index 0043fa8e3703..bcb0c5817167 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -20,36 +20,15 @@
20 * 20 *
21 */ 21 */
22 22
23#include <linux/i2c.h>
24#include <linux/i2c/twl.h>
25
26#include <linux/gpio.h> 23#include <linux/gpio.h>
27#include <linux/spi/spi.h> 24#include <linux/spi/spi.h>
28#include <linux/spi/ads7846.h> 25#include <linux/spi/ads7846.h>
29 26
30#include <plat/i2c.h>
31#include <plat/mcspi.h> 27#include <plat/mcspi.h>
32#include <plat/nand.h> 28#include <plat/nand.h>
33 29
34#include "common-board-devices.h" 30#include "common-board-devices.h"
35 31
36static struct i2c_board_info __initdata pmic_i2c_board_info = {
37 .addr = 0x48,
38 .flags = I2C_CLIENT_WAKE,
39};
40
41void __init omap_pmic_init(int bus, u32 clkrate,
42 const char *pmic_type, int pmic_irq,
43 struct twl4030_platform_data *pmic_data)
44{
45 strncpy(pmic_i2c_board_info.type, pmic_type,
46 sizeof(pmic_i2c_board_info.type));
47 pmic_i2c_board_info.irq = pmic_irq;
48 pmic_i2c_board_info.platform_data = pmic_data;
49
50 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
51}
52
53#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ 32#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
54 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 33 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
55static struct omap2_mcspi_device_config ads7846_mcspi_config = { 34static struct omap2_mcspi_device_config ads7846_mcspi_config = {
diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h
index 679719051df5..a0b4a42836ab 100644
--- a/arch/arm/mach-omap2/common-board-devices.h
+++ b/arch/arm/mach-omap2/common-board-devices.h
@@ -1,33 +1,11 @@
1#ifndef __OMAP_COMMON_BOARD_DEVICES__ 1#ifndef __OMAP_COMMON_BOARD_DEVICES__
2#define __OMAP_COMMON_BOARD_DEVICES__ 2#define __OMAP_COMMON_BOARD_DEVICES__
3 3
4#include "twl-common.h"
5
4#define NAND_BLOCK_SIZE SZ_128K 6#define NAND_BLOCK_SIZE SZ_128K
5 7
6struct twl4030_platform_data;
7struct mtd_partition; 8struct mtd_partition;
8
9void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
10 struct twl4030_platform_data *pmic_data);
11
12static inline void omap2_pmic_init(const char *pmic_type,
13 struct twl4030_platform_data *pmic_data)
14{
15 omap_pmic_init(2, 2600, pmic_type, INT_24XX_SYS_NIRQ, pmic_data);
16}
17
18static inline void omap3_pmic_init(const char *pmic_type,
19 struct twl4030_platform_data *pmic_data)
20{
21 omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data);
22}
23
24static inline void omap4_pmic_init(const char *pmic_type,
25 struct twl4030_platform_data *pmic_data)
26{
27 /* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */
28 omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data);
29}
30
31struct ads7846_platform_data; 9struct ads7846_platform_data;
32 10
33void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, 11void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
new file mode 100644
index 000000000000..3aaa46f6cd12
--- /dev/null
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -0,0 +1,304 @@
1/*
2 * twl-common.c
3 *
4 * Copyright (C) 2011 Texas Instruments, Inc..
5 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 */
22
23#include <linux/i2c.h>
24#include <linux/i2c/twl.h>
25#include <linux/gpio.h>
26#include <linux/regulator/machine.h>
27#include <linux/regulator/fixed.h>
28
29#include <plat/i2c.h>
30#include <plat/usb.h>
31
32#include "twl-common.h"
33
34static struct i2c_board_info __initdata pmic_i2c_board_info = {
35 .addr = 0x48,
36 .flags = I2C_CLIENT_WAKE,
37};
38
39void __init omap_pmic_init(int bus, u32 clkrate,
40 const char *pmic_type, int pmic_irq,
41 struct twl4030_platform_data *pmic_data)
42{
43 strncpy(pmic_i2c_board_info.type, pmic_type,
44 sizeof(pmic_i2c_board_info.type));
45 pmic_i2c_board_info.irq = pmic_irq;
46 pmic_i2c_board_info.platform_data = pmic_data;
47
48 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
49}
50
51static struct twl4030_usb_data omap4_usb_pdata = {
52 .phy_init = omap4430_phy_init,
53 .phy_exit = omap4430_phy_exit,
54 .phy_power = omap4430_phy_power,
55 .phy_set_clock = omap4430_phy_set_clk,
56 .phy_suspend = omap4430_phy_suspend,
57};
58
59static struct twl4030_usb_data omap3_usb_pdata = {
60 .usb_mode = T2_USB_MODE_ULPI,
61};
62
63static int omap3_batt_table[] = {
64/* 0 C */
6530800, 29500, 28300, 27100,
6626000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
6717200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
6811600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
698020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
705640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
714040, 3910, 3790, 3670, 3550
72};
73
74static struct twl4030_bci_platform_data omap3_bci_pdata = {
75 .battery_tmp_tbl = omap3_batt_table,
76 .tblsize = ARRAY_SIZE(omap3_batt_table),
77};
78
79static struct twl4030_madc_platform_data omap3_madc_pdata = {
80 .irq_line = 1,
81};
82
83static struct twl4030_codec_audio_data omap3_audio;
84
85static struct twl4030_codec_data omap3_codec_pdata = {
86 .audio_mclk = 26000000,
87 .audio = &omap3_audio,
88};
89
90static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = {
91 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
92};
93
94static struct regulator_init_data omap3_vdac_idata = {
95 .constraints = {
96 .min_uV = 1800000,
97 .max_uV = 1800000,
98 .valid_modes_mask = REGULATOR_MODE_NORMAL
99 | REGULATOR_MODE_STANDBY,
100 .valid_ops_mask = REGULATOR_CHANGE_MODE
101 | REGULATOR_CHANGE_STATUS,
102 },
103 .num_consumer_supplies = ARRAY_SIZE(omap3_vdda_dac_supplies),
104 .consumer_supplies = omap3_vdda_dac_supplies,
105};
106
107static struct regulator_consumer_supply omap3_vpll2_supplies[] = {
108 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
109 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
110};
111
112static struct regulator_init_data omap3_vpll2_idata = {
113 .constraints = {
114 .min_uV = 1800000,
115 .max_uV = 1800000,
116 .valid_modes_mask = REGULATOR_MODE_NORMAL
117 | REGULATOR_MODE_STANDBY,
118 .valid_ops_mask = REGULATOR_CHANGE_MODE
119 | REGULATOR_CHANGE_STATUS,
120 },
121 .num_consumer_supplies = ARRAY_SIZE(omap3_vpll2_supplies),
122 .consumer_supplies = omap3_vpll2_supplies,
123};
124
125static struct regulator_init_data omap4_vdac_idata = {
126 .constraints = {
127 .min_uV = 1800000,
128 .max_uV = 1800000,
129 .valid_modes_mask = REGULATOR_MODE_NORMAL
130 | REGULATOR_MODE_STANDBY,
131 .valid_ops_mask = REGULATOR_CHANGE_MODE
132 | REGULATOR_CHANGE_STATUS,
133 },
134};
135
136static struct regulator_init_data omap4_vaux2_idata = {
137 .constraints = {
138 .min_uV = 1200000,
139 .max_uV = 2800000,
140 .apply_uV = true,
141 .valid_modes_mask = REGULATOR_MODE_NORMAL
142 | REGULATOR_MODE_STANDBY,
143 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
144 | REGULATOR_CHANGE_MODE
145 | REGULATOR_CHANGE_STATUS,
146 },
147};
148
149static struct regulator_init_data omap4_vaux3_idata = {
150 .constraints = {
151 .min_uV = 1000000,
152 .max_uV = 3000000,
153 .apply_uV = true,
154 .valid_modes_mask = REGULATOR_MODE_NORMAL
155 | REGULATOR_MODE_STANDBY,
156 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
157 | REGULATOR_CHANGE_MODE
158 | REGULATOR_CHANGE_STATUS,
159 },
160};
161
162static struct regulator_consumer_supply omap4_vmmc_supply[] = {
163 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
164};
165
166/* VMMC1 for MMC1 card */
167static struct regulator_init_data omap4_vmmc_idata = {
168 .constraints = {
169 .min_uV = 1200000,
170 .max_uV = 3000000,
171 .apply_uV = true,
172 .valid_modes_mask = REGULATOR_MODE_NORMAL
173 | REGULATOR_MODE_STANDBY,
174 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
175 | REGULATOR_CHANGE_MODE
176 | REGULATOR_CHANGE_STATUS,
177 },
178 .num_consumer_supplies = ARRAY_SIZE(omap4_vmmc_supply),
179 .consumer_supplies = omap4_vmmc_supply,
180};
181
182static struct regulator_init_data omap4_vpp_idata = {
183 .constraints = {
184 .min_uV = 1800000,
185 .max_uV = 2500000,
186 .apply_uV = true,
187 .valid_modes_mask = REGULATOR_MODE_NORMAL
188 | REGULATOR_MODE_STANDBY,
189 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
190 | REGULATOR_CHANGE_MODE
191 | REGULATOR_CHANGE_STATUS,
192 },
193};
194
195static struct regulator_init_data omap4_vana_idata = {
196 .constraints = {
197 .min_uV = 2100000,
198 .max_uV = 2100000,
199 .valid_modes_mask = REGULATOR_MODE_NORMAL
200 | REGULATOR_MODE_STANDBY,
201 .valid_ops_mask = REGULATOR_CHANGE_MODE
202 | REGULATOR_CHANGE_STATUS,
203 },
204};
205
206static struct regulator_init_data omap4_vcxio_idata = {
207 .constraints = {
208 .min_uV = 1800000,
209 .max_uV = 1800000,
210 .valid_modes_mask = REGULATOR_MODE_NORMAL
211 | REGULATOR_MODE_STANDBY,
212 .valid_ops_mask = REGULATOR_CHANGE_MODE
213 | REGULATOR_CHANGE_STATUS,
214 },
215};
216
217static struct regulator_init_data omap4_vusb_idata = {
218 .constraints = {
219 .min_uV = 3300000,
220 .max_uV = 3300000,
221 .apply_uV = true,
222 .valid_modes_mask = REGULATOR_MODE_NORMAL
223 | REGULATOR_MODE_STANDBY,
224 .valid_ops_mask = REGULATOR_CHANGE_MODE
225 | REGULATOR_CHANGE_STATUS,
226 },
227};
228
229static struct regulator_init_data omap4_clk32kg_idata = {
230 .constraints = {
231 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
232 },
233};
234
235void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
236 u32 pdata_flags, u32 regulators_flags)
237{
238 if (!pmic_data->irq_base)
239 pmic_data->irq_base = TWL6030_IRQ_BASE;
240 if (!pmic_data->irq_end)
241 pmic_data->irq_end = TWL6030_IRQ_END;
242
243 /* Common platform data configurations */
244 if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)
245 pmic_data->usb = &omap4_usb_pdata;
246
247 /* Common regulator configurations */
248 if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac)
249 pmic_data->vdac = &omap4_vdac_idata;
250
251 if (regulators_flags & TWL_COMMON_REGULATOR_VAUX2 && !pmic_data->vaux2)
252 pmic_data->vaux2 = &omap4_vaux2_idata;
253
254 if (regulators_flags & TWL_COMMON_REGULATOR_VAUX3 && !pmic_data->vaux3)
255 pmic_data->vaux3 = &omap4_vaux3_idata;
256
257 if (regulators_flags & TWL_COMMON_REGULATOR_VMMC && !pmic_data->vmmc)
258 pmic_data->vmmc = &omap4_vmmc_idata;
259
260 if (regulators_flags & TWL_COMMON_REGULATOR_VPP && !pmic_data->vpp)
261 pmic_data->vpp = &omap4_vpp_idata;
262
263 if (regulators_flags & TWL_COMMON_REGULATOR_VANA && !pmic_data->vana)
264 pmic_data->vana = &omap4_vana_idata;
265
266 if (regulators_flags & TWL_COMMON_REGULATOR_VCXIO && !pmic_data->vcxio)
267 pmic_data->vcxio = &omap4_vcxio_idata;
268
269 if (regulators_flags & TWL_COMMON_REGULATOR_VUSB && !pmic_data->vusb)
270 pmic_data->vusb = &omap4_vusb_idata;
271
272 if (regulators_flags & TWL_COMMON_REGULATOR_CLK32KG &&
273 !pmic_data->clk32kg)
274 pmic_data->clk32kg = &omap4_clk32kg_idata;
275}
276
277void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
278 u32 pdata_flags, u32 regulators_flags)
279{
280 if (!pmic_data->irq_base)
281 pmic_data->irq_base = TWL4030_IRQ_BASE;
282 if (!pmic_data->irq_end)
283 pmic_data->irq_end = TWL4030_IRQ_END;
284
285 /* Common platform data configurations */
286 if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)
287 pmic_data->usb = &omap3_usb_pdata;
288
289 if (pdata_flags & TWL_COMMON_PDATA_BCI && !pmic_data->bci)
290 pmic_data->bci = &omap3_bci_pdata;
291
292 if (pdata_flags & TWL_COMMON_PDATA_MADC && !pmic_data->madc)
293 pmic_data->madc = &omap3_madc_pdata;
294
295 if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->codec)
296 pmic_data->codec = &omap3_codec_pdata;
297
298 /* Common regulator configurations */
299 if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac)
300 pmic_data->vdac = &omap3_vdac_idata;
301
302 if (regulators_flags & TWL_COMMON_REGULATOR_VPLL2 && !pmic_data->vpll2)
303 pmic_data->vpll2 = &omap3_vpll2_idata;
304}
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
new file mode 100644
index 000000000000..5e83a5bd37fb
--- /dev/null
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -0,0 +1,59 @@
1#ifndef __OMAP_PMIC_COMMON__
2#define __OMAP_PMIC_COMMON__
3
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)
8
9/* Common LDO regulators for TWL4030/TWL6030 */
10#define TWL_COMMON_REGULATOR_VDAC (1 << 0)
11#define TWL_COMMON_REGULATOR_VAUX1 (1 << 1)
12#define TWL_COMMON_REGULATOR_VAUX2 (1 << 2)
13#define TWL_COMMON_REGULATOR_VAUX3 (1 << 3)
14
15/* TWL6030 LDO regulators */
16#define TWL_COMMON_REGULATOR_VMMC (1 << 4)
17#define TWL_COMMON_REGULATOR_VPP (1 << 5)
18#define TWL_COMMON_REGULATOR_VUSIM (1 << 6)
19#define TWL_COMMON_REGULATOR_VANA (1 << 7)
20#define TWL_COMMON_REGULATOR_VCXIO (1 << 8)
21#define TWL_COMMON_REGULATOR_VUSB (1 << 9)
22#define TWL_COMMON_REGULATOR_CLK32KG (1 << 10)
23
24/* TWL4030 LDO regulators */
25#define TWL_COMMON_REGULATOR_VPLL1 (1 << 4)
26#define TWL_COMMON_REGULATOR_VPLL2 (1 << 5)
27
28
29struct twl4030_platform_data;
30
31void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
32 struct twl4030_platform_data *pmic_data);
33
34static inline void omap2_pmic_init(const char *pmic_type,
35 struct twl4030_platform_data *pmic_data)
36{
37 omap_pmic_init(2, 2600, pmic_type, INT_24XX_SYS_NIRQ, pmic_data);
38}
39
40static inline void omap3_pmic_init(const char *pmic_type,
41 struct twl4030_platform_data *pmic_data)
42{
43 omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data);
44}
45
46static inline void omap4_pmic_init(const char *pmic_type,
47 struct twl4030_platform_data *pmic_data)
48{
49 /* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */
50 omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data);
51}
52
53void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
54 u32 pdata_flags, u32 regulators_flags);
55
56void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
57 u32 pdata_flags, u32 regulators_flags);
58
59#endif /* __OMAP_PMIC_COMMON__ */
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index 6c5350832407..9882c657b2d4 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -33,7 +33,7 @@
33#define OMAP_MCBSP_PLATFORM_DEVICE(port_nr) \ 33#define OMAP_MCBSP_PLATFORM_DEVICE(port_nr) \
34static struct platform_device omap_mcbsp##port_nr = { \ 34static struct platform_device omap_mcbsp##port_nr = { \
35 .name = "omap-mcbsp-dai", \ 35 .name = "omap-mcbsp-dai", \
36 .id = OMAP_MCBSP##port_nr, \ 36 .id = port_nr - 1, \
37} 37}
38 38
39#define MCBSP_CONFIG_TYPE2 0x2 39#define MCBSP_CONFIG_TYPE2 0x2
@@ -332,14 +332,6 @@ struct omap_mcbsp_reg_cfg {
332}; 332};
333 333
334typedef enum { 334typedef enum {
335 OMAP_MCBSP1 = 0,
336 OMAP_MCBSP2,
337 OMAP_MCBSP3,
338 OMAP_MCBSP4,
339 OMAP_MCBSP5
340} omap_mcbsp_id;
341
342typedef enum {
343 OMAP_MCBSP_WORD_8 = 0, 335 OMAP_MCBSP_WORD_8 = 0,
344 OMAP_MCBSP_WORD_12, 336 OMAP_MCBSP_WORD_12,
345 OMAP_MCBSP_WORD_16, 337 OMAP_MCBSP_WORD_16,
@@ -385,8 +377,6 @@ struct omap_mcbsp {
385 void __iomem *io_base; 377 void __iomem *io_base;
386 u8 id; 378 u8 id;
387 u8 free; 379 u8 free;
388 omap_mcbsp_word_length rx_word_length;
389 omap_mcbsp_word_length tx_word_length;
390 380
391 int rx_irq; 381 int rx_irq;
392 int tx_irq; 382 int tx_irq;
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 455eadcd820c..3c1fbdc92468 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -869,9 +869,6 @@ void omap_mcbsp_start(unsigned int id, int tx, int rx)
869 if (cpu_is_omap34xx()) 869 if (cpu_is_omap34xx())
870 omap_st_start(mcbsp); 870 omap_st_start(mcbsp);
871 871
872 mcbsp->rx_word_length = (MCBSP_READ_CACHE(mcbsp, RCR1) >> 5) & 0x7;
873 mcbsp->tx_word_length = (MCBSP_READ_CACHE(mcbsp, XCR1) >> 5) & 0x7;
874
875 /* Only enable SRG, if McBSP is master */ 872 /* Only enable SRG, if McBSP is master */
876 w = MCBSP_READ_CACHE(mcbsp, PCR0); 873 w = MCBSP_READ_CACHE(mcbsp, PCR0);
877 if (w & (FSXM | FSRM | CLKXM | CLKRM)) 874 if (w & (FSXM | FSRM | CLKXM | CLKRM))