aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorAmit Kucheria <amit.kucheria@verdurent.com>2009-10-19 08:11:08 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2009-12-13 13:21:29 -0500
commit3c684e84d1ab810764c7f509aed74a5c48c590ad (patch)
treea857c1e2d3c3b7147a6c2fa6aef1b6cfa7e6a523 /arch/arm/mach-omap2
parent24213ae19aed6307e309125cc5fcb14e52e475ed (diff)
mfd: Optimised twl4030-power power scripts for the rx51
The power scripts optimisation was mainly done by: Tero Kristo <tero.kristo@nokia.com> and Arnaud Mandy <ext-arnaud.2.mandy@nokia.com> I'm only refactoring and testing it against the mainline kernel. Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com> Cc: Tero Kristo <tero.kristo@nokia.com> Cc: linux-omap@vger.kernel.org Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c118
1 files changed, 82 insertions, 36 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index bf26ad31f9ba..17f3c91231db 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -402,15 +402,9 @@ static struct twl4030_usb_data rx51_usb_data = {
402 402
403static struct twl4030_ins sleep_on_seq[] __initdata = { 403static struct twl4030_ins sleep_on_seq[] __initdata = {
404/* 404/*
405 * Turn off VDD1 and VDD2. 405 * Turn off everything
406 */ 406 */
407 {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 4}, 407 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_SLEEP), 2},
408 {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
409/*
410 * And also turn off the OMAP3 PLLs and the sysclk output.
411 */
412 {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 3},
413 {MSG_SINGULAR(DEV_GRP_P1, 0x17, RES_STATE_OFF), 3},
414}; 408};
415 409
416static struct twl4030_script sleep_on_script __initdata = { 410static struct twl4030_script sleep_on_script __initdata = {
@@ -421,14 +415,9 @@ static struct twl4030_script sleep_on_script __initdata = {
421 415
422static struct twl4030_ins wakeup_seq[] __initdata = { 416static struct twl4030_ins wakeup_seq[] __initdata = {
423/* 417/*
424 * Reenable the OMAP3 PLLs. 418 * Reenable everything
425 * Wakeup VDD1 and VDD2.
426 * Reenable sysclk output.
427 */ 419 */
428 {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 0x30}, 420 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_ACTIVE), 2},
429 {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 0x30},
430 {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 0x37},
431 {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 3},
432}; 421};
433 422
434static struct twl4030_script wakeup_script __initdata = { 423static struct twl4030_script wakeup_script __initdata = {
@@ -439,10 +428,9 @@ static struct twl4030_script wakeup_script __initdata = {
439 428
440static struct twl4030_ins wakeup_p3_seq[] __initdata = { 429static struct twl4030_ins wakeup_p3_seq[] __initdata = {
441/* 430/*
442 * Wakeup VDD1 (dummy to be able to insert a delay) 431 * Reenable everything
443 * Enable CLKEN
444 */ 432 */
445 {MSG_SINGULAR(DEV_GRP_P1, 0x17, RES_STATE_ACTIVE), 3}, 433 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_ACTIVE), 2},
446}; 434};
447 435
448static struct twl4030_script wakeup_p3_script __initdata = { 436static struct twl4030_script wakeup_p3_script __initdata = {
@@ -463,12 +451,11 @@ static struct twl4030_ins wrst_seq[] __initdata = {
463 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2}, 451 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2},
464 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 0, 1, RES_STATE_ACTIVE), 452 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 0, 1, RES_STATE_ACTIVE),
465 0x13}, 453 0x13},
466 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP, 0, 2, RES_STATE_WRST), 0x13},
467 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP, 0, 3, RES_STATE_OFF), 0x13}, 454 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP, 0, 3, RES_STATE_OFF), 0x13},
468 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD1, RES_STATE_WRST), 0x13}, 455 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD1, RES_STATE_WRST), 0x13},
469 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD2, RES_STATE_WRST), 0x13}, 456 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD2, RES_STATE_WRST), 0x13},
470 {MSG_SINGULAR(DEV_GRP_NULL, RES_VPLL1, RES_STATE_WRST), 0x35}, 457 {MSG_SINGULAR(DEV_GRP_NULL, RES_VPLL1, RES_STATE_WRST), 0x35},
471 {MSG_SINGULAR(DEV_GRP_P1, RES_HFCLKOUT, RES_STATE_ACTIVE), 2}, 458 {MSG_SINGULAR(DEV_GRP_P3, RES_HFCLKOUT, RES_STATE_ACTIVE), 2},
472 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2}, 459 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2},
473}; 460};
474 461
@@ -490,22 +477,81 @@ static struct twl4030_script *twl4030_scripts[] __initdata = {
490}; 477};
491 478
492static struct twl4030_resconfig twl4030_rconfig[] __initdata = { 479static struct twl4030_resconfig twl4030_rconfig[] __initdata = {
493 { .resource = RES_VINTANA1, .devgroup = -1, .type = -1, .type2 = 1 }, 480 { .resource = RES_VDD1, .devgroup = -1,
494 { .resource = RES_VINTANA2, .devgroup = -1, .type = -1, .type2 = 1 }, 481 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
495 { .resource = RES_VINTDIG, .devgroup = -1, .type = -1, .type2 = 1 }, 482 .remap_sleep = RES_STATE_OFF
496 { .resource = RES_VMMC1, .devgroup = -1, .type = -1, .type2 = 3}, 483 },
497 { .resource = RES_VMMC2, .devgroup = DEV_GRP_NULL, .type = -1, 484 { .resource = RES_VDD2, .devgroup = -1,
498 .type2 = 3}, 485 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
499 { .resource = RES_VAUX1, .devgroup = -1, .type = -1, .type2 = 3}, 486 .remap_sleep = RES_STATE_OFF
500 { .resource = RES_VAUX2, .devgroup = -1, .type = -1, .type2 = 3}, 487 },
501 { .resource = RES_VAUX3, .devgroup = -1, .type = -1, .type2 = 3}, 488 { .resource = RES_VPLL1, .devgroup = -1,
502 { .resource = RES_VAUX4, .devgroup = -1, .type = -1, .type2 = 3}, 489 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
503 { .resource = RES_VPLL2, .devgroup = -1, .type = -1, .type2 = 3}, 490 .remap_sleep = RES_STATE_OFF
504 { .resource = RES_VDAC, .devgroup = -1, .type = -1, .type2 = 3}, 491 },
505 { .resource = RES_VSIM, .devgroup = DEV_GRP_NULL, .type = -1, 492 { .resource = RES_VPLL2, .devgroup = -1,
506 .type2 = 3}, 493 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
507 { .resource = RES_CLKEN, .devgroup = DEV_GRP_P3, .type = -1, 494 },
508 .type2 = 1 }, 495 { .resource = RES_VAUX1, .devgroup = -1,
496 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
497 },
498 { .resource = RES_VAUX2, .devgroup = -1,
499 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
500 },
501 { .resource = RES_VAUX3, .devgroup = -1,
502 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
503 },
504 { .resource = RES_VAUX4, .devgroup = -1,
505 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
506 },
507 { .resource = RES_VMMC1, .devgroup = -1,
508 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
509 },
510 { .resource = RES_VMMC2, .devgroup = -1,
511 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
512 },
513 { .resource = RES_VDAC, .devgroup = -1,
514 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
515 },
516 { .resource = RES_VSIM, .devgroup = -1,
517 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
518 },
519 { .resource = RES_VINTANA1, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
520 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
521 },
522 { .resource = RES_VINTANA2, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
523 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
524 },
525 { .resource = RES_VINTDIG, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
526 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
527 },
528 { .resource = RES_VIO, .devgroup = DEV_GRP_P3,
529 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
530 },
531 { .resource = RES_CLKEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
532 .type = 1, .type2 = -1 , .remap_off = -1, .remap_sleep = -1
533 },
534 { .resource = RES_REGEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
535 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
536 },
537 { .resource = RES_NRES_PWRON, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
538 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
539 },
540 { .resource = RES_SYSEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
541 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
542 },
543 { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3,
544 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
545 },
546 { .resource = RES_32KCLKOUT, .devgroup = -1,
547 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
548 },
549 { .resource = RES_RESET, .devgroup = -1,
550 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
551 },
552 { .resource = RES_Main_Ref, .devgroup = -1,
553 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
554 },
509 { 0, 0}, 555 { 0, 0},
510}; 556};
511 557