]> asedeno.scripts.mit.edu Git - linux.git/commit
staging:iio:ad7606: Avoid allocating buffer for each data capture
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 19 Oct 2016 17:07:01 +0000 (19:07 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 23 Oct 2016 18:34:14 +0000 (19:34 +0100)
commitf915f7aafba79784b8d89cf186fd63d3b16b91b9
tree461cbc66908a95f7626ac11d85cfca962ebcdbf9
parente79e8027c1bb9e5525ad186efef1d89309c378f2
staging:iio:ad7606: Avoid allocating buffer for each data capture

Currently the ad7606 driver dynamically allocates and frees a transfer
buffer each time a sample capture is performed in buffered mode, which
introduces unnecessary overhead. The driver state struct already contains a
buffer that is used for transfers in one-shot mode. This buffer is large
enough to hold all samples, but not the timestamp that might be present in
buffered mode. Extend the buffer size to be able to contain the timestamp
and update the buffered capture function to use this buffer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/adc/ad7606.h
drivers/staging/iio/adc/ad7606_ring.c