Skip to content

Commit b21a7fd

Browse files
committed
iio: adc: ad7768-1: fix MOSI idle state
All supported parts require that the MOSI line stays high while in idle. Signed-off-by: jonathanns <Jonathan.Santos@analog.com>
1 parent ec71173 commit b21a7fd

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
@@ -1415,6 +1415,15 @@ static int ad7768_probe(struct spi_device *spi)
14151415
return -ENOMEM;
14161416

14171417
st = iio_priv(indio_dev);
1418+
/*
1419+
* The ADC SDI line must be kept high when
1420+
* data is not being clocked out of the controller.
1421+
* Request the SPI controller to make MOSI idle high.
1422+
*/
1423+
spi->mode |= SPI_MOSI_IDLE_HIGH;
1424+
ret = spi_setup(spi);
1425+
if (ret < 0)
1426+
return ret;
14181427
st->spi = spi;
14191428

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

0 commit comments

Comments
 (0)