Skip to content

Commit 246024d

Browse files
committed
iio: adc: ad7768-1: set MOSI idle state to high
All supported parts require that the MOSI line stays high while in idle. Configure SPI controller to set MOSI idle state to high. Fixes: 8a15c73 ("iio: adc: Add AD7768-1 ADC basic support") Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
1 parent 1a5d9bd commit 246024d

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

868868
st = iio_priv(indio_dev);
869+
/*
870+
* The ADC SDI line must be kept high when
871+
* data is not being clocked out of the controller.
872+
* Request the SPI controller to make MOSI idle high.
873+
*/
874+
spi->mode |= SPI_MOSI_IDLE_HIGH;
875+
ret = spi_setup(spi);
876+
if (ret < 0)
877+
return ret;
869878
st->spi = spi;
870879

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

0 commit comments

Comments
 (0)