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);
......
...@@ -294,11 +294,11 @@ static struct da9211_pdata *da9211_parse_regulators_dt( ...@@ -294,11 +294,11 @@ static struct da9211_pdata *da9211_parse_regulators_dt(
pdata->init_data[n] = da9211_matches[i].init_data; pdata->init_data[n] = da9211_matches[i].init_data;
pdata->reg_node[n] = da9211_matches[i].of_node; pdata->reg_node[n] = da9211_matches[i].of_node;
pdata->gpiod_ren[n] = devm_gpiod_get_from_of_node(dev, pdata->gpiod_ren[n] = devm_gpiod_get_from_of_node(dev,
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;
} }
......
...@@ -503,9 +503,10 @@ static int lp8788_config_ldo_enable_mode(struct platform_device *pdev, ...@@ -503,9 +503,10 @@ static int lp8788_config_ldo_enable_mode(struct platform_device *pdev,
/* FIXME: check default mode for GPIO here: high or low? */ /* FIXME: check default mode for GPIO here: high or low? */
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,12 +571,13 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, ...@@ -571,12 +571,13 @@ 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(
reg_np, &pdev->dev,
"s5m8767,pmic-ext-control-gpios", reg_np,
0, "s5m8767,pmic-ext-control-gpios",
GPIOD_OUT_HIGH, 0,
"s5m8767"); GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
"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