Skip to content

Commit 7fa815c

Browse files
rcolatobekartben
authored andcommitted
regulator: Updated function call use flag that initalizes GPIO.
Fixes bug where GPIO_ACTIVE_LOW would not initialize properly. Signed-off-by: Rene Colato <[email protected]>
1 parent 179045e commit 7fa815c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

drivers/regulator/regulator_fixed.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ static DEVICE_API(regulator, regulator_fixed_api) = {
8484
static int regulator_fixed_init(const struct device *dev)
8585
{
8686
const struct regulator_fixed_config *cfg = dev->config;
87+
bool is_enabled = false;
8788

8889
regulator_common_data_init(dev);
8990

@@ -98,9 +99,17 @@ static int regulator_fixed_init(const struct device *dev)
9899
if (ret < 0) {
99100
return ret;
100101
}
102+
103+
ret = gpio_pin_get_dt(&cfg->enable);
104+
105+
if (ret < 0) {
106+
return ret;
107+
}
108+
109+
is_enabled = ret;
101110
}
102111

103-
return regulator_common_init(dev, false);
112+
return regulator_common_init(dev, is_enabled);
104113
}
105114

106115
#define REGULATOR_FIXED_DEFINE(inst) \

dts/bindings/regulator/regulator-fixed.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include:
1010
property-allowlist:
1111
- regulator-name
1212
- regulator-boot-on
13+
- regulator-boot-off
1314
- regulator-always-on
1415
- regulator-min-microvolt
1516
- regulator-max-microvolt

0 commit comments

Comments
 (0)