summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/dac/ad5064.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/dac/ad5064.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/dac/ad5064.c')
-rw-r--r--drivers/staging/iio/dac/ad5064.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/dac/ad5064.c b/drivers/staging/iio/dac/ad5064.c
index 1c25403620ff..a701063a9267 100644
--- a/drivers/staging/iio/dac/ad5064.c
+++ b/drivers/staging/iio/dac/ad5064.c
@@ -91,7 +91,7 @@ enum ad5064_type {
.indexed = 1, \
.output = 1, \
.channel = (chan), \
- .info_mask = (1 << IIO_CHAN_INFO_SCALE_SEPARATE), \
+ .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
.address = AD5064_ADDR_DAC(chan), \
.scan_type = IIO_ST('u', (bits), 16, 20 - (bits)) \
}
@@ -287,7 +287,7 @@ static int ad5064_read_raw(struct iio_dev *indio_dev,
case 0:
*val = st->dac_cache[chan->channel];
return IIO_VAL_INT;
- case IIO_CHAN_INFO_SCALE_SEPARATE:
+ case IIO_CHAN_INFO_SCALE:
vref = st->chip_info->shared_vref ? 0 : chan->channel;
scale_uv = regulator_get_voltage(st->vref_reg[vref].consumer);
if (scale_uv < 0)