Commit 059fe4f8 authored by Guillaume Stols's avatar Guillaume Stols Committed by Jonathan Cameron

iio: adc: ad7606: fix standby gpio state to match the documentation

The binding's documentation specifies that "As the line is active low, it
should be marked GPIO_ACTIVE_LOW". However, in the driver, it was handled
the opposite way. This commit sets the driver's behaviour in sync with the
documentation

Fixes: 722407a4 ("staging:iio:ad7606: Use GPIO descriptor API")
Signed-off-by: default avatarGuillaume Stols <gstols@baylibre.com>
Reviewed-by: default avatarNuno Sa <nuno.sa@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 8dc4594b
...@@ -443,7 +443,7 @@ static int ad7606_request_gpios(struct ad7606_state *st) ...@@ -443,7 +443,7 @@ static int ad7606_request_gpios(struct ad7606_state *st)
return PTR_ERR(st->gpio_range); return PTR_ERR(st->gpio_range);
st->gpio_standby = devm_gpiod_get_optional(dev, "standby", st->gpio_standby = devm_gpiod_get_optional(dev, "standby",
GPIOD_OUT_HIGH); GPIOD_OUT_LOW);
if (IS_ERR(st->gpio_standby)) if (IS_ERR(st->gpio_standby))
return PTR_ERR(st->gpio_standby); return PTR_ERR(st->gpio_standby);
...@@ -686,7 +686,7 @@ static int ad7606_suspend(struct device *dev) ...@@ -686,7 +686,7 @@ static int ad7606_suspend(struct device *dev)
if (st->gpio_standby) { if (st->gpio_standby) {
gpiod_set_value(st->gpio_range, 1); gpiod_set_value(st->gpio_range, 1);
gpiod_set_value(st->gpio_standby, 0); gpiod_set_value(st->gpio_standby, 1);
} }
return 0; return 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