diff options
author | Mike Looijmans <mike.looijmans@topic.nl> | 2019-02-13 08:41:47 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-27 09:35:35 +0200 |
commit | f245ce44d58e88c74d37d73b23ac9617789038d2 (patch) | |
tree | 4b73be09424eef3c7b97ef93df76a3aaaf9b1aee /drivers/iio | |
parent | b7ad00c028ab8ab238cc72906b8fdb6ed3c874ea (diff) | |
download | linux-stable-f245ce44d58e88c74d37d73b23ac9617789038d2.tar.gz linux-stable-f245ce44d58e88c74d37d73b23ac9617789038d2.tar.bz2 linux-stable-f245ce44d58e88c74d37d73b23ac9617789038d2.zip |
iio/gyro/bmg160: Use millidegrees for temperature scale
commit 40a7198a4a01037003c7ca714f0d048a61e729ac upstream.
Standard unit for temperature is millidegrees Celcius, whereas this driver
was reporting in degrees. Fix the scale factor in the driver.
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/gyro/bmg160_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 821919dd245b..b5a5517e3ce1 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -583,11 +583,10 @@ static int bmg160_read_raw(struct iio_dev *indio_dev, case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: return bmg160_get_filter(data, val); case IIO_CHAN_INFO_SCALE: - *val = 0; switch (chan->type) { case IIO_TEMP: - *val2 = 500000; - return IIO_VAL_INT_PLUS_MICRO; + *val = 500; + return IIO_VAL_INT; case IIO_ANGL_VEL: { int i; @@ -595,6 +594,7 @@ static int bmg160_read_raw(struct iio_dev *indio_dev, for (i = 0; i < ARRAY_SIZE(bmg160_scale_table); ++i) { if (bmg160_scale_table[i].dps_range == data->dps_range) { + *val = 0; *val2 = bmg160_scale_table[i].scale; return IIO_VAL_INT_PLUS_MICRO; } |