.indexed = 1,
.channel = 0,
/* What other information is available? */
- .info_mask =
+ .info_mask_separate =
/*
* in_voltage0_raw
* Raw (unscaled no bias removal etc) measurement
* from the device.
*/
- IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+ BIT(IIO_CHAN_INFO_RAW) |
/*
* in_voltage0_offset
* Offset for userspace to apply prior to scale
* when converting to standard units (microvolts)
*/
- IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
+ BIT(IIO_CHAN_INFO_OFFSET) |
/*
* in_voltage0_scale
* Multipler for userspace to apply post offset
* when converting to standard units (microvolts)
*/
- IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
+ BIT(IIO_CHAN_INFO_SCALE),
/* The ordering of elements in the buffer via an enum */
.scan_index = voltage0,
.scan_type = { /* Description of storage in buffer */
.indexed = 1,
.channel = 1,
.channel2 = 2,
- .info_mask =
/*
* in_voltage1-voltage2_raw
* Raw (unscaled no bias removal etc) measurement
* from the device.
*/
- IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
/*
* in_voltage-voltage_scale
* Shared version of scale - shared by differential
* input channels of type IIO_VOLTAGE.
*/
- IIO_CHAN_INFO_SCALE_SHARED_BIT,
+ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.scan_index = diffvoltage1m2,
.scan_type = { /* Description of storage in buffer */
.sign = 's', /* signed */
.indexed = 1,
.channel = 3,
.channel2 = 4,
- .info_mask =
- IIO_CHAN_INFO_RAW_SEPARATE_BIT |
- IIO_CHAN_INFO_SCALE_SHARED_BIT,
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
+ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.scan_index = diffvoltage3m4,
.scan_type = {
.sign = 's',
.modified = 1,
/* Channel 2 is use for modifiers */
.channel2 = IIO_MOD_X,
- .info_mask =
- IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
/*
* Internal bias correction value. Applied
* by the hardware or driver prior to userspace
* seeing the readings. Typically part of hardware
* calibration.
*/
- IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
+ BIT(IIO_CHAN_INFO_CALIBBIAS),
.scan_index = accelx,
.scan_type = { /* Description of storage in buffer */
.sign = 's', /* signed */
/* DAC channel out_voltage0_raw */
{
.type = IIO_VOLTAGE,
- .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
.output = 1,
.indexed = 1,
.channel = 0,
* @chan: the channel whose data is to be read
* @val: first element of returned value (typically INT)
* @val2: second element of returned value (typically MICRO)
- * @mask: what we actually want to read. 0 is the channel, everything else
- * is as per the info_mask in iio_chan_spec.
+ * @mask: what we actually want to read as per the info_mask_*
+ * in iio_chan_spec.
*/
static int iio_dummy_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
* @chan: the channel whose data is to be written
* @val: first element of value to set (typically INT)
* @val2: second element of value to set (typically MICRO)
- * @mask: what we actually want to write. 0 is the channel, everything else
- * is as per the info_mask in iio_chan_spec.
+ * @mask: what we actually want to write as per the info_mask_*
+ * in iio_chan_spec.
*
* Note that all raw writes are assumed IIO_VAL_INT and info mask elements
* are assumed to be IIO_INT_PLUS_MICRO unless the callback write_raw_get_fmt