Commit ab62aa931ed3512bc67857a03636756b96c78eae

Authored by Mark Brown
1 parent 068df0f34e

regulator: If a single voltage is set with device tree then set apply_uV

Otherwise there is no way in the bindings to configure a fixed voltage
via software. It seems reasonable to assume that if the binding explicitly
specifies a voltage we want to actually use that voltage.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

drivers/regulator/of_regulator.c
... ... @@ -34,6 +34,9 @@
34 34 /* Voltage change possible? */
35 35 if (constraints->min_uV != constraints->max_uV)
36 36 constraints->valid_ops_mask |= REGULATOR_CHANGE_VOLTAGE;
  37 + /* Only one voltage? Then make sure it's set. */
  38 + if (constraints->min_uV == constraints->max_uV)
  39 + constraints->apply_uV = true;
37 40  
38 41 uV_offset = of_get_property(np, "regulator-microvolt-offset", NULL);
39 42 if (uV_offset)