Commit 63239e4b authored by Linus Walleij's avatar Linus Walleij Committed by Mark Brown

regulator: Fetch enable gpiods nonexclusive

Since the core regulator code is treating GPIO descriptors as
nonexclusive, i.e. it assumes that the enable GPIO line may be
shared with several regulators, let's add the flag introduced
for fixing this problem on fixed regulators to all drivers
fetching GPIO descriptors to avoid possible regressions.
Reported-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b0ce7b29
...@@ -260,7 +260,7 @@ static int arizona_ldo1_common_init(struct platform_device *pdev, ...@@ -260,7 +260,7 @@ static int arizona_ldo1_common_init(struct platform_device *pdev,
* so clean up would happen at the wrong time * so clean up would happen at the wrong time
*/ */
config.ena_gpiod = gpiod_get_optional(parent_dev, "wlf,ldoena", config.ena_gpiod = gpiod_get_optional(parent_dev, "wlf,ldoena",
GPIOD_OUT_LOW); GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
if (IS_ERR(config.ena_gpiod)) if (IS_ERR(config.ena_gpiod))
return PTR_ERR(config.ena_gpiod); return PTR_ERR(config.ena_gpiod);
......
...@@ -297,7 +297,7 @@ static struct da9211_pdata *da9211_parse_regulators_dt( ...@@ -297,7 +297,7 @@ static struct da9211_pdata *da9211_parse_regulators_dt(
da9211_matches[i].of_node, da9211_matches[i].of_node,
"enable", "enable",
0, 0,
GPIOD_OUT_HIGH, GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
"da9211-enable"); "da9211-enable");
n++; n++;
} }
......
...@@ -227,9 +227,11 @@ static struct gpio_desc *lm363x_regulator_of_get_enable_gpio(struct device *dev, ...@@ -227,9 +227,11 @@ static struct gpio_desc *lm363x_regulator_of_get_enable_gpio(struct device *dev,
*/ */
switch (id) { switch (id) {
case LM3632_LDO_POS: case LM3632_LDO_POS:
return devm_gpiod_get_index_optional(dev, "enable", 0, GPIOD_OUT_LOW); return devm_gpiod_get_index_optional(dev, "enable", 0,
GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
case LM3632_LDO_NEG: case LM3632_LDO_NEG:
return devm_gpiod_get_index_optional(dev, "enable", 1, GPIOD_OUT_LOW); return devm_gpiod_get_index_optional(dev, "enable", 1,
GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
default: default:
return NULL; return NULL;
} }
......
...@@ -505,7 +505,8 @@ static int lp8788_config_ldo_enable_mode(struct platform_device *pdev, ...@@ -505,7 +505,8 @@ static int lp8788_config_ldo_enable_mode(struct platform_device *pdev,
ldo->ena_gpiod = devm_gpiod_get_index_optional(&pdev->dev, ldo->ena_gpiod = devm_gpiod_get_index_optional(&pdev->dev,
"enable", "enable",
enable_id, enable_id,
GPIOD_OUT_HIGH); GPIOD_OUT_HIGH |
GPIOD_FLAGS_BIT_NONEXCLUSIVE);
if (IS_ERR(ldo->ena_gpiod)) if (IS_ERR(ldo->ena_gpiod))
return PTR_ERR(ldo->ena_gpiod); return PTR_ERR(ldo->ena_gpiod);
......
...@@ -230,6 +230,7 @@ static int max8952_pmic_probe(struct i2c_client *client, ...@@ -230,6 +230,7 @@ static int max8952_pmic_probe(struct i2c_client *client,
gflags = GPIOD_OUT_HIGH; gflags = GPIOD_OUT_HIGH;
else else
gflags = GPIOD_OUT_LOW; gflags = GPIOD_OUT_LOW;
gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
gpiod = devm_gpiod_get_optional(&client->dev, gpiod = devm_gpiod_get_optional(&client->dev,
"max8952,en", "max8952,en",
gflags); gflags);
......
...@@ -758,6 +758,7 @@ static int max8973_probe(struct i2c_client *client, ...@@ -758,6 +758,7 @@ static int max8973_probe(struct i2c_client *client,
gflags = GPIOD_OUT_HIGH; gflags = GPIOD_OUT_HIGH;
else else
gflags = GPIOD_OUT_LOW; gflags = GPIOD_OUT_LOW;
gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
gpiod = devm_gpiod_get_optional(&client->dev, gpiod = devm_gpiod_get_optional(&client->dev,
"maxim,enable", "maxim,enable",
gflags); gflags);
......
...@@ -571,11 +571,12 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, ...@@ -571,11 +571,12 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
continue; continue;
} }
rdata->ext_control_gpiod = devm_gpiod_get_from_of_node(&pdev->dev, rdata->ext_control_gpiod = devm_gpiod_get_from_of_node(
&pdev->dev,
reg_np, reg_np,
"s5m8767,pmic-ext-control-gpios", "s5m8767,pmic-ext-control-gpios",
0, 0,
GPIOD_OUT_HIGH, GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
"s5m8767"); "s5m8767");
if (IS_ERR(rdata->ext_control_gpiod)) if (IS_ERR(rdata->ext_control_gpiod))
return PTR_ERR(rdata->ext_control_gpiod); return PTR_ERR(rdata->ext_control_gpiod);
......
...@@ -374,6 +374,7 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data( ...@@ -374,6 +374,7 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
gflags = GPIOD_OUT_HIGH; gflags = GPIOD_OUT_HIGH;
else else
gflags = GPIOD_OUT_LOW; gflags = GPIOD_OUT_LOW;
gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
rpdata->gpiod = devm_gpiod_get_from_of_node(&pdev->dev, rpdata->gpiod = devm_gpiod_get_from_of_node(&pdev->dev,
tps65090_matches[idx].of_node, tps65090_matches[idx].of_node,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment