diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-10-26 16:41:35 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-27 00:35:04 (GMT) |
commit | 924f8a21dd13223cc1493a916c6769cf73e0d45e (patch) | |
tree | 60ec15425748b95730cb779f618d0ab6d0d0fd78 /drivers/staging/iio/iio_simple_dummy.c | |
parent | 3014cd97e56d312865d670653adec338a8e5fc0e (diff) | |
download | linux-924f8a21dd13223cc1493a916c6769cf73e0d45e.tar.xz |
staging:iio: Do not use bitmasks for channel info addresses
Currently the iio framework uses bitmasks for the address field of channel info
attributes. This is for historical reasons and no longer required since it will
only ever query a single info attribute at once. This patch changes the code to
use the non-shifted iio_chan_info_enum values for the info attribute address.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/iio_simple_dummy.c')
-rw-r--r-- | drivers/staging/iio/iio_simple_dummy.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/iio/iio_simple_dummy.c b/drivers/staging/iio/iio_simple_dummy.c index 06c022e..2196ff1 100644 --- a/drivers/staging/iio/iio_simple_dummy.c +++ b/drivers/staging/iio/iio_simple_dummy.c @@ -229,29 +229,29 @@ static int iio_dummy_read_raw(struct iio_dev *indio_dev, break; } break; - case (1 << IIO_CHAN_INFO_OFFSET_SEPARATE): + case IIO_CHAN_INFO_OFFSET_SEPARATE: /* only single ended adc -> 7 */ *val = 7; ret = IIO_VAL_INT; break; - case (1 << IIO_CHAN_INFO_SCALE_SEPARATE): + case IIO_CHAN_INFO_SCALE_SEPARATE: /* only single ended adc -> 0.001333 */ *val = 0; *val2 = 1333; ret = IIO_VAL_INT_PLUS_MICRO; break; - case (1 << IIO_CHAN_INFO_SCALE_SHARED): + case IIO_CHAN_INFO_SCALE_SHARED: /* all differential adc channels -> 0.000001344 */ *val = 0; *val2 = 1344; ret = IIO_VAL_INT_PLUS_NANO; break; - case (1 << IIO_CHAN_INFO_CALIBBIAS_SEPARATE): + case IIO_CHAN_INFO_CALIBBIAS_SEPARATE: /* only the acceleration axis - read from cache */ *val = st->accel_calibbias; ret = IIO_VAL_INT; break; - case (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE): + case IIO_CHAN_INFO_CALIBSCALE_SEPARATE: *val = st->accel_calibscale->val; *val2 = st->accel_calibscale->val2; ret = IIO_VAL_INT_PLUS_MICRO; @@ -296,7 +296,7 @@ static int iio_dummy_write_raw(struct iio_dev *indio_dev, st->dac_val = val; mutex_unlock(&st->lock); return 0; - case (1 << IIO_CHAN_INFO_CALIBBIAS_SEPARATE): + case IIO_CHAN_INFO_CALIBBIAS_SEPARATE: mutex_lock(&st->lock); /* Compare against table - hard matching here */ for (i = 0; i < ARRAY_SIZE(dummy_scales); i++) |