Skip to content

Commit 732ae19

Browse files
miquelraynalJonathan Cameron
authored andcommitted
iio: adc: max1027: Fix wrong shift with 12-bit devices
10-bit devices must shift the value twice. This is not needed anymore on 12-bit devices. Fixes: ae47d00 ("iio: adc: max1027: Introduce 12-bit devices support") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210818111139.330636-2-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent bbcf408 commit 732ae19

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/iio/adc/max1027.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids);
103103
.sign = 'u', \
104104
.realbits = depth, \
105105
.storagebits = 16, \
106-
.shift = 2, \
106+
.shift = (depth == 10) ? 2 : 0, \
107107
.endianness = IIO_BE, \
108108
}, \
109109
}

0 commit comments

Comments
 (0)