drivers: regulator: add common init enable API
Add a new API for drivers that can be called to initialize the regulator at init time if `regulator-boot-on` or `regulator-always-on` are set. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
9b5152153b
commit
539d4aa6e6
4 changed files with 49 additions and 16 deletions
|
@ -300,7 +300,6 @@ static int regulator_pca9420_init(const struct device *dev)
|
|||
{
|
||||
const struct regulator_pca9420_config *config = dev->config;
|
||||
const struct regulator_pca9420_common_config *cconfig = config->parent->config;
|
||||
int rc = 0;
|
||||
|
||||
regulator_common_data_init(dev);
|
||||
|
||||
|
@ -344,11 +343,7 @@ static int regulator_pca9420_init(const struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
if ((config->common.flags & REGULATOR_INIT_ENABLED) != 0U) {
|
||||
rc = regulator_pca9420_enable(dev);
|
||||
}
|
||||
|
||||
return rc;
|
||||
return regulator_common_init_enable(dev);
|
||||
}
|
||||
|
||||
int regulator_pca9420_dvs_state_set(const struct device *dev,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue