twl-regulator: Add turnon-delay and REMAP config to twlreg_info struct

This change includes regulator turnon delay values and the REMAP reset
configuration to the twlreg_info struct, since they are basic attributes
of every TWL regulator

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>

authored by Juha Keski-Saari and committed by Liam Girdwood 045f972f 205e5cd3

+61 -40
+61 -40
drivers/regulator/twl-regulator.c
··· 40 40 u8 table_len; 41 41 const u16 *table; 42 42 43 + /* regulator specific turn-on delay */ 44 + u16 delay; 45 + 46 + /* State REMAP default configuration */ 47 + u8 remap; 48 + 43 49 /* chip constraints on regulator behavior */ 44 50 u16 min_mV; 45 51 ··· 432 426 433 427 /*----------------------------------------------------------------------*/ 434 428 435 - #define TWL4030_ADJUSTABLE_LDO(label, offset, num) \ 436 - TWL_ADJUSTABLE_LDO(label, offset, num, TWL4030) 437 - #define TWL4030_FIXED_LDO(label, offset, mVolts, num) \ 438 - TWL_FIXED_LDO(label, offset, mVolts, num, TWL4030) 439 - #define TWL6030_ADJUSTABLE_LDO(label, offset, num) \ 440 - TWL_ADJUSTABLE_LDO(label, offset, num, TWL6030) 441 - #define TWL6030_FIXED_LDO(label, offset, mVolts, num) \ 442 - TWL_FIXED_LDO(label, offset, mVolts, num, TWL6030) 429 + #define TWL4030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf) \ 430 + TWL_ADJUSTABLE_LDO(label, offset, num, turnon_delay, \ 431 + remap_conf, TWL4030) 432 + #define TWL4030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ 433 + remap_conf) \ 434 + TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ 435 + remap_conf, TWL4030) 436 + #define TWL6030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, \ 437 + remap_conf) \ 438 + TWL_ADJUSTABLE_LDO(label, offset, num, turnon_delay, \ 439 + remap_conf, TWL6030) 440 + #define TWL6030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ 441 + remap_conf) \ 442 + TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ 443 + remap_conf, TWL6030) 443 444 444 - #define TWL_ADJUSTABLE_LDO(label, offset, num, family) { \ 445 + #define TWL_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf, \ 446 + family) { \ 445 447 .base = offset, \ 446 448 .id = num, \ 447 449 .table_len = ARRAY_SIZE(label##_VSEL_table), \ 448 450 .table = label##_VSEL_table, \ 451 + .delay = turnon_delay, \ 452 + .remap = remap_conf, \ 449 453 .desc = { \ 450 454 .name = #label, \ 451 455 .id = family##_REG_##label, \ ··· 466 450 }, \ 467 451 } 468 452 469 - #define TWL_FIXED_LDO(label, offset, mVolts, num, family) { \ 453 + #define TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, remap_conf, \ 454 + family) { \ 470 455 .base = offset, \ 471 456 .id = num, \ 472 457 .min_mV = mVolts, \ 458 + .delay = turnon_delay, \ 459 + .remap = remap_conf, \ 473 460 .desc = { \ 474 461 .name = #label, \ 475 462 .id = family##_REG_##label, \ ··· 488 469 * software control over them after boot. 489 470 */ 490 471 static struct twlreg_info twl_regs[] = { 491 - TWL4030_ADJUSTABLE_LDO(VAUX1, 0x17, 1), 492 - TWL4030_ADJUSTABLE_LDO(VAUX2_4030, 0x1b, 2), 493 - TWL4030_ADJUSTABLE_LDO(VAUX2, 0x1b, 2), 494 - TWL4030_ADJUSTABLE_LDO(VAUX3, 0x1f, 3), 495 - TWL4030_ADJUSTABLE_LDO(VAUX4, 0x23, 4), 496 - TWL4030_ADJUSTABLE_LDO(VMMC1, 0x27, 5), 497 - TWL4030_ADJUSTABLE_LDO(VMMC2, 0x2b, 6), 498 - TWL4030_ADJUSTABLE_LDO(VPLL1, 0x2f, 7), 499 - TWL4030_ADJUSTABLE_LDO(VPLL2, 0x33, 8), 500 - TWL4030_ADJUSTABLE_LDO(VSIM, 0x37, 9), 501 - TWL4030_ADJUSTABLE_LDO(VDAC, 0x3b, 10), 502 - TWL4030_FIXED_LDO(VINTANA1, 0x3f, 11), 503 - TWL4030_ADJUSTABLE_LDO(VINTANA2, 0x43, 12), 504 - TWL4030_FIXED_LDO(VINTDIG, 0x47, 13), 505 - TWL4030_ADJUSTABLE_LDO(VIO, 0x4b, 14), 506 - TWL4030_ADJUSTABLE_LDO(VDD1, 0x55, 15), 507 - TWL4030_ADJUSTABLE_LDO(VDD2, 0x63, 16), 508 - TWL4030_FIXED_LDO(VUSB1V5, 0x71, 1500, 17), 509 - TWL4030_FIXED_LDO(VUSB1V8, 0x74, 1800, 18), 510 - TWL4030_FIXED_LDO(VUSB3V1, 0x77, 3100, 19), 472 + TWL4030_ADJUSTABLE_LDO(VAUX1, 0x17, 1, 100, 0x08), 473 + TWL4030_ADJUSTABLE_LDO(VAUX2_4030, 0x1b, 2, 100, 0x08), 474 + TWL4030_ADJUSTABLE_LDO(VAUX2, 0x1b, 2, 100, 0x08), 475 + TWL4030_ADJUSTABLE_LDO(VAUX3, 0x1f, 3, 100, 0x08), 476 + TWL4030_ADJUSTABLE_LDO(VAUX4, 0x23, 4, 100, 0x08), 477 + TWL4030_ADJUSTABLE_LDO(VMMC1, 0x27, 5, 100, 0x08), 478 + TWL4030_ADJUSTABLE_LDO(VMMC2, 0x2b, 6, 100, 0x08), 479 + TWL4030_ADJUSTABLE_LDO(VPLL1, 0x2f, 7, 100, 0x00), 480 + TWL4030_ADJUSTABLE_LDO(VPLL2, 0x33, 8, 100, 0x08), 481 + TWL4030_ADJUSTABLE_LDO(VSIM, 0x37, 9, 100, 0x00), 482 + TWL4030_ADJUSTABLE_LDO(VDAC, 0x3b, 10, 100, 0x08), 483 + TWL4030_FIXED_LDO(VINTANA1, 0x3f, 1500, 11, 100, 0x08), 484 + TWL4030_ADJUSTABLE_LDO(VINTANA2, 0x43, 12, 100, 0x08), 485 + TWL4030_FIXED_LDO(VINTDIG, 0x47, 1500, 13, 100, 0x08), 486 + TWL4030_ADJUSTABLE_LDO(VIO, 0x4b, 14, 1000, 0x08), 487 + TWL4030_ADJUSTABLE_LDO(VDD1, 0x55, 15, 1000, 0x08), 488 + TWL4030_ADJUSTABLE_LDO(VDD2, 0x63, 16, 1000, 0x08), 489 + TWL4030_FIXED_LDO(VUSB1V5, 0x71, 1500, 17, 100, 0x08), 490 + TWL4030_FIXED_LDO(VUSB1V8, 0x74, 1800, 18, 100, 0x08), 491 + TWL4030_FIXED_LDO(VUSB3V1, 0x77, 3100, 19, 150, 0x08), 511 492 /* VUSBCP is managed *only* by the USB subchip */ 512 493 513 494 /* 6030 REG with base as PMC Slave Misc : 0x0030 */ 514 - TWL6030_ADJUSTABLE_LDO(VAUX1_6030, 0x54, 1), 515 - TWL6030_ADJUSTABLE_LDO(VAUX2_6030, 0x58, 2), 516 - TWL6030_ADJUSTABLE_LDO(VAUX3_6030, 0x5c, 3), 517 - TWL6030_ADJUSTABLE_LDO(VMMC, 0x68, 4), 518 - TWL6030_ADJUSTABLE_LDO(VPP, 0x6c, 5), 519 - TWL6030_ADJUSTABLE_LDO(VUSIM, 0x74, 7), 520 - TWL6030_FIXED_LDO(VANA, 0x50, 2100, 15), 521 - TWL6030_FIXED_LDO(VCXIO, 0x60, 1800, 16), 522 - TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 17), 523 - TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 18) 495 + /* Turnon-delay and remap configuration values for 6030 are not 496 + verified since the specification is not public */ 497 + TWL6030_ADJUSTABLE_LDO(VAUX1_6030, 0x54, 1, 0, 0x08), 498 + TWL6030_ADJUSTABLE_LDO(VAUX2_6030, 0x58, 2, 0, 0x08), 499 + TWL6030_ADJUSTABLE_LDO(VAUX3_6030, 0x5c, 3, 0, 0x08), 500 + TWL6030_ADJUSTABLE_LDO(VMMC, 0x68, 4, 0, 0x08), 501 + TWL6030_ADJUSTABLE_LDO(VPP, 0x6c, 5, 0, 0x08), 502 + TWL6030_ADJUSTABLE_LDO(VUSIM, 0x74, 7, 0, 0x08), 503 + TWL6030_FIXED_LDO(VANA, 0x50, 2100, 15, 0, 0x08), 504 + TWL6030_FIXED_LDO(VCXIO, 0x60, 1800, 16, 0, 0x08), 505 + TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 17, 0, 0x08), 506 + TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 18, 0, 0x08) 524 507 }; 525 508 526 509 static int twlreg_probe(struct platform_device *pdev)