Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Phil Reid and committed by
Jonathan Cameron
7dd94246 672f3022

+2 -2
+2 -2
drivers/iio/potentiometer/ad5272.c
··· 143 143 struct gpio_desc *reset_gpio; 144 144 145 145 reset_gpio = devm_gpiod_get_optional(&data->client->dev, "reset", 146 - GPIOD_OUT_LOW); 146 + GPIOD_OUT_HIGH); 147 147 if (IS_ERR(reset_gpio)) 148 148 return PTR_ERR(reset_gpio); 149 149 150 150 if (reset_gpio) { 151 151 udelay(1); 152 - gpiod_set_value(reset_gpio, 1); 152 + gpiod_set_value(reset_gpio, 0); 153 153 } else { 154 154 ad5272_write(data, AD5272_RESET, 0); 155 155 }