mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-13 05:00:15 -04:00
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: 874bbd1219 ("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>
This commit is contained in:
committed by
Jonathan Cameron
parent
4eba4d9290
commit
21d7241faf
@@ -1084,7 +1084,7 @@ static int ad7192_update_scan_mode(struct iio_dev *indio_dev, const unsigned lon
|
||||
|
||||
conf &= ~AD7192_CONF_CHAN_MASK;
|
||||
for_each_set_bit(i, scan_mask, 8)
|
||||
conf |= FIELD_PREP(AD7192_CONF_CHAN_MASK, i);
|
||||
conf |= FIELD_PREP(AD7192_CONF_CHAN_MASK, BIT(i));
|
||||
|
||||
ret = ad_sd_write_reg(&st->sd, AD7192_REG_CONF, 3, conf);
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user