Skip to content

Commit 5af3802

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 979d704 commit 5af3802

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
@@ -1149,7 +1149,6 @@ static int ad7768_buffer_postenable(struct iio_dev *indio_dev)
11491149
.len = 1,
11501150
};
11511151
unsigned int rx_data[2];
1152-
unsigned int tx_data[2];
11531152
struct spi_message msg;
11541153
int ret;
11551154

@@ -1171,8 +1170,6 @@ static int ad7768_buffer_postenable(struct iio_dev *indio_dev)
11711170
if (st->spi_is_dma_mapped) {
11721171
spi_bus_lock(st->spi->master);
11731172

1174-
tx_data[0] = AD7768_RD_FLAG_MSK(AD7768_REG_ADC_DATA) << 24;
1175-
xfer.tx_buf = tx_data;
11761173
xfer.rx_buf = rx_data;
11771174
spi_message_init_with_transfers(&msg, &xfer, 1);
11781175
ret = spi_engine_offload_load_msg(st->spi, &msg);

0 commit comments

Comments
 (0)