Commit 75bb23a2 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Greg Kroah-Hartman

staging:iio:dac:ad5791: Fix scale unit

Scale is currently reported in volts instead of millivolts. This patch fixes it.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f1a61a88
......@@ -239,7 +239,7 @@ static int ad5791_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT;
case (1 << IIO_CHAN_INFO_SCALE_SHARED):
*val = 0;
*val2 = (st->vref_mv * 1000) >> chan->scan_type.realbits;
*val2 = (((u64)st->vref_mv) * 1000000ULL) >> chan->scan_type.realbits;
return IIO_VAL_INT_PLUS_MICRO;
case (1 << IIO_CHAN_INFO_OFFSET_SHARED):
val64 = (((u64)st->vref_neg_mv) << chan->scan_type.realbits);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment