]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:48 +0000 (13:49 +0100)
commit71c3926459457019d2a7b01df87ce3ec833dd484
tree442d13e69900b950d10272f8df4277965344cc1c
parent07bca7b592434f70c075d0b0080ab7631c56a90c
iio: light: as73211: fix channel handling in only-color triggered buffer

commit ab09c6cfe01b317f515bcd944668697241a54b9d upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/light/as73211.c