Skip to content

Commit 2158b73

Browse files
committed
iio: adc: ad7768-1: fix MOSI idle state
All supported parts require that the MOSI line stays high while in idle. Fixes: 8a15c73 ("iio: adc: Add AD7768-1 ADC basic support") Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
1 parent c199ff2 commit 2158b73

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/iio/adc/ad7768-1.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,15 @@ static int ad7768_probe(struct spi_device *spi)
890890
return -ENOMEM;
891891

892892
st = iio_priv(indio_dev);
893+
/*
894+
* The ADC SDI line must be kept high when
895+
* data is not being clocked out of the controller.
896+
* Request the SPI controller to make MOSI idle high.
897+
*/
898+
spi->mode |= SPI_MOSI_IDLE_HIGH;
899+
ret = spi_setup(spi);
900+
if (ret < 0)
901+
return ret;
893902
st->spi = spi;
894903

895904
st->vref = devm_regulator_get(&spi->dev, "vref");

0 commit comments

Comments
 (0)