Skip to content

Commit

Permalink
ARM: ux500: Provide a mechanism to over-ride regulator init values
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lee Jones authored and Mark Brown committed Mar 29, 2013
1 parent a387ac5 commit a1d4948
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arch/arm/mach-ux500/board-mop500-regulators.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,21 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
.ext_regulator = ab8500_ext_regulators,
.num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators),
};

static void ab8500_modify_reg_init(int id, u8 mask, u8 value)
{
int i;

for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) {
if (ab8500_reg_init[i].id == id) {
u8 initval = ab8500_reg_init[i].value;
initval = (initval & ~mask) | (value & mask);
ab8500_reg_init[i].value = initval;

BUG_ON(mask & ~ab8500_reg_init[i].mask);
return;
}
}

BUG_ON(1);
}

0 comments on commit a1d4948

Please sign in to comment.