]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: light: as73211: fix channel handling in only-color triggered buffer
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Sat, 14 Dec 2024 22:55:50 +0000 (23:55 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 20 Dec 2024 18:50:20 +0000 (18:50 +0000)
commitab09c6cfe01b317f515bcd944668697241a54b9d
tree99e313e7f303e76d1f6d006d2ddb4722f98dd1d4
parentc969c1e56264ecb14a3f92ae53d096f1bbee7f3b
iio: light: as73211: fix channel handling in only-color triggered buffer

The channel index is off by one unit if AS73211_SCAN_MASK_ALL is not
set (optimized path for color channel readings), and it must be shifted
instead of leaving an empty channel for the temperature when it is off.

Once the channel index is fixed, the uninitialized channel must be set
to zero to avoid pushing uninitialized data.

Add available_scan_masks for all channels and only-color channels to let
the IIO core demux and repack the enabled channels.

Cc: stable@vger.kernel.org
Fixes: 403e5586b52e ("iio: light: as73211: New driver")
Tested-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241214-iio_memset_scan_holes-v4-1-260b395b8ed5@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/as73211.c