iio: gyro: ADXRS450: Add missing read support for calibbias attribute
authorMichael Hennerich <michael.hennerich@analog.com>
Wed, 14 Dec 2011 19:25:12 +0000 (20:25 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Dec 2011 18:55:01 +0000 (10:55 -0800)
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/gyro/adxrs450_core.c

index 9d33628..a146d55 100644 (file)
@@ -308,6 +308,13 @@ static int adxrs450_read_raw(struct iio_dev *indio_dev,
                *val = t;
                ret = IIO_VAL_INT;
                break;
+       case IIO_CHAN_INFO_CALIBBIAS:
+               ret = adxrs450_spi_read_reg_16(indio_dev, ADXRS450_DNC1, &t);
+               if (ret)
+                       break;
+               *val = t;
+               ret = IIO_VAL_INT;
+               break;
        default:
                ret = -EINVAL;
                break;