summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/light/isl29018.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@kernel.org>2012-04-15 17:41:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-18 16:38:20 -0700
commit90354d0038e9e3d82d5fee5442d48f7cafb96a0c (patch)
tree3be19b32499bb455456edf8579d04ee1fb230f93 /drivers/staging/iio/light/isl29018.c
parenta5d016d46630968fcf9c329f5cf522a7c03b3888 (diff)
staging:iio:light Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers.
Precursor to making value read / write attribute optional. Note that minimal change route taken here. The read_raw callbacks in both drivers could do fewer checks to identify the channel than they now do. 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>
Diffstat (limited to 'drivers/staging/iio/light/isl29018.c')
-rw-r--r--drivers/staging/iio/light/isl29018.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 38ec52b65dfa..350f12c98ae5 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -383,7 +383,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
mutex_lock(&chip->lock);
switch (mask) {
- case 0:
+ case IIO_CHAN_INFO_RAW:
+ case IIO_CHAN_INFO_PROCESSED:
switch (chan->type) {
case IIO_LIGHT:
ret = isl29018_read_lux(client, val);
@@ -420,14 +421,17 @@ static const struct iio_chan_spec isl29018_channels[] = {
.indexed = 1,
.channel = 0,
.processed_val = IIO_PROCESSED,
- .info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
+ .info_mask = IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT |
+ IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
}, {
.type = IIO_INTENSITY,
.modified = 1,
+ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.channel2 = IIO_MOD_LIGHT_IR,
}, {
/* Unindexed in current ABI. But perhaps it should be. */
.type = IIO_PROXIMITY,
+ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
}
};