diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2015-06-11 17:37:06 -0700 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-06-12 13:18:02 +0100 |
commit | 36e4f839de59b6216a16cdf5c1d3263f4dbd9421 (patch) | |
tree | 5cf5ebd741a210f610ec32ae3a1d1d953c553fe6 /drivers/regulator/of_regulator.c | |
parent | 57f66b78860968fc7eddc9ce25f8e57f7e5000bd (diff) | |
download | op-kernel-dev-36e4f839de59b6216a16cdf5c1d3263f4dbd9421.zip op-kernel-dev-36e4f839de59b6216a16cdf5c1d3263f4dbd9421.tar.gz |
regulator: Add input current limit support
Some regulators can limit their input current (typically annotated
as ilim). Add an op (set_input_current_limit) and a DT property +
constraint to support this.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/of_regulator.c')
-rw-r--r-- | drivers/regulator/of_regulator.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 207da03..f025c10 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -58,6 +58,10 @@ static void of_get_regulation_constraints(struct device_node *np, if (!of_property_read_u32(np, "regulator-max-microamp", &pval)) constraints->max_uA = pval; + if (!of_property_read_u32(np, "regulator-input-current-limit-microamp", + &pval)) + constraints->ilim_uA = pval; + /* Current change possible? */ if (constraints->min_uA != constraints->max_uA) constraints->valid_ops_mask |= REGULATOR_CHANGE_CURRENT; |