提交 b11f98ff 编写于 作者: J Jonathan Cameron 提交者: Greg Kroah-Hartman

staging:iio:adc Add IIO_CHAN_INFO_RAW entries to all drivers.

Precursor to making value read / write attribute optional.
No processed values for adc's.

Updated to include the spear adc driver (hence introducing a
dependency on the patch that adds that driver).
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
Acked-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 31313fc6
...@@ -849,7 +849,7 @@ static int ad7192_read_raw(struct iio_dev *indio_dev, ...@@ -849,7 +849,7 @@ static int ad7192_read_raw(struct iio_dev *indio_dev,
bool unipolar = !!(st->conf & AD7192_CONF_UNIPOLAR); bool unipolar = !!(st->conf & AD7192_CONF_UNIPOLAR);
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev)) if (iio_buffer_enabled(indio_dev))
ret = -EBUSY; ret = -EBUSY;
...@@ -981,7 +981,8 @@ static const struct iio_info ad7195_info = { ...@@ -981,7 +981,8 @@ static const struct iio_info ad7195_info = {
.extend_name = _name, \ .extend_name = _name, \
.channel = _chan, \ .channel = _chan, \
.channel2 = _chan2, \ .channel2 = _chan2, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = _address, \ .address = _address, \
.scan_index = _si, \ .scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)} .scan_type = IIO_ST('s', 24, 32, 0)}
...@@ -990,7 +991,8 @@ static const struct iio_info ad7195_info = { ...@@ -990,7 +991,8 @@ static const struct iio_info ad7195_info = {
{ .type = IIO_VOLTAGE, \ { .type = IIO_VOLTAGE, \
.indexed = 1, \ .indexed = 1, \
.channel = _chan, \ .channel = _chan, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = _address, \ .address = _address, \
.scan_index = _si, \ .scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)} .scan_type = IIO_ST('s', 24, 32, 0)}
...@@ -999,7 +1001,8 @@ static const struct iio_info ad7195_info = { ...@@ -999,7 +1001,8 @@ static const struct iio_info ad7195_info = {
{ .type = IIO_TEMP, \ { .type = IIO_TEMP, \
.indexed = 1, \ .indexed = 1, \
.channel = _chan, \ .channel = _chan, \
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
.address = _address, \ .address = _address, \
.scan_index = _si, \ .scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)} .scan_type = IIO_ST('s', 24, 32, 0)}
......
...@@ -508,6 +508,7 @@ static int ad7280_channel_init(struct ad7280_state *st) ...@@ -508,6 +508,7 @@ static int ad7280_channel_init(struct ad7280_state *st)
} }
st->channels[cnt].indexed = 1; st->channels[cnt].indexed = 1;
st->channels[cnt].info_mask = st->channels[cnt].info_mask =
IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT; IIO_CHAN_INFO_SCALE_SHARED_BIT;
st->channels[cnt].address = st->channels[cnt].address =
AD7280A_DEVADDR(dev) << 8 | ch; AD7280A_DEVADDR(dev) << 8 | ch;
...@@ -524,7 +525,9 @@ static int ad7280_channel_init(struct ad7280_state *st) ...@@ -524,7 +525,9 @@ static int ad7280_channel_init(struct ad7280_state *st)
st->channels[cnt].channel2 = dev * 6; st->channels[cnt].channel2 = dev * 6;
st->channels[cnt].address = AD7280A_ALL_CELLS; st->channels[cnt].address = AD7280A_ALL_CELLS;
st->channels[cnt].indexed = 1; st->channels[cnt].indexed = 1;
st->channels[cnt].info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT; st->channels[cnt].info_mask =
IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT;
st->channels[cnt].scan_index = cnt; st->channels[cnt].scan_index = cnt;
st->channels[cnt].scan_type.sign = 'u'; st->channels[cnt].scan_type.sign = 'u';
st->channels[cnt].scan_type.realbits = 32; st->channels[cnt].scan_type.realbits = 32;
...@@ -788,7 +791,7 @@ static int ad7280_read_raw(struct iio_dev *indio_dev, ...@@ -788,7 +791,7 @@ static int ad7280_read_raw(struct iio_dev *indio_dev,
int ret; int ret;
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (chan->address == AD7280A_ALL_CELLS) if (chan->address == AD7280A_ALL_CELLS)
ret = ad7280_read_all_channels(st, st->scan_cnt, NULL); ret = ad7280_read_all_channels(st, st->scan_cnt, NULL);
......
...@@ -461,7 +461,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev, ...@@ -461,7 +461,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
s16 signval; s16 signval;
switch (mask) { switch (mask) {
case 0: case IIO_CHAN_INFO_RAW:
switch (chan->type) { switch (chan->type) {
case IIO_VOLTAGE: case IIO_VOLTAGE:
mutex_lock(&chip->state_lock); mutex_lock(&chip->state_lock);
...@@ -536,7 +536,8 @@ static int ad7291_read_raw(struct iio_dev *indio_dev, ...@@ -536,7 +536,8 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
#define AD7291_VOLTAGE_CHAN(_chan) \ #define AD7291_VOLTAGE_CHAN(_chan) \
{ \ { \
.type = IIO_VOLTAGE, \ .type = IIO_VOLTAGE, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.indexed = 1, \ .indexed = 1, \
.channel = _chan, \ .channel = _chan, \
.event_mask = IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING)|\ .event_mask = IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING)|\
...@@ -554,7 +555,8 @@ static const struct iio_chan_spec ad7291_channels[] = { ...@@ -554,7 +555,8 @@ static const struct iio_chan_spec ad7291_channels[] = {
AD7291_VOLTAGE_CHAN(7), AD7291_VOLTAGE_CHAN(7),
{ {
.type = IIO_TEMP, .type = IIO_TEMP,
.info_mask = IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
.type = IIO_VOLTAGE, \ .type = IIO_VOLTAGE, \
.indexed = 1, \ .indexed = 1, \
.channel = index, \ .channel = index, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = index, \ .address = index, \
.scan_index = index, \ .scan_index = index, \
.scan_type = { \ .scan_type = { \
...@@ -42,7 +43,8 @@ static struct iio_chan_spec ad7298_channels[] = { ...@@ -42,7 +43,8 @@ static struct iio_chan_spec ad7298_channels[] = {
.type = IIO_TEMP, .type = IIO_TEMP,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.address = 9, .address = 9,
.scan_index = AD7298_CH_TEMP, .scan_index = AD7298_CH_TEMP,
.scan_type = { .scan_type = {
...@@ -130,7 +132,7 @@ static int ad7298_read_raw(struct iio_dev *indio_dev, ...@@ -130,7 +132,7 @@ static int ad7298_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) { if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) {
ret = -EBUSY; ret = -EBUSY;
......
...@@ -43,7 +43,7 @@ static int ad7476_read_raw(struct iio_dev *indio_dev, ...@@ -43,7 +43,7 @@ static int ad7476_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev)) if (iio_buffer_enabled(indio_dev))
ret = -EBUSY; ret = -EBUSY;
...@@ -70,7 +70,8 @@ static int ad7476_read_raw(struct iio_dev *indio_dev, ...@@ -70,7 +70,8 @@ static int ad7476_read_raw(struct iio_dev *indio_dev,
{ \ { \
.type = IIO_VOLTAGE, \ .type = IIO_VOLTAGE, \
.indexed = 1, \ .indexed = 1, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.scan_type = { \ .scan_type = { \
.sign = 'u', \ .sign = 'u', \
.realbits = bits, \ .realbits = bits, \
......
...@@ -88,7 +88,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, ...@@ -88,7 +88,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev)) if (iio_buffer_enabled(indio_dev))
ret = -EBUSY; ret = -EBUSY;
...@@ -229,14 +229,15 @@ static const struct attribute_group ad7606_attribute_group_range = { ...@@ -229,14 +229,15 @@ static const struct attribute_group ad7606_attribute_group_range = {
.attrs = ad7606_attributes_range, .attrs = ad7606_attributes_range,
}; };
#define AD7606_CHANNEL(num) \ #define AD7606_CHANNEL(num) \
{ \ { \
.type = IIO_VOLTAGE, \ .type = IIO_VOLTAGE, \
.indexed = 1, \ .indexed = 1, \
.channel = num, \ .channel = num, \
.address = num, \ .address = num, \
.scan_index = num, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT, \
.scan_type = IIO_ST('s', 16, 16, 0), \ .scan_index = num, \
.scan_type = IIO_ST('s', 16, 16, 0), \
} }
static struct iio_chan_spec ad7606_8_channels[] = { static struct iio_chan_spec ad7606_8_channels[] = {
......
...@@ -94,7 +94,7 @@ static int ad7780_read_raw(struct iio_dev *indio_dev, ...@@ -94,7 +94,7 @@ static int ad7780_read_raw(struct iio_dev *indio_dev,
unsigned long scale_uv; unsigned long scale_uv;
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
ret = ad7780_read(st, &smpl); ret = ad7780_read(st, &smpl);
mutex_unlock(&indio_dev->mlock); mutex_unlock(&indio_dev->mlock);
...@@ -130,7 +130,8 @@ static const struct ad7780_chip_info ad7780_chip_info_tbl[] = { ...@@ -130,7 +130,8 @@ static const struct ad7780_chip_info ad7780_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_type = { .scan_type = {
.sign = 's', .sign = 's',
.realbits = 24, .realbits = 24,
...@@ -144,7 +145,8 @@ static const struct ad7780_chip_info ad7780_chip_info_tbl[] = { ...@@ -144,7 +145,8 @@ static const struct ad7780_chip_info ad7780_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_type = { .scan_type = {
.sign = 's', .sign = 's',
.realbits = 20, .realbits = 20,
......
...@@ -630,7 +630,7 @@ static int ad7793_read_raw(struct iio_dev *indio_dev, ...@@ -630,7 +630,7 @@ static int ad7793_read_raw(struct iio_dev *indio_dev,
bool unipolar = !!(st->conf & AD7793_CONF_UNIPOLAR); bool unipolar = !!(st->conf & AD7793_CONF_UNIPOLAR);
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev)) if (iio_buffer_enabled(indio_dev))
ret = -EBUSY; ret = -EBUSY;
...@@ -760,7 +760,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -760,7 +760,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 0, .channel = 0,
.channel2 = 0, .channel2 = 0,
.address = AD7793_CH_AIN1P_AIN1M, .address = AD7793_CH_AIN1P_AIN1M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('s', 24, 32, 0) .scan_type = IIO_ST('s', 24, 32, 0)
}, },
...@@ -771,7 +772,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -771,7 +772,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 1, .channel = 1,
.channel2 = 1, .channel2 = 1,
.address = AD7793_CH_AIN2P_AIN2M, .address = AD7793_CH_AIN2P_AIN2M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('s', 24, 32, 0) .scan_type = IIO_ST('s', 24, 32, 0)
}, },
...@@ -782,7 +784,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -782,7 +784,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 2, .channel = 2,
.channel2 = 2, .channel2 = 2,
.address = AD7793_CH_AIN3P_AIN3M, .address = AD7793_CH_AIN3P_AIN3M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('s', 24, 32, 0) .scan_type = IIO_ST('s', 24, 32, 0)
}, },
...@@ -794,7 +797,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -794,7 +797,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 2, .channel = 2,
.channel2 = 2, .channel2 = 2,
.address = AD7793_CH_AIN1M_AIN1M, .address = AD7793_CH_AIN1M_AIN1M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('s', 24, 32, 0) .scan_type = IIO_ST('s', 24, 32, 0)
}, },
...@@ -803,7 +807,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -803,7 +807,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.address = AD7793_CH_TEMP, .address = AD7793_CH_TEMP,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.scan_index = 4, .scan_index = 4,
.scan_type = IIO_ST('s', 24, 32, 0), .scan_type = IIO_ST('s', 24, 32, 0),
}, },
...@@ -813,7 +818,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -813,7 +818,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.indexed = 1, .indexed = 1,
.channel = 4, .channel = 4,
.address = AD7793_CH_AVDD_MONITOR, .address = AD7793_CH_AVDD_MONITOR,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.scan_index = 5, .scan_index = 5,
.scan_type = IIO_ST('s', 24, 32, 0), .scan_type = IIO_ST('s', 24, 32, 0),
}, },
...@@ -827,7 +833,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -827,7 +833,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 0, .channel = 0,
.channel2 = 0, .channel2 = 0,
.address = AD7793_CH_AIN1P_AIN1M, .address = AD7793_CH_AIN1P_AIN1M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('s', 16, 32, 0) .scan_type = IIO_ST('s', 16, 32, 0)
}, },
...@@ -838,7 +845,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -838,7 +845,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 1, .channel = 1,
.channel2 = 1, .channel2 = 1,
.address = AD7793_CH_AIN2P_AIN2M, .address = AD7793_CH_AIN2P_AIN2M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('s', 16, 32, 0) .scan_type = IIO_ST('s', 16, 32, 0)
}, },
...@@ -849,7 +857,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -849,7 +857,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 2, .channel = 2,
.channel2 = 2, .channel2 = 2,
.address = AD7793_CH_AIN3P_AIN3M, .address = AD7793_CH_AIN3P_AIN3M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('s', 16, 32, 0) .scan_type = IIO_ST('s', 16, 32, 0)
}, },
...@@ -861,7 +870,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -861,7 +870,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 2, .channel = 2,
.channel2 = 2, .channel2 = 2,
.address = AD7793_CH_AIN1M_AIN1M, .address = AD7793_CH_AIN1M_AIN1M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('s', 16, 32, 0) .scan_type = IIO_ST('s', 16, 32, 0)
}, },
...@@ -870,7 +880,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -870,7 +880,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.address = AD7793_CH_TEMP, .address = AD7793_CH_TEMP,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.scan_index = 4, .scan_index = 4,
.scan_type = IIO_ST('s', 16, 32, 0), .scan_type = IIO_ST('s', 16, 32, 0),
}, },
...@@ -880,7 +891,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { ...@@ -880,7 +891,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.indexed = 1, .indexed = 1,
.channel = 4, .channel = 4,
.address = AD7793_CH_AVDD_MONITOR, .address = AD7793_CH_AVDD_MONITOR,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.scan_index = 5, .scan_index = 5,
.scan_type = IIO_ST('s', 16, 32, 0), .scan_type = IIO_ST('s', 16, 32, 0),
}, },
......
...@@ -42,7 +42,7 @@ static int ad7887_read_raw(struct iio_dev *indio_dev, ...@@ -42,7 +42,7 @@ static int ad7887_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev)) if (iio_buffer_enabled(indio_dev))
ret = -EBUSY; ret = -EBUSY;
...@@ -75,7 +75,8 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = { ...@@ -75,7 +75,8 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.address = 1, .address = 1,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
...@@ -84,7 +85,8 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = { ...@@ -84,7 +85,8 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.address = 0, .address = 0,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
......
...@@ -148,7 +148,7 @@ static int ad799x_read_raw(struct iio_dev *indio_dev, ...@@ -148,7 +148,7 @@ static int ad799x_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev)) if (iio_buffer_enabled(indio_dev))
ret = -EBUSY; ret = -EBUSY;
...@@ -454,6 +454,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -454,6 +454,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
}, },
...@@ -461,6 +462,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -461,6 +462,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
}, },
...@@ -468,6 +470,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -468,6 +470,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 2, .channel = 2,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
}, },
...@@ -475,6 +478,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -475,6 +478,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 3, .channel = 3,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 3, .scan_index = 3,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
}, },
...@@ -490,6 +494,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -490,6 +494,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
}, },
...@@ -497,6 +502,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -497,6 +502,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
}, },
...@@ -504,6 +510,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -504,6 +510,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 2, .channel = 2,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
}, },
...@@ -511,6 +518,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -511,6 +518,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 3, .channel = 3,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 3, .scan_index = 3,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
}, },
...@@ -526,6 +534,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -526,6 +534,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 8, 16, 4), .scan_type = IIO_ST('u', 8, 16, 4),
}, },
...@@ -533,6 +542,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -533,6 +542,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('u', 8, 16, 4), .scan_type = IIO_ST('u', 8, 16, 4),
}, },
...@@ -540,6 +550,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -540,6 +550,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 2, .channel = 2,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('u', 8, 16, 4), .scan_type = IIO_ST('u', 8, 16, 4),
}, },
...@@ -547,6 +558,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -547,6 +558,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 3, .channel = 3,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 3, .scan_index = 3,
.scan_type = IIO_ST('u', 8, 16, 4), .scan_type = IIO_ST('u', 8, 16, 4),
}, },
...@@ -562,6 +574,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -562,6 +574,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -570,6 +583,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -570,6 +583,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -587,6 +601,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -587,6 +601,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -596,6 +611,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -596,6 +611,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.scan_index = 1, .scan_index = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
}, },
...@@ -603,6 +619,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -603,6 +619,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 2, .channel = 2,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -611,6 +628,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -611,6 +628,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 3, .channel = 3,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 3, .scan_index = 3,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -628,6 +646,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -628,6 +646,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -636,6 +655,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -636,6 +655,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -644,6 +664,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -644,6 +664,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 2, .channel = 2,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -652,6 +673,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -652,6 +673,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 3, .channel = 3,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 3, .scan_index = 3,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -669,6 +691,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -669,6 +691,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -677,6 +700,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -677,6 +700,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -685,6 +709,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -685,6 +709,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 2, .channel = 2,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -693,6 +718,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -693,6 +718,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 3, .channel = 3,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 3, .scan_index = 3,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -701,6 +727,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -701,6 +727,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 4, .channel = 4,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 4, .scan_index = 4,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
}, },
...@@ -708,6 +735,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -708,6 +735,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 5, .channel = 5,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 5, .scan_index = 5,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
}, },
...@@ -715,6 +743,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -715,6 +743,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 6, .channel = 6,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 6, .scan_index = 6,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
}, },
...@@ -722,6 +751,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -722,6 +751,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 7, .channel = 7,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 7, .scan_index = 7,
.scan_type = IIO_ST('u', 10, 16, 2), .scan_type = IIO_ST('u', 10, 16, 2),
}, },
...@@ -738,6 +768,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -738,6 +768,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 0, .scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -746,6 +777,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -746,6 +777,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 1, .scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -754,6 +786,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -754,6 +786,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 2, .channel = 2,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 2, .scan_index = 2,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -762,6 +795,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -762,6 +795,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 3, .channel = 3,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 3, .scan_index = 3,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK, .event_mask = AD799X_EV_MASK,
...@@ -770,6 +804,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -770,6 +804,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 4, .channel = 4,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 4, .scan_index = 4,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
}, },
...@@ -777,6 +812,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -777,6 +812,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 5, .channel = 5,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 5, .scan_index = 5,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
}, },
...@@ -784,6 +820,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -784,6 +820,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 6, .channel = 6,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 6, .scan_index = 6,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
}, },
...@@ -791,6 +828,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -791,6 +828,7 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 7, .channel = 7,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.scan_index = 7, .scan_index = 7,
.scan_type = IIO_ST('u', 12, 16, 0), .scan_type = IIO_ST('u', 12, 16, 0),
}, },
......
...@@ -73,7 +73,7 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev, ...@@ -73,7 +73,7 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev,
{ {
struct lpc32xx_adc_info *info = iio_priv(indio_dev); struct lpc32xx_adc_info *info = iio_priv(indio_dev);
if (mask == 0) { if (mask == IIO_CHAN_INFO_RAW) {
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
clk_enable(info->clk); clk_enable(info->clk);
/* Measurement setup */ /* Measurement setup */
...@@ -98,12 +98,13 @@ static const struct iio_info lpc32xx_adc_iio_info = { ...@@ -98,12 +98,13 @@ static const struct iio_info lpc32xx_adc_iio_info = {
.driver_module = THIS_MODULE, .driver_module = THIS_MODULE,
}; };
#define LPC32XX_ADC_CHANNEL(_index) { \ #define LPC32XX_ADC_CHANNEL(_index) { \
.type = IIO_VOLTAGE, \ .type = IIO_VOLTAGE, \
.indexed = 1, \ .indexed = 1, \
.channel = _index, \ .channel = _index, \
.address = AD_IN * _index, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT, \
.scan_index = _index, \ .address = AD_IN * _index, \
.scan_index = _index, \
} }
static struct iio_chan_spec lpc32xx_adc_iio_channels[] = { static struct iio_chan_spec lpc32xx_adc_iio_channels[] = {
......
...@@ -249,7 +249,7 @@ static int max1363_read_raw(struct iio_dev *indio_dev, ...@@ -249,7 +249,7 @@ static int max1363_read_raw(struct iio_dev *indio_dev,
struct max1363_state *st = iio_priv(indio_dev); struct max1363_state *st = iio_priv(indio_dev);
int ret; int ret;
switch (m) { switch (m) {
case 0: case IIO_CHAN_INFO_RAW:
ret = max1363_read_single_chan(indio_dev, chan, val, m); ret = max1363_read_single_chan(indio_dev, chan, val, m);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -282,7 +282,8 @@ static const enum max1363_modes max1363_mode_list[] = { ...@@ -282,7 +282,8 @@ static const enum max1363_modes max1363_mode_list[] = {
#define MAX1363_EV_M \ #define MAX1363_EV_M \
(IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING) \ (IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING) \
| IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING)) | IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING))
#define MAX1363_INFO_MASK IIO_CHAN_INFO_SCALE_SHARED_BIT #define MAX1363_INFO_MASK (IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT)
#define MAX1363_CHAN_U(num, addr, si, bits, evmask) \ #define MAX1363_CHAN_U(num, addr, si, bits, evmask) \
{ \ { \
.type = IIO_VOLTAGE, \ .type = IIO_VOLTAGE, \
......
...@@ -150,7 +150,7 @@ static int spear_read_raw(struct iio_dev *indio_dev, ...@@ -150,7 +150,7 @@ static int spear_read_raw(struct iio_dev *indio_dev,
u32 status; u32 status;
switch (mask) { switch (mask) {
case 0: case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
status = CHANNEL_NUM(chan->channel) | status = CHANNEL_NUM(chan->channel) |
...@@ -180,7 +180,8 @@ static int spear_read_raw(struct iio_dev *indio_dev, ...@@ -180,7 +180,8 @@ static int spear_read_raw(struct iio_dev *indio_dev,
#define SPEAR_ADC_CHAN(idx) { \ #define SPEAR_ADC_CHAN(idx) { \
.type = IIO_VOLTAGE, \ .type = IIO_VOLTAGE, \
.indexed = 1, \ .indexed = 1, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.channel = idx, \ .channel = idx, \
.scan_type = { \ .scan_type = { \
.sign = 'u', \ .sign = 'u', \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册