diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-03-28 12:11:03 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-29 13:49:08 -0400 |
commit | a1d494806698ae37c14b0c7fe9e6165e3b0c146c (patch) | |
tree | 1c856b0ab90ad4d54c455d5db25ff7b8bcbb5396 /arch/arm/mach-ux500/board-mop500-regulators.c | |
parent | a387ac5f7b1b37f26f4860344e68e1a1d86aae94 (diff) |
ARM: ux500: Provide a mechanism to over-ride regulator init values
If particular platforms require non-standard initialisation values,
they can use this function to adapt them as required.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-regulators.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-regulators.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 089cf2ae5927..22dfaf3d979a 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c | |||
@@ -476,3 +476,21 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { | |||
476 | .ext_regulator = ab8500_ext_regulators, | 476 | .ext_regulator = ab8500_ext_regulators, |
477 | .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators), | 477 | .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators), |
478 | }; | 478 | }; |
479 | |||
480 | static void ab8500_modify_reg_init(int id, u8 mask, u8 value) | ||
481 | { | ||
482 | int i; | ||
483 | |||
484 | for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) { | ||
485 | if (ab8500_reg_init[i].id == id) { | ||
486 | u8 initval = ab8500_reg_init[i].value; | ||
487 | initval = (initval & ~mask) | (value & mask); | ||
488 | ab8500_reg_init[i].value = initval; | ||
489 | |||
490 | BUG_ON(mask & ~ab8500_reg_init[i].mask); | ||
491 | return; | ||
492 | } | ||
493 | } | ||
494 | |||
495 | BUG_ON(1); | ||
496 | } | ||