On 10/21/11 13:24, Lars-Peter Clausen wrote: > Introduce IIO_CHAN_INFO_*_MASK defines which can be used for specifying channel > a channel_spec info_mask attribute. This should be more convenient and also > more readable than creating the mask manually in each driver using the shift > operator. > Fair enough. Could call them IIO_CHAN_INFO_SCALE_SHARED_BIT etc? Marginally more accurate. MASK kind of implies multiple bits to my mind... > Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx> > --- > Patch based on linux-iio/master > --- > drivers/staging/iio/iio.h | 37 +++++++++++++++++++++++++++++++++++++ > 1 files changed, 37 insertions(+), 0 deletions(-) > > diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h > index d7c5f3f..7ff8c98 100644 > --- a/drivers/staging/iio/iio.h > +++ b/drivers/staging/iio/iio.h > @@ -46,6 +46,43 @@ enum iio_chan_info_enum { > IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE, > }; > > +#define IIO_CHAN_INFO_SCALE_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_SCALE_SHARED) > +#define IIO_CHAN_INFO_SCALE_SEPARATE_MASK \ > + BIT(IIO_CHAN_INFO_SCALE_SEPARATE) > +#define IIO_CHAN_INFO_OFFSET_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_OFFSET_SHARED) > +#define IIO_CHAN_INFO_OFFSET_SEPARATE_MASK \ > + BIT(IIO_CHAN_INFO_OFFSET_SEPARATE) > +#define IIO_CHAN_INFO_CALIBSCALE_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_CALIBSCALE_SHARED) > +#define IIO_CHAN_INFO_CALIBSCALE_SEPARATE_MASK \ > + BIT(IIO_CHAN_INFO_CALIBSCALE_SEPARATE) > +#define IIO_CHAN_INFO_CALIBBIAS_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_CALIBBIAS_SHARED) > +#define IIO_CHAN_INFO_CALIBBIAS_SEPARATE_MASK \ > + BIT(IIO_CHAN_INFO_CALIBBIAS_SEPARATE) > +#define IIO_CHAN_INFO_PEAK_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_PEAK_SHARED) > +#define IIO_CHAN_INFO_PEAK_SEPARATE_MASK \ > + BIT(IIO_CHAN_INFO_PEAK_SEPARATE) > +#define IIO_CHAN_INFO_PEAK_SCALE_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_PEAK_SCALE_SHARED) > +#define IIO_CHAN_INFO_PEAK_SCALE_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_PEAK_SCALE_SHARED) > +#define IIO_CHAN_INFO_SCALE_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_SCALE_SHARED) > +#define IIO_CHAN_INFO_SCALE_SEPARATE_MASK \ > + BIT(IIO_CHAN_INFO_SCALE_SEPARATE) > +#define IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SHARED) > +#define IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_MASK \ > + BIT(IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE) > +#define IIO_CHAN_INFO_AVERAGE_RAW_SHARED_MASK \ > + BIT(IIO_CHAN_INFO_AVERAGE_RAW_SHARED) > +#define IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_MASK \ > + BIT(IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE) > + > enum iio_endian { > IIO_CPU, > IIO_BE, -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html