summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/light/isl29018.c
diff options
context:
space:
mode:
authorJonathan Cameron2011-10-26 18:41:36 +0200
committerGreg Kroah-Hartman2011-11-27 01:35:04 +0100
commitc8a9f8056f40f6201b84fdddb49a1c62630902c5 (patch)
treeec883343656925d7f0e88decf16689c4f47b8822 /drivers/staging/iio/light/isl29018.c
parentstaging:iio: Do not use bitmasks for channel info addresses (diff)
downloadkernel-qcow2-linux-c8a9f8056f40f6201b84fdddb49a1c62630902c5.tar.gz
kernel-qcow2-linux-c8a9f8056f40f6201b84fdddb49a1c62630902c5.tar.xz
kernel-qcow2-linux-c8a9f8056f40f6201b84fdddb49a1c62630902c5.zip
staging:iio:treewide only use shared to decide on interfaces
Internally the fact that say scale is shared across channels is actually of remarkably little interest. Hence lets not store it. Numerous devices have weird combinations of channels sharing scale anyway so it is not as though this was really telling us much. Note however that we do still use the shared sysfs attrs thus massively reducing the number of attrs in complex drivers. Side effect is that certain drivers that were abusing this (mostly my work) needed to do a few more checks on what the channel they are being queried on actually is. This is also helpful for in kernel interfaces where we just want to query the scale and don't care whether it is shared with other channels or not. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/light/isl29018.c')
-rw-r--r--drivers/staging/iio/light/isl29018.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index bed18a74d30c..f0c733a2826a 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -362,8 +362,7 @@ static int isl29018_write_raw(struct iio_dev *indio_dev,
int ret = -EINVAL;
mutex_lock(&chip->lock);
- if (mask == IIO_CHAN_INFO_CALIBSCALE_SEPARATE &&
- chan->type == IIO_LIGHT) {
+ if (mask == IIO_CHAN_INFO_CALIBSCALE && chan->type == IIO_LIGHT) {
chip->lux_scale = val;
ret = 0;
}
@@ -402,7 +401,7 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
if (!ret)
ret = IIO_VAL_INT;
break;
- case IIO_CHAN_INFO_CALIBSCALE_SEPARATE:
+ case IIO_CHAN_INFO_CALIBSCALE:
if (chan->type == IIO_LIGHT) {
*val = chip->lux_scale;
ret = IIO_VAL_INT;
@@ -421,7 +420,7 @@ static const struct iio_chan_spec isl29018_channels[] = {
.indexed = 1,
.channel = 0,
.processed_val = IIO_PROCESSED,
- .info_mask = (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE),
+ .info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
}, {
.type = IIO_INTENSITY,
.modified = 1,