diff options
author | Jonathan Cameron <jic23@kernel.org> | 2013-02-19 21:10:30 +0000 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-03-17 19:49:09 +0000 |
commit | 8655cc490e83f66476de8c1294411860325c3531 (patch) | |
tree | 2bb6ceece8cf1694264fb00a27e560b2c3fc6547 /include/linux/iio | |
parent | 10f5b14811023df0ba1a936b14880eabb6d9c199 (diff) | |
download | op-kernel-dev-8655cc490e83f66476de8c1294411860325c3531.zip op-kernel-dev-8655cc490e83f66476de8c1294411860325c3531.tar.gz |
iio: Add broken out info_mask fields for shared_by_type and separate
This simplifies the code, removes an extensive layer of 'helper' macros
and gives us twice as much room to play with in these masks before we
have any need to be clever.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'include/linux/iio')
-rw-r--r-- | include/linux/iio/iio.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index da8c776..7697650 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -218,6 +218,10 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, * endianness: little or big endian * @info_mask: What information is to be exported about this channel. * This includes calibbias, scale etc. + * @info_mask_separate: What information is to be exported that is specific to + * this channel. + * @info_mask_shared_by_type: What information is to be exported that is shared +* by all channels of the same type. * @event_mask: What events can this channel produce. * @ext_info: Array of extended info attributes for this channel. * The array is NULL terminated, the last element should @@ -253,6 +257,8 @@ struct iio_chan_spec { enum iio_endian endianness; } scan_type; long info_mask; + long info_mask_separate; + long info_mask_shared_by_type; long event_mask; const struct iio_chan_spec_ext_info *ext_info; const char *extend_name; @@ -275,7 +281,9 @@ struct iio_chan_spec { static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, enum iio_chan_info_enum type) { - return chan->info_mask & IIO_CHAN_INFO_BITS(type); + return (chan->info_mask & IIO_CHAN_INFO_BITS(type)) | + (chan->info_mask_separate & type) | + (chan->info_mask_shared_by_type & type); } #define IIO_ST(si, rb, sb, sh) \ |