You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems regulator-fixed regulator device is never become ready (device_is_ready(reg_dev)) since one of the commits
539d4aa ("drivers: regulator: add common init enable API"
b3fdb74 ("drivers: regulator: fixed: Removed pin state setting from init")
and subsequent commits in drivers/regulator/regulator_common.c which added regulator_common_init() call to the regulator-fixed itself, and non valid (for regulator-fixed) regulator_set_voltage() calls in regulator_common_init().
Is it know issue?
Hence, regulator_set_voltage() is not valid for regulator-fixed, and, actually, most of steps in regulator_common_init() - it seems reasonable to just call regulator_enable() for regulator-fixed on init to update regulator state and ref_cnt.
Smth. like below:
--- a/drivers/regulator/regulator_fixed.c
+++ b/drivers/regulator/regulator_fixed.c
@@ -84,6 +84,7 @@ static const struct regulator_driver_api regulator_fixed_api = {
static int regulator_fixed_init(const struct device *dev)
{
const struct regulator_fixed_config *cfg = dev->config;
+ int ret;
regulator_common_data_init(dev);
@@ -93,14 +94,17 @@ static int regulator_fixed_init(const struct device *dev)
return -ENODEV;
}
- int ret = gpio_pin_configure_dt(&cfg->enable, GPIO_OUTPUT);
+ ret = gpio_pin_configure_dt(&cfg->enable, GPIO_OUTPUT);
if (ret < 0) {
return ret;
}
}
- return regulator_common_init(dev, false);
+ if (regulator_common_is_init_enabled(dev)) {
+ ret = regulator_enable(dev);
+ }
+ return ret;
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
It seems regulator-fixed regulator device is never become ready (device_is_ready(reg_dev)) since one of the commits
and subsequent commits in drivers/regulator/regulator_common.c which added regulator_common_init() call to the regulator-fixed itself, and non valid (for regulator-fixed) regulator_set_voltage() calls in regulator_common_init().
Is it know issue?
Hence, regulator_set_voltage() is not valid for regulator-fixed, and, actually, most of steps in regulator_common_init() - it seems reasonable to just call regulator_enable() for regulator-fixed on init to update regulator state and ref_cnt.
Smth. like below:
Beta Was this translation helpful? Give feedback.
All reactions