Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: accel: adxl380: Optimize reading of FIFO entries in interrupt handler

In order to minimize the time required for transferring FIFO data from the
sensor to the host machine, perform the read from the FIFO in a single call
to regmap_noinc_read().
This allows reading acceleration data for all 3 axes at 16 kHz
sampling frequency using a 1MHz I2C bus frequency.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Francesco Lavra and committed by
Jonathan Cameron
6939484a c1b14015

+5 -7
+5 -7
drivers/iio/accel/adxl380.c
··· 967 967 return IRQ_HANDLED; 968 968 969 969 fifo_entries = rounddown(fifo_entries, st->fifo_set_size); 970 - for (i = 0; i < fifo_entries; i += st->fifo_set_size) { 971 - ret = regmap_noinc_read(st->regmap, ADXL380_FIFO_DATA, 972 - &st->fifo_buf[i], 973 - 2 * st->fifo_set_size); 974 - if (ret) 975 - return IRQ_HANDLED; 970 + ret = regmap_noinc_read(st->regmap, ADXL380_FIFO_DATA, &st->fifo_buf, 971 + sizeof(*st->fifo_buf) * fifo_entries); 972 + if (ret) 973 + return IRQ_HANDLED; 974 + for (i = 0; i < fifo_entries; i += st->fifo_set_size) 976 975 iio_push_to_buffers(indio_dev, &st->fifo_buf[i]); 977 - } 978 976 979 977 return IRQ_HANDLED; 980 978 }