Skip to contentSkip to conversation

iio: potentiometer: ad5272: Correct polarity of reset

PATCH Applied Phil Reid 2 participants 2 messages Nov 24, 2020 – Nov 28, 2020

Subsystems (2)
lore
Share & tools
lore

Phil Reid

author
#0 lore raw

PATCH 1/1 iio: potentiometer: ad5272: Correct polarity of reset

The driver should assert reset by setting the gpio high, and then release it by setting it the gpio low. This allows the device tree (or other hardware definition) to specify how the gpio is configured.

For example as open drain or push-pull depending on the connected hardware.

---
 drivers/iio/potentiometer/ad5272.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/potentiometer/ad5272.c +2 -2
index 70c45d346df0..d8cbd170262f 100644
@@ -143,13 +143,13 @@ static int ad5272_reset(struct ad5272_data *data)
 	struct gpio_desc *reset_gpio;
 
 	reset_gpio = devm_gpiod_get_optional(&data->client->dev, "reset",
-		GPIOD_OUT_LOW);
+		GPIOD_OUT_HIGH);
 	if (IS_ERR(reset_gpio))
 		return PTR_ERR(reset_gpio);
 
 	if (reset_gpio) {
 		udelay(1);
-		gpiod_set_value(reset_gpio, 1);
+		gpiod_set_value(reset_gpio, 0);
 	} else {
 		ad5272_write(data, AD5272_RESET, 0);
 	}
Signature · 1 line
2.18.4
maintainer Applied
#1 lore raw
Quoted 9 lines · On Tue, 24 Nov 2020 13:00:14 +0800 Phil Reid <[email protected]> wrote:

The driver should assert reset by setting the gpio high, and then release it by setting it the gpio low. This allows the device tree (or other hardware definition) to specify how the gpio is configured.

For example as open drain or push-pull depending on the connected hardware.

I'm in 2 minds on whether we want to push this back to stable or not. Phil, do you have any idea if we have dt in the wild for this on any boards where people are actually likely to update their kernel (to stable)?

Applied to togreg branch of iio.git. If we want a stable backport after this has gone out in a non-rebasing tree we can request it explicitly.

Thanks,

Jonathan

Quoted 24 lines
---
 drivers/iio/potentiometer/ad5272.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/potentiometer/ad5272.c +2 -2
index 70c45d346df0..d8cbd170262f 100644
@@ -143,13 +143,13 @@ static int ad5272_reset(struct ad5272_data *data)
 	struct gpio_desc *reset_gpio;
 
 	reset_gpio = devm_gpiod_get_optional(&data->client->dev, "reset",
-		GPIOD_OUT_LOW);
+		GPIOD_OUT_HIGH);
 	if (IS_ERR(reset_gpio))
 		return PTR_ERR(reset_gpio);
 
 	if (reset_gpio) {
 		udelay(1);
-		gpiod_set_value(reset_gpio, 1);
+		gpiod_set_value(reset_gpio, 0);
 	} else {
 		ad5272_write(data, AD5272_RESET, 0);
 	}