Skip to content

Commit 8d4c28f

Browse files
committed
iio: adc: ad7768-1: remove tx_buf from IIO buffer read transfer
The address byte is not needed in the SPI transfer if continuous read mode is enabled. In this case, data readback occurs on the application of SCLK. Remove tx_buf from IIO buffer read transfer to reduce the duration of each transfer and enable the sample rate of 1.024 MHz at 16-bit resolution, given the maximum supported SCLK rate of 20 MHz: - With address byte: (16-bit data + 8-bit address) * 1.024 MHz > 20 MHZ. Insufficient SCLK cycles to drive out the output. - Without address byte: (16-bit data) * 1.024 MHz < 20 MHz. Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
1 parent 1e182d0 commit 8d4c28f

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/iio/adc/ad7768-1.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,6 @@ static int ad7768_buffer_postenable(struct iio_dev *indio_dev)
11411141
.len = 1,
11421142
};
11431143
unsigned int rx_data[2];
1144-
unsigned int tx_data[2];
11451144
struct spi_message msg;
11461145
int ret;
11471146

@@ -1163,8 +1162,6 @@ static int ad7768_buffer_postenable(struct iio_dev *indio_dev)
11631162
if (st->spi_is_dma_mapped) {
11641163
spi_bus_lock(st->spi->master);
11651164

1166-
tx_data[0] = AD7768_RD_FLAG_MSK(AD7768_REG_ADC_DATA) << 24;
1167-
xfer.tx_buf = tx_data;
11681165
xfer.rx_buf = rx_data;
11691166
spi_message_init_with_transfers(&msg, &xfer, 1);
11701167
ret = spi_engine_offload_load_msg(st->spi, &msg);

0 commit comments

Comments
 (0)