diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-06-07 03:26:46 -0400 |
---|---|---|
committer | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-07-04 11:43:33 -0400 |
commit | b22f954bae35be115a10c6426dc070f7d652b32e (patch) | |
tree | 2144bd55d658b284eb8d56d315d4177adf2f9186 /arch/arm/mach-omap2/board-4430sdp.c | |
parent | a53b8e3b995f8b7c8a8c4ef5aa367958e46139b3 (diff) |
OMAP4: Move common twl6030 configuration to twl-common
Reduce the amount of duplicated code by moving the common
configuration for TWL6030 (on OMAP4 platform) to the
twl-common file.
Use the omap4_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/mach-omap2/board-4430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 141 |
1 files changed, 10 insertions, 131 deletions
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 | ||
305 | static 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 | |||
313 | static struct omap2_hsmmc_info mmc[] = { | 305 | static 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 | ||
335 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | ||
336 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | ||
337 | }; | ||
338 | |||
339 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | 327 | static 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 | ||
397 | static 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 | |||
410 | static 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 */ | ||
424 | static 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 | |||
439 | static 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 | |||
452 | static struct regulator_init_data sdp4430_vusim = { | 385 | static 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 | ||
465 | static 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 | |||
476 | static 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 | |||
487 | static 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 | |||
498 | static 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 | |||
510 | static struct regulator_init_data sdp4430_clk32kg = { | ||
511 | .constraints = { | ||
512 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
513 | }, | ||
514 | }; | ||
515 | |||
516 | static struct twl4030_platform_data sdp4430_twldata = { | 398 | static 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 | ||
535 | static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { | 404 | static 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 | }; |
548 | static int __init omap4_i2c_init(void) | 417 | static 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, |