Skip to content

Commit 81de68a

Browse files
Markus Burrigregkh
authored andcommitted
iio: adc: ad7192: fix channel select
commit 21d7241 upstream. 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 <markus.burri@mt.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250124150703.97848-1-markus.burri@mt.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e6df127 commit 81de68a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iio/adc/ad7192.c

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

10831083
conf &= ~AD7192_CONF_CHAN_MASK;
10841084
for_each_set_bit(i, scan_mask, 8)
1085-
conf |= FIELD_PREP(AD7192_CONF_CHAN_MASK, i);
1085+
conf |= FIELD_PREP(AD7192_CONF_CHAN_MASK, BIT(i));
10861086

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

0 commit comments

Comments
 (0)