]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: adis16400: Report pressure channel scale
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 15 May 2015 15:18:34 +0000 (17:18 +0200)
committerLuis Henriques <luis.henriques@canonical.com>
Thu, 11 Jun 2015 10:24:56 +0000 (11:24 +0100)
commit 69ca2d771e4e709c5ae1125858e1246e77ef8b86 upstream.

Add the scale for the pressure channel, which is currently missing.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Fixes: 76ada52f7f5d ("iio:adis16400: Add support for the adis16448")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/iio/imu/adis16400_core.c

index 8ca469c17a919f71134e67bf4e8c144d84cdf2d8..1bf990c06d039cd8aa571a53554b20744d381cb6 100644 (file)
@@ -438,6 +438,11 @@ static int adis16400_read_raw(struct iio_dev *indio_dev,
                        *val = st->variant->temp_scale_nano / 1000000;
                        *val2 = (st->variant->temp_scale_nano % 1000000);
                        return IIO_VAL_INT_PLUS_MICRO;
+               case IIO_PRESSURE:
+                       /* 20 uBar = 0.002kPascal */
+                       *val = 0;
+                       *val2 = 2000;
+                       return IIO_VAL_INT_PLUS_MICRO;
                default:
                        return -EINVAL;
                }