drivers: regulator: common: allow to specify on by default
Some regulators are enabled by default, however, such condition cannot be captured now by the regulator driver API. Refactor regulator_common_init_enable to regulator_common_init (enable removed, as it also sets mode) and add a new argument to specify such condition. With this change, regulator_disable() and regulator_is_enabled() work as expected without a first call to regulator_enable(). Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
d37613d20a
commit
7feb008c85
6 changed files with 15 additions and 10 deletions
|
@ -343,7 +343,7 @@ static int regulator_pca9420_init(const struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
return regulator_common_init_enable(dev);
|
||||
return regulator_common_init(dev, false);
|
||||
}
|
||||
|
||||
int regulator_pca9420_dvs_state_set(const struct device *dev,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue