Skip to content

Commit 89a01cd

Browse files
mhennerichjic23
authored andcommitted
iio: dac: ad5446: Fix read_raw not returning set value
read_raw should return the un-scaled value. Fixes: 5e06bdf ("staging:iio:dac:ad5446: Return cached value for 'raw' attribute") Signed-off-by: Michael Hennerich <[email protected]> Reviewed-by: Nuno Sá <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 3a26787 commit 89a01cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/dac/ad5446.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int ad5446_read_raw(struct iio_dev *indio_dev,
178178

179179
switch (m) {
180180
case IIO_CHAN_INFO_RAW:
181-
*val = st->cached_val;
181+
*val = st->cached_val >> chan->scan_type.shift;
182182
return IIO_VAL_INT;
183183
case IIO_CHAN_INFO_SCALE:
184184
*val = st->vref_mv;

0 commit comments

Comments
 (0)