]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.14.16/iio-buffer-fix-demux-table-creation.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 3.14.16 / iio-buffer-fix-demux-table-creation.patch
1 From 61bd55ce1667809f022be88da77db17add90ea4e Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Thu, 17 Jul 2014 16:59:00 +0100
4 Subject: iio: buffer: Fix demux table creation
5
6 From: Lars-Peter Clausen <lars@metafoo.de>
7
8 commit 61bd55ce1667809f022be88da77db17add90ea4e upstream.
9
10 When creating the demux table we need to iterate over the selected scan mask for
11 the buffer to get the samples which should be copied to destination buffer.
12 Right now the code uses the mask which contains all active channels, which means
13 the demux table contains entries which causes it to copy all the samples from
14 source to destination buffer one by one without doing any demuxing.
15
16 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
17 Signed-off-by: Jonathan Cameron <jic23@kernel.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 drivers/iio/industrialio-buffer.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- a/drivers/iio/industrialio-buffer.c
25 +++ b/drivers/iio/industrialio-buffer.c
26 @@ -953,7 +953,7 @@ static int iio_buffer_update_demux(struc
27
28 /* Now we have the two masks, work from least sig and build up sizes */
29 for_each_set_bit(out_ind,
30 - indio_dev->active_scan_mask,
31 + buffer->scan_mask,
32 indio_dev->masklength) {
33 in_ind = find_next_bit(indio_dev->active_scan_mask,
34 indio_dev->masklength,