Skip to content
Snippets Groups Projects
Commit 8dc4594b authored by Guillaume Stols's avatar Guillaume Stols Committed by Jonathan Cameron
Browse files

iio: adc: ad7606: fix oversampling gpio array


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>
parent 8d71a5d8
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment