]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging:iio:gyro Add IIO_CHAN_INFO_RAW entries to all drivers.
authorJonathan Cameron <jic23@kernel.org>
Sun, 15 Apr 2012 16:41:20 +0000 (17:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Apr 2012 23:38:19 +0000 (16:38 -0700)
Precursor to making value read / write attribute optional.
No processed values in gyroscopes.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/gyro/adis16060_core.c
drivers/staging/iio/gyro/adis16080_core.c
drivers/staging/iio/gyro/adis16130_core.c
drivers/staging/iio/gyro/adis16260_core.c
drivers/staging/iio/gyro/adxrs450_core.c

index 02cc23420b908356ca64613128a2a4614e24d49c..2f841cb1923845b4804e8f324949631224c5e28e 100644 (file)
@@ -85,7 +85,7 @@ static int adis16060_read_raw(struct iio_dev *indio_dev,
        int ret;
 
        switch (mask) {
-       case 0:
+       case IIO_CHAN_INFO_RAW:
                /* Take the iio_dev status lock */
                mutex_lock(&indio_dev->mlock);
                ret = adis16060_spi_write(indio_dev, chan->address);
@@ -120,22 +120,26 @@ static const struct iio_chan_spec adis16060_channels[] = {
                .type = IIO_ANGL_VEL,
                .modified = 1,
                .channel2 = IIO_MOD_Z,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16060_GYRO,
        }, {
                .type = IIO_VOLTAGE,
                .indexed = 1,
                .channel = 0,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16060_AIN1,
        }, {
                .type = IIO_VOLTAGE,
                .indexed = 1,
                .channel = 1,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16060_AIN2,
        }, {
                .type = IIO_TEMP,
                .indexed = 1,
                .channel = 0,
-               .info_mask = IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+               IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
                IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
                .address = ADIS16060_TEMP_OUT,
        }
index 1815490db8b4f7fecc4c542ccffbb7eb3422df98..608b93d07484d3ecb7493568c070ccffa324c4e3 100644 (file)
@@ -87,7 +87,7 @@ static int adis16080_read_raw(struct iio_dev *indio_dev,
 
        mutex_lock(&indio_dev->mlock);
        switch (mask) {
-       case 0:
+       case IIO_CHAN_INFO_RAW:
                ret = adis16080_spi_write(indio_dev,
                                          chan->address |
                                          ADIS16080_DIN_WRITE);
@@ -110,21 +110,25 @@ static const struct iio_chan_spec adis16080_channels[] = {
                .type = IIO_ANGL_VEL,
                .modified = 1,
                .channel2 = IIO_MOD_Z,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16080_DIN_GYRO,
        }, {
                .type = IIO_VOLTAGE,
                .indexed = 1,
                .channel = 0,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16080_DIN_AIN1,
        }, {
                .type = IIO_VOLTAGE,
                .indexed = 1,
                .channel = 1,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16080_DIN_AIN2,
        }, {
                .type = IIO_TEMP,
                .indexed = 1,
                .channel = 0,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16080_DIN_TEMP,
        }
 };
index 947eb86f05d8e493282f73b04483218eb3a59050..257bdf2bfb46234d45746dde43a64fe55aa633f0 100644 (file)
@@ -100,11 +100,13 @@ static const struct iio_chan_spec adis16130_channels[] = {
                .type = IIO_ANGL_VEL,
                .modified = 1,
                .channel2 = IIO_MOD_Z,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16130_RATEDATA,
        }, {
                .type = IIO_TEMP,
                .indexed = 1,
                .channel = 0,
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
                .address = ADIS16130_TEMPDATA,
        }
 };
index 92f024eb8c80461a325208770be0ed3ef389e6f6..bb2301833495164b76fbdede16a6336617c65825 100644 (file)
@@ -393,7 +393,8 @@ enum adis16260_channel {
                        .type = IIO_ANGL_VEL,                           \
                        .modified = 1,                                  \
                        .channel2 = mod,                                \
-                       .info_mask = IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | \
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |   \
+                       IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |          \
                        IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |         \
                        IIO_CHAN_INFO_SCALE_SEPARATE_BIT,               \
                        .address = gyro,                                \
@@ -407,6 +408,7 @@ enum adis16260_channel {
                        .type = IIO_ANGL,                               \
                        .modified = 1,                                  \
                        .channel2 = mod,                                \
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,    \
                        .address = angle,                               \
                        .scan_index = ADIS16260_SCAN_ANGL,              \
                        .scan_type = {                                  \
@@ -418,7 +420,8 @@ enum adis16260_channel {
                        .type = IIO_TEMP,                               \
                        .indexed = 1,                                   \
                        .channel = 0,                                   \
-                       .info_mask = IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | \
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |   \
+                       IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |             \
                        IIO_CHAN_INFO_SCALE_SEPARATE_BIT,               \
                        .address = temp,                                \
                        .scan_index = ADIS16260_SCAN_TEMP,              \
@@ -432,7 +435,8 @@ enum adis16260_channel {
                        .indexed = 1,                                   \
                        .channel = 0,                                   \
                        .extend_name = "supply",                        \
-                       .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,  \
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |   \
+                       IIO_CHAN_INFO_SCALE_SEPARATE_BIT,               \
                        .address = in_supply,                           \
                        .scan_index = ADIS16260_SCAN_SUPPLY,            \
                        .scan_type = {                                  \
@@ -444,7 +448,8 @@ enum adis16260_channel {
                        .type = IIO_VOLTAGE,                            \
                        .indexed = 1,                                   \
                        .channel = 1,                                   \
-                       .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,  \
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |   \
+                       IIO_CHAN_INFO_SCALE_SEPARATE_BIT,               \
                        .address = in_aux,                              \
                        .scan_index = ADIS16260_SCAN_AUX_ADC,           \
                        .scan_type = {                                  \
@@ -481,7 +486,7 @@ static int adis16260_read_raw(struct iio_dev *indio_dev,
        s16 val16;
 
        switch (mask) {
-       case 0:
+       case IIO_CHAN_INFO_RAW:
                mutex_lock(&indio_dev->mlock);
                addr = adis16260_addresses[chan->address][0];
                ret = adis16260_spi_read_reg_16(indio_dev, addr, &val16);
index 15e2496f70c833434982af6b044cf450d87d1b8a..12935057836e0b94c4091fce40ddfd5fdde68a54 100644 (file)
@@ -265,7 +265,7 @@ static int adxrs450_read_raw(struct iio_dev *indio_dev,
        s16 t;
 
        switch (mask) {
-       case 0:
+       case IIO_CHAN_INFO_RAW:
                switch (chan->type) {
                case IIO_ANGL_VEL:
                        ret = adxrs450_spi_sensor_data(indio_dev, &t);
@@ -329,14 +329,16 @@ static const struct iio_chan_spec adxrs450_channels[2][2] = {
                        .type = IIO_ANGL_VEL,
                        .modified = 1,
                        .channel2 = IIO_MOD_Z,
-                       .info_mask = IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+                       IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
                        IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT |
                        IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
                }, {
                        .type = IIO_TEMP,
                        .indexed = 1,
                        .channel = 0,
-                       .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+                       IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
                }
        },
        [ID_ADXRS453] = {
@@ -344,13 +346,15 @@ static const struct iio_chan_spec adxrs450_channels[2][2] = {
                        .type = IIO_ANGL_VEL,
                        .modified = 1,
                        .channel2 = IIO_MOD_Z,
-                       .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+                       IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
                        IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT,
                }, {
                        .type = IIO_TEMP,
                        .indexed = 1,
                        .channel = 0,
-                       .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
+                       .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+                       IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
                }
        },
 };