Skip to content

Commit 21d7241

Browse files
Markus Burrijic23
authored andcommitted
iio: adc: ad7192: fix channel select
Channel configuration doesn't work as expected. For FIELD_PREP the bit mask is needed and not the bit number. Fixes: 874bbd1 ("iio: adc: ad7192: Use bitfield access macros") Signed-off-by: Markus Burri <[email protected]> Reviewed-by: Nuno Sá <[email protected]> Link: https://patch.msgid.link/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 4eba4d9 commit 21d7241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/ad7192.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ static int ad7192_update_scan_mode(struct iio_dev *indio_dev, const unsigned lon
10841084

10851085
conf &= ~AD7192_CONF_CHAN_MASK;
10861086
for_each_set_bit(i, scan_mask, 8)
1087-
conf |= FIELD_PREP(AD7192_CONF_CHAN_MASK, i);
1087+
conf |= FIELD_PREP(AD7192_CONF_CHAN_MASK, BIT(i));
10881088

10891089
ret = ad_sd_write_reg(&st->sd, AD7192_REG_CONF, 3, conf);
10901090
if (ret < 0)

0 commit comments

Comments
 (0)