]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging:iio:magnetometer Add IIO_CHAN_INFO_RAW entries to all drivers.
authorJonathan Cameron <jic23@kernel.org>
Sun, 15 Apr 2012 16:41:23 +0000 (17:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Apr 2012 23:38:20 +0000 (16:38 -0700)
Precursor to making value read / write attribute optional.
No processed values for magnetometers.

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/magnetometer/ak8975.c
drivers/staging/iio/magnetometer/hmc5843.c

index d5ddac3d88311a64a0a31922b3a33cae8ed2d4a0..000886fb81a966531e8ae5bc53d3f85daaba4990 100644 (file)
@@ -429,7 +429,7 @@ static int ak8975_read_raw(struct iio_dev *indio_dev,
        struct ak8975_data *data = iio_priv(indio_dev);
 
        switch (mask) {
-       case 0:
+       case IIO_CHAN_INFO_RAW:
                return ak8975_read_axis(indio_dev, chan->address, val);
        case IIO_CHAN_INFO_SCALE:
                *val = data->raw_to_gauss[chan->address];
@@ -443,7 +443,8 @@ static int ak8975_read_raw(struct iio_dev *indio_dev,
                .type = IIO_MAGN,                                       \
                .modified = 1,                                          \
                .channel2 = IIO_MOD_##axis,                             \
-               .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,  \
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |           \
+                            IIO_CHAN_INFO_SCALE_SEPARATE_BIT,          \
                .address = index,                                       \
        }
 
index 91dd3da70cb4961a9751c107bb9eb7565d48e3db..27c26294b26178e03ede8e8a4af95a3a7eaca71b 100644 (file)
@@ -459,7 +459,7 @@ static int hmc5843_read_raw(struct iio_dev *indio_dev,
        struct hmc5843_data *data = iio_priv(indio_dev);
 
        switch (mask) {
-       case 0:
+       case IIO_CHAN_INFO_RAW:
                return hmc5843_read_measurement(indio_dev,
                                                chan->address,
                                                val);
@@ -476,7 +476,8 @@ static int hmc5843_read_raw(struct iio_dev *indio_dev,
                .type = IIO_MAGN,                                       \
                .modified = 1,                                          \
                .channel2 = IIO_MOD_##axis,                             \
-               .info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,            \
+               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |           \
+                            IIO_CHAN_INFO_SCALE_SHARED_BIT,            \
                .address = add                                          \
        }