提交 a1d49480 编写于 作者: L Lee Jones 提交者: Mark Brown

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: NLee Jones <lee.jones@linaro.org>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 a387ac5f
...@@ -476,3 +476,21 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { ...@@ -476,3 +476,21 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
.ext_regulator = ab8500_ext_regulators, .ext_regulator = ab8500_ext_regulators,
.num_ext_regulator = ARRAY_SIZE(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);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册