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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ static int arizona_ldo1_common_init(struct platform_device *pdev,
	 * so clean up would happen at the wrong time
	 */
	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))
		return PTR_ERR(config.ena_gpiod);

+5 −5
Original line number Diff line number Diff line
@@ -297,7 +297,7 @@ static struct da9211_pdata *da9211_parse_regulators_dt(
				  da9211_matches[i].of_node,
				  "enable",
				  0,
								  GPIOD_OUT_HIGH,
				  GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
				  "da9211-enable");
		n++;
	}
+4 −2
Original line number Diff line number Diff line
@@ -227,9 +227,11 @@ static struct gpio_desc *lm363x_regulator_of_get_enable_gpio(struct device *dev,
	 */
	switch (id) {
	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:
		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:
		return NULL;
	}
+4 −3
Original line number Diff line number Diff line
@@ -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,
					       "enable",
					       enable_id,
						       GPIOD_OUT_HIGH);
					       GPIOD_OUT_HIGH |
					       GPIOD_FLAGS_BIT_NONEXCLUSIVE);
	if (IS_ERR(ldo->ena_gpiod))
		return PTR_ERR(ldo->ena_gpiod);

+1 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ static int max8952_pmic_probe(struct i2c_client *client,
		gflags = GPIOD_OUT_HIGH;
	else
		gflags = GPIOD_OUT_LOW;
	gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
	gpiod = devm_gpiod_get_optional(&client->dev,
					"max8952,en",
					gflags);
Loading