drivers: regulator: Added initial voltage configuration
The regulator driver has a configured min/max range that is used to limit set values, and to initialise the regulator. A new init value has been added, so that the startup voltage can be higher than the lowest permitted value. Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
This commit is contained in:
parent
2380710020
commit
a00713bc45
3 changed files with 15 additions and 0 deletions
|
@ -28,6 +28,13 @@ int regulator_common_init(const struct device *dev, bool is_enabled)
|
|||
}
|
||||
}
|
||||
|
||||
if (config->init_uv > INT32_MIN) {
|
||||
ret = regulator_set_voltage(dev, config->init_uv, config->init_uv);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we have valid range values, we try to match them before enabling */
|
||||
if ((config->min_uv > INT32_MIN) || (config->max_uv < INT32_MAX)) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue