Commit 72e3a524 authored by Nishad Kamdar's avatar Nishad Kamdar Committed by Jonathan Cameron

staging: iio: ad7816: Set RD/WR pin and CONVST pin as outputs.

The RD/WR pin and CONVST pin are logical inputs to the AD78xx
chip as per the datasheet. Hence convert them to outputs.
Signed-off-by: default avatarNishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 06c77f56
...@@ -369,14 +369,15 @@ static int ad7816_probe(struct spi_device *spi_dev) ...@@ -369,14 +369,15 @@ static int ad7816_probe(struct spi_device *spi_dev)
chip->oti_data[i] = 203; chip->oti_data[i] = 203;
chip->id = spi_get_device_id(spi_dev)->driver_data; chip->id = spi_get_device_id(spi_dev)->driver_data;
chip->rdwr_pin = devm_gpiod_get(&spi_dev->dev, "rdwr", GPIOD_IN); chip->rdwr_pin = devm_gpiod_get(&spi_dev->dev, "rdwr", GPIOD_OUT_HIGH);
if (IS_ERR(chip->rdwr_pin)) { if (IS_ERR(chip->rdwr_pin)) {
ret = PTR_ERR(chip->rdwr_pin); ret = PTR_ERR(chip->rdwr_pin);
dev_err(&spi_dev->dev, "Failed to request rdwr GPIO: %d\n", dev_err(&spi_dev->dev, "Failed to request rdwr GPIO: %d\n",
ret); ret);
return ret; return ret;
} }
chip->convert_pin = devm_gpiod_get(&spi_dev->dev, "convert", GPIOD_IN); chip->convert_pin = devm_gpiod_get(&spi_dev->dev, "convert",
GPIOD_OUT_HIGH);
if (IS_ERR(chip->convert_pin)) { if (IS_ERR(chip->convert_pin)) {
ret = PTR_ERR(chip->convert_pin); ret = PTR_ERR(chip->convert_pin);
dev_err(&spi_dev->dev, "Failed to request convert GPIO: %d\n", dev_err(&spi_dev->dev, "Failed to request convert GPIO: %d\n",
......
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