summaryrefslogtreecommitdiff
path: root/drivers/iio/potentiometer
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2020-11-24 13:00:14 +0800
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-12-03 19:32:42 +0000
commit7dd94246fe542e45915ad27817317a41d796d13a (patch)
treea8eb7334dcb4173338278422e33de40ecb2bdfb7 /drivers/iio/potentiometer
parent672f3022837968958980b0634ebdcf98355a47ed (diff)
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. Signed-off-by: Phil Reid <preid@electromag.com.au> Link: https://lore.kernel.org/r/20201124050014.4453-1-preid@electromag.com.au Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/potentiometer')
-rw-r--r--drivers/iio/potentiometer/ad5272.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/potentiometer/ad5272.c b/drivers/iio/potentiometer/ad5272.c
index 70c45d346df0..d8cbd170262f 100644
--- a/drivers/iio/potentiometer/ad5272.c
+++ b/drivers/iio/potentiometer/ad5272.c
@@ -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);
}