diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-10-19 17:47:52 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-19 13:57:01 -0700 |
commit | 75bb23a2150e385230d1db52065641ca7cef63d3 (patch) | |
tree | 6556f574a263cf6edf31c48ff1d8fc8933289d2b | |
parent | f1a61a8888afb9c21bb7efdd25f2755b01f065d3 (diff) | |
download | blackbird-op-linux-75bb23a2150e385230d1db52065641ca7cef63d3.tar.gz blackbird-op-linux-75bb23a2150e385230d1db52065641ca7cef63d3.zip |
staging:iio:dac:ad5791: Fix scale unit
Scale is currently reported in volts instead of millivolts. This patch fixes it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/iio/dac/ad5791.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/dac/ad5791.c b/drivers/staging/iio/dac/ad5791.c index 9ba45f1a2379..6fbca8d96153 100644 --- a/drivers/staging/iio/dac/ad5791.c +++ b/drivers/staging/iio/dac/ad5791.c @@ -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); |