Commit 7dd94246 authored by Phil Reid's avatar Phil Reid Committed by Jonathan Cameron

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: default avatarPhil Reid <preid@electromag.com.au>
Link: https://lore.kernel.org/r/20201124050014.4453-1-preid@electromag.com.auSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 672f3022
......@@ -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);
}
......
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