Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d44f8a17 authored by Guillaume Stols's avatar Guillaume Stols Committed by Greg Kroah-Hartman
Browse files

iio: adc: ad7606: fix oversampling gpio array



[ Upstream commit 8dc4594b54dbaaba40dc8884ad3d42083de39434 ]

gpiod_set_array_value was misused here: the implementation relied on the
assumption that an unsigned long was required for each gpio, while the
function expects a bit array stored in "as much unsigned long as needed
for storing one bit per GPIO", i.e it is using a bit field.

This leaded to incorrect parameter passed to gpiod_set_array_value, that
would set 1 value instead of 3.
It also prevents to select the software mode correctly for the AD7606B.

Fixes: d2a415c8 ("iio: adc: ad7606: Add support for AD7606B ADC")
Fixes: 41f71e5e ("staging: iio: adc: ad7606: Use find_closest() macro")
Signed-off-by: default avatarGuillaume Stols <gstols@baylibre.com>
Reviewed-by: default avatarNuno Sa <nuno.sa@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6ec0f444
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment