1 From 40a7198a4a01037003c7ca714f0d048a61e729ac Mon Sep 17 00:00:00 2001
2 From: Mike Looijmans <mike.looijmans@topic.nl>
3 Date: Wed, 13 Feb 2019 08:41:47 +0100
4 Subject: iio/gyro/bmg160: Use millidegrees for temperature scale
6 From: Mike Looijmans <mike.looijmans@topic.nl>
8 commit 40a7198a4a01037003c7ca714f0d048a61e729ac upstream.
10 Standard unit for temperature is millidegrees Celcius, whereas this driver
11 was reporting in degrees. Fix the scale factor in the driver.
13 Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
14 Cc: <Stable@vger.kernel.org>
15 Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 drivers/iio/gyro/bmg160_core.c | 6 +++---
20 1 file changed, 3 insertions(+), 3 deletions(-)
22 --- a/drivers/iio/gyro/bmg160_core.c
23 +++ b/drivers/iio/gyro/bmg160_core.c
24 @@ -582,11 +582,10 @@ static int bmg160_read_raw(struct iio_de
25 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
26 return bmg160_get_filter(data, val);
27 case IIO_CHAN_INFO_SCALE:
32 - return IIO_VAL_INT_PLUS_MICRO;
38 @@ -594,6 +593,7 @@ static int bmg160_read_raw(struct iio_de
39 for (i = 0; i < ARRAY_SIZE(bmg160_scale_table); ++i) {
40 if (bmg160_scale_table[i].dps_range ==
43 *val2 = bmg160_scale_table[i].scale;
44 return IIO_VAL_INT_PLUS_MICRO;