Skip to content

Commit 59695d4

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 b55c225 commit 59695d4

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
@@ -1159,7 +1159,6 @@ static int ad7768_buffer_postenable(struct iio_dev *indio_dev)
11591159
.len = 1,
11601160
};
11611161
unsigned int rx_data[2];
1162-
unsigned int tx_data[2];
11631162
struct spi_message msg;
11641163
int ret;
11651164

@@ -1181,8 +1180,6 @@ static int ad7768_buffer_postenable(struct iio_dev *indio_dev)
11811180
if (st->spi_is_dma_mapped) {
11821181
spi_bus_lock(st->spi->master);
11831182

1184-
tx_data[0] = AD7768_RD_FLAG_MSK(AD7768_REG_ADC_DATA) << 24;
1185-
xfer.tx_buf = tx_data;
11861183
xfer.rx_buf = rx_data;
11871184
spi_message_init_with_transfers(&msg, &xfer, 1);
11881185
ret = spi_engine_offload_load_msg(st->spi, &msg);

0 commit comments

Comments
 (0)