Commit 6835cb6b authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio: unwind the IIO_IN -> IIO_VOLTAGE define

This was originally there to avoid churn during a complex change.
Now everything is stable lets get rid of this as it is missleading
and confusing.
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6519ad6e
...@@ -325,7 +325,7 @@ static int adis16201_read_raw(struct iio_dev *indio_dev, ...@@ -325,7 +325,7 @@ static int adis16201_read_raw(struct iio_dev *indio_dev,
case (1 << IIO_CHAN_INFO_SCALE_SEPARATE): case (1 << IIO_CHAN_INFO_SCALE_SEPARATE):
case (1 << IIO_CHAN_INFO_SCALE_SHARED): case (1 << IIO_CHAN_INFO_SCALE_SHARED):
switch (chan->type) { switch (chan->type) {
case IIO_IN: case IIO_VOLTAGE:
*val = 0; *val = 0;
if (chan->channel == 0) if (chan->channel == 0)
*val2 = 1220; *val2 = 1220;
...@@ -407,7 +407,7 @@ static int adis16201_write_raw(struct iio_dev *indio_dev, ...@@ -407,7 +407,7 @@ static int adis16201_write_raw(struct iio_dev *indio_dev,
} }
static struct iio_chan_spec adis16201_channels[] = { static struct iio_chan_spec adis16201_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, "supply", 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "supply", 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_supply, ADIS16201_SCAN_SUPPLY, in_supply, ADIS16201_SCAN_SUPPLY,
IIO_ST('u', 12, 16, 0), 0), IIO_ST('u', 12, 16, 0), 0),
...@@ -426,7 +426,7 @@ static struct iio_chan_spec adis16201_channels[] = { ...@@ -426,7 +426,7 @@ static struct iio_chan_spec adis16201_channels[] = {
(1 << IIO_CHAN_INFO_CALIBBIAS_SEPARATE), (1 << IIO_CHAN_INFO_CALIBBIAS_SEPARATE),
accel_y, ADIS16201_SCAN_ACC_Y, accel_y, ADIS16201_SCAN_ACC_Y,
IIO_ST('s', 14, 16, 0), 0), IIO_ST('s', 14, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_aux, ADIS16201_SCAN_AUX_ADC, in_aux, ADIS16201_SCAN_AUX_ADC,
IIO_ST('u', 12, 16, 0), 0), IIO_ST('u', 12, 16, 0), 0),
......
...@@ -332,7 +332,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev, ...@@ -332,7 +332,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
case (1 << IIO_CHAN_INFO_SCALE_SEPARATE): case (1 << IIO_CHAN_INFO_SCALE_SEPARATE):
case (1 << IIO_CHAN_INFO_SCALE_SHARED): case (1 << IIO_CHAN_INFO_SCALE_SHARED):
switch (chan->type) { switch (chan->type) {
case IIO_IN: case IIO_VOLTAGE:
*val = 0; *val = 0;
if (chan->channel == 0) if (chan->channel == 0)
*val2 = 1220; *val2 = 1220;
...@@ -373,11 +373,11 @@ static int adis16203_read_raw(struct iio_dev *indio_dev, ...@@ -373,11 +373,11 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
} }
static struct iio_chan_spec adis16203_channels[] = { static struct iio_chan_spec adis16203_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, "supply", 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "supply", 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_supply, ADIS16203_SCAN_SUPPLY, in_supply, ADIS16203_SCAN_SUPPLY,
IIO_ST('u', 12, 16, 0), 0), IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_aux, ADIS16203_SCAN_AUX_ADC, in_aux, ADIS16203_SCAN_AUX_ADC,
IIO_ST('u', 12, 16, 0), 0), IIO_ST('u', 12, 16, 0), 0),
......
...@@ -369,7 +369,7 @@ static int adis16204_read_raw(struct iio_dev *indio_dev, ...@@ -369,7 +369,7 @@ static int adis16204_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT; return IIO_VAL_INT;
case (1 << IIO_CHAN_INFO_SCALE_SEPARATE): case (1 << IIO_CHAN_INFO_SCALE_SEPARATE):
switch (chan->type) { switch (chan->type) {
case IIO_IN: case IIO_VOLTAGE:
*val = 0; *val = 0;
if (chan->channel == 0) if (chan->channel == 0)
*val2 = 1220; *val2 = 1220;
...@@ -445,11 +445,11 @@ static int adis16204_write_raw(struct iio_dev *indio_dev, ...@@ -445,11 +445,11 @@ static int adis16204_write_raw(struct iio_dev *indio_dev,
} }
static struct iio_chan_spec adis16204_channels[] = { static struct iio_chan_spec adis16204_channels[] = {
IIO_CHAN(IIO_IN, 0, 0, 0, "supply", 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 0, 0, "supply", 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_supply, ADIS16204_SCAN_SUPPLY, in_supply, ADIS16204_SCAN_SUPPLY,
IIO_ST('u', 12, 16, 0), 0), IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_aux, ADIS16204_SCAN_AUX_ADC, in_aux, ADIS16204_SCAN_AUX_ADC,
IIO_ST('u', 12, 16, 0), 0), IIO_ST('u', 12, 16, 0), 0),
......
...@@ -358,7 +358,7 @@ static int adis16209_read_raw(struct iio_dev *indio_dev, ...@@ -358,7 +358,7 @@ static int adis16209_read_raw(struct iio_dev *indio_dev,
case (1 << IIO_CHAN_INFO_SCALE_SEPARATE): case (1 << IIO_CHAN_INFO_SCALE_SEPARATE):
case (1 << IIO_CHAN_INFO_SCALE_SHARED): case (1 << IIO_CHAN_INFO_SCALE_SHARED):
switch (chan->type) { switch (chan->type) {
case IIO_IN: case IIO_VOLTAGE:
*val = 0; *val = 0;
if (chan->channel == 0) if (chan->channel == 0)
*val2 = 305180; *val2 = 305180;
...@@ -409,7 +409,7 @@ static int adis16209_read_raw(struct iio_dev *indio_dev, ...@@ -409,7 +409,7 @@ static int adis16209_read_raw(struct iio_dev *indio_dev,
} }
static struct iio_chan_spec adis16209_channels[] = { static struct iio_chan_spec adis16209_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_supply, ADIS16209_SCAN_SUPPLY, in_supply, ADIS16209_SCAN_SUPPLY,
IIO_ST('u', 14, 16, 0), 0), IIO_ST('u', 14, 16, 0), 0),
...@@ -428,7 +428,7 @@ static struct iio_chan_spec adis16209_channels[] = { ...@@ -428,7 +428,7 @@ static struct iio_chan_spec adis16209_channels[] = {
(1 << IIO_CHAN_INFO_CALIBBIAS_SEPARATE), (1 << IIO_CHAN_INFO_CALIBBIAS_SEPARATE),
accel_y, ADIS16209_SCAN_ACC_Y, accel_y, ADIS16209_SCAN_ACC_Y,
IIO_ST('s', 14, 16, 0), 0), IIO_ST('s', 14, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_aux, ADIS16209_SCAN_AUX_ADC, in_aux, ADIS16209_SCAN_AUX_ADC,
IIO_ST('u', 12, 16, 0), 0), IIO_ST('u', 12, 16, 0), 0),
......
...@@ -529,7 +529,7 @@ static int adis16220_read_raw(struct iio_dev *indio_dev, ...@@ -529,7 +529,7 @@ static int adis16220_read_raw(struct iio_dev *indio_dev,
case IIO_ACCEL: case IIO_ACCEL:
*val2 = 1887042; *val2 = 1887042;
return IIO_VAL_INT_PLUS_MICRO; return IIO_VAL_INT_PLUS_MICRO;
case IIO_IN: case IIO_VOLTAGE:
if (chan->channel == 0) if (chan->channel == 0)
*val2 = 0012221; *val2 = 0012221;
else /* Should really be dependent on VDD */ else /* Should really be dependent on VDD */
...@@ -571,7 +571,7 @@ static int adis16220_read_raw(struct iio_dev *indio_dev, ...@@ -571,7 +571,7 @@ static int adis16220_read_raw(struct iio_dev *indio_dev,
static const struct iio_chan_spec adis16220_channels[] = { static const struct iio_chan_spec adis16220_channels[] = {
{ {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.extend_name = "supply", .extend_name = "supply",
...@@ -591,14 +591,14 @@ static const struct iio_chan_spec adis16220_channels[] = { ...@@ -591,14 +591,14 @@ static const struct iio_chan_spec adis16220_channels[] = {
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
.address = temp, .address = temp,
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = (1 << IIO_CHAN_INFO_OFFSET_SEPARATE) | .info_mask = (1 << IIO_CHAN_INFO_OFFSET_SEPARATE) |
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
.address = in_1, .address = in_1,
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 2, .channel = 2,
.address = in_2, .address = in_2,
......
...@@ -392,7 +392,7 @@ static int adis16240_read_raw(struct iio_dev *indio_dev, ...@@ -392,7 +392,7 @@ static int adis16240_read_raw(struct iio_dev *indio_dev,
case (1 << IIO_CHAN_INFO_SCALE_SEPARATE): case (1 << IIO_CHAN_INFO_SCALE_SEPARATE):
case (1 << IIO_CHAN_INFO_SCALE_SHARED): case (1 << IIO_CHAN_INFO_SCALE_SHARED):
switch (chan->type) { switch (chan->type) {
case IIO_IN: case IIO_VOLTAGE:
*val = 0; *val = 0;
if (chan->channel == 0) if (chan->channel == 0)
*val2 = 4880; *val2 = 4880;
...@@ -469,11 +469,11 @@ static int adis16240_write_raw(struct iio_dev *indio_dev, ...@@ -469,11 +469,11 @@ static int adis16240_write_raw(struct iio_dev *indio_dev,
} }
static struct iio_chan_spec adis16240_channels[] = { static struct iio_chan_spec adis16240_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, "supply", 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "supply", 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
in_supply, ADIS16240_SCAN_SUPPLY, in_supply, ADIS16240_SCAN_SUPPLY,
IIO_ST('u', 10, 16, 0), 0), IIO_ST('u', 10, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
0, 0,
in_aux, ADIS16240_SCAN_AUX_ADC, in_aux, ADIS16240_SCAN_AUX_ADC,
IIO_ST('u', 10, 16, 0), 0), IIO_ST('u', 10, 16, 0), 0),
......
...@@ -188,7 +188,7 @@ static int kxsd9_read_raw(struct iio_dev *indio_dev, ...@@ -188,7 +188,7 @@ static int kxsd9_read_raw(struct iio_dev *indio_dev,
static struct iio_chan_spec kxsd9_channels[] = { static struct iio_chan_spec kxsd9_channels[] = {
KXSD9_ACCEL_CHAN(X), KXSD9_ACCEL_CHAN(Y), KXSD9_ACCEL_CHAN(Z), KXSD9_ACCEL_CHAN(X), KXSD9_ACCEL_CHAN(Y), KXSD9_ACCEL_CHAN(Z),
{ {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.address = KXSD9_REG_AUX, .address = KXSD9_REG_AUX,
} }
......
...@@ -473,7 +473,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private) ...@@ -473,7 +473,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private)
if ((int_status & AD7150_STATUS_OUT1) && if ((int_status & AD7150_STATUS_OUT1) &&
!(chip->old_state & AD7150_STATUS_OUT1)) !(chip->old_state & AD7150_STATUS_OUT1))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
0, 0,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING), IIO_EV_DIR_RISING),
...@@ -481,7 +481,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private) ...@@ -481,7 +481,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private)
else if ((!(int_status & AD7150_STATUS_OUT1)) && else if ((!(int_status & AD7150_STATUS_OUT1)) &&
(chip->old_state & AD7150_STATUS_OUT1)) (chip->old_state & AD7150_STATUS_OUT1))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
0, 0,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING), IIO_EV_DIR_FALLING),
...@@ -490,7 +490,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private) ...@@ -490,7 +490,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private)
if ((int_status & AD7150_STATUS_OUT2) && if ((int_status & AD7150_STATUS_OUT2) &&
!(chip->old_state & AD7150_STATUS_OUT2)) !(chip->old_state & AD7150_STATUS_OUT2))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
1, 1,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING), IIO_EV_DIR_RISING),
...@@ -498,7 +498,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private) ...@@ -498,7 +498,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private)
else if ((!(int_status & AD7150_STATUS_OUT2)) && else if ((!(int_status & AD7150_STATUS_OUT2)) &&
(chip->old_state & AD7150_STATUS_OUT2)) (chip->old_state & AD7150_STATUS_OUT2))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
1, 1,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING), IIO_EV_DIR_FALLING),
......
...@@ -192,14 +192,14 @@ static irqreturn_t ad7291_event_handler(int irq, void *private) ...@@ -192,14 +192,14 @@ static irqreturn_t ad7291_event_handler(int irq, void *private)
for (i = 0; i < AD7291_VOLTAGE_LIMIT_COUNT*2; i += 2) { for (i = 0; i < AD7291_VOLTAGE_LIMIT_COUNT*2; i += 2) {
if (v_status & (1 << i)) if (v_status & (1 << i))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
i/2, i/2,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING), IIO_EV_DIR_FALLING),
timestamp); timestamp);
if (v_status & (1 << (i + 1))) if (v_status & (1 << (i + 1)))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
i/2, i/2,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING), IIO_EV_DIR_RISING),
......
...@@ -26,28 +26,28 @@ static struct iio_chan_spec ad7298_channels[] = { ...@@ -26,28 +26,28 @@ static struct iio_chan_spec ad7298_channels[] = {
IIO_CHAN(IIO_TEMP, 0, 1, 0, NULL, 0, 0, IIO_CHAN(IIO_TEMP, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
9, AD7298_CH_TEMP, IIO_ST('s', 32, 32, 0), 0), 9, AD7298_CH_TEMP, IIO_ST('s', 32, 32, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 12, 16, 0), 0), 1, 1, IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('u', 12, 16, 0), 0), 2, 2, IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('u', 12, 16, 0), 0), 3, 3, IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 4, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 4, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
4, 4, IIO_ST('u', 12, 16, 0), 0), 4, 4, IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 5, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 5, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
5, 5, IIO_ST('u', 12, 16, 0), 0), 5, 5, IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 6, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 6, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
6, 6, IIO_ST('u', 12, 16, 0), 0), 6, 6, IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 7, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 7, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
7, 7, IIO_ST('u', 12, 16, 0), 0), 7, 7, IIO_ST('u', 12, 16, 0), 0),
IIO_CHAN_SOFT_TIMESTAMP(8), IIO_CHAN_SOFT_TIMESTAMP(8),
......
...@@ -68,49 +68,49 @@ static int ad7476_read_raw(struct iio_dev *dev_info, ...@@ -68,49 +68,49 @@ static int ad7476_read_raw(struct iio_dev *dev_info,
static const struct ad7476_chip_info ad7476_chip_info_tbl[] = { static const struct ad7476_chip_info ad7476_chip_info_tbl[] = {
[ID_AD7466] = { [ID_AD7466] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
}, },
[ID_AD7467] = { [ID_AD7467] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 10, 16, 2), 0), 0, 0, IIO_ST('u', 10, 16, 2), 0),
.channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
}, },
[ID_AD7468] = { [ID_AD7468] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1 , 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1 , 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 8, 16, 4), 0), 0, 0, IIO_ST('u', 8, 16, 4), 0),
.channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
}, },
[ID_AD7475] = { [ID_AD7475] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
}, },
[ID_AD7476] = { [ID_AD7476] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
}, },
[ID_AD7477] = { [ID_AD7477] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 10, 16, 2), 0), 0, 0, IIO_ST('u', 10, 16, 2), 0),
.channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
}, },
[ID_AD7478] = { [ID_AD7478] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 8, 16, 4), 0), 0, 0, IIO_ST('u', 8, 16, 4), 0),
.channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
}, },
[ID_AD7495] = { [ID_AD7495] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1), .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
......
...@@ -234,66 +234,66 @@ static const struct attribute_group ad7606_attribute_group = { ...@@ -234,66 +234,66 @@ static const struct attribute_group ad7606_attribute_group = {
}; };
static struct iio_chan_spec ad7606_8_channels[] = { static struct iio_chan_spec ad7606_8_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('s', 16, 16, 0), 0), 0, 0, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('s', 16, 16, 0), 0), 1, 1, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('s', 16, 16, 0), 0), 2, 2, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('s', 16, 16, 0), 0), 3, 3, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 4, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 4, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
4, 4, IIO_ST('s', 16, 16, 0), 0), 4, 4, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 5, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 5, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
5, 5, IIO_ST('s', 16, 16, 0), 0), 5, 5, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 6, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 6, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
6, 6, IIO_ST('s', 16, 16, 0), 0), 6, 6, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 7, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 7, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
7, 7, IIO_ST('s', 16, 16, 0), 0), 7, 7, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN_SOFT_TIMESTAMP(8), IIO_CHAN_SOFT_TIMESTAMP(8),
}; };
static struct iio_chan_spec ad7606_6_channels[] = { static struct iio_chan_spec ad7606_6_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('s', 16, 16, 0), 0), 0, 0, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('s', 16, 16, 0), 0), 1, 1, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('s', 16, 16, 0), 0), 2, 2, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('s', 16, 16, 0), 0), 3, 3, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 4, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 4, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
4, 4, IIO_ST('s', 16, 16, 0), 0), 4, 4, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 5, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 5, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
5, 5, IIO_ST('s', 16, 16, 0), 0), 5, 5, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN_SOFT_TIMESTAMP(6), IIO_CHAN_SOFT_TIMESTAMP(6),
}; };
static struct iio_chan_spec ad7606_4_channels[] = { static struct iio_chan_spec ad7606_4_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('s', 16, 16, 0), 0), 0, 0, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('s', 16, 16, 0), 0), 1, 1, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('s', 16, 16, 0), 0), 2, 2, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('s', 16, 16, 0), 0), 3, 3, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN_SOFT_TIMESTAMP(4), IIO_CHAN_SOFT_TIMESTAMP(4),
......
...@@ -126,12 +126,12 @@ static int ad7780_read_raw(struct iio_dev *indio_dev, ...@@ -126,12 +126,12 @@ static int ad7780_read_raw(struct iio_dev *indio_dev,
static const struct ad7780_chip_info ad7780_chip_info_tbl[] = { static const struct ad7780_chip_info ad7780_chip_info_tbl[] = {
[ID_AD7780] = { [ID_AD7780] = {
.channel = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('s', 24, 32, 8), 0), 0, 0, IIO_ST('s', 24, 32, 8), 0),
}, },
[ID_AD7781] = { [ID_AD7781] = {
.channel = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('s', 20, 32, 12), 0), 0, 0, IIO_ST('s', 20, 32, 12), 0),
}, },
......
...@@ -674,7 +674,7 @@ static int ad7793_read_raw(struct iio_dev *indio_dev, ...@@ -674,7 +674,7 @@ static int ad7793_read_raw(struct iio_dev *indio_dev,
case (1 << IIO_CHAN_INFO_SCALE_SEPARATE): case (1 << IIO_CHAN_INFO_SCALE_SEPARATE):
switch (chan->type) { switch (chan->type) {
case IIO_IN: case IIO_VOLTAGE:
/* 1170mV / 2^23 * 6 */ /* 1170mV / 2^23 * 6 */
scale_uv = (1170ULL * 100000000ULL * 6ULL) scale_uv = (1170ULL * 100000000ULL * 6ULL)
>> (chan->scan_type.realbits - >> (chan->scan_type.realbits -
......
...@@ -71,11 +71,11 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = { ...@@ -71,11 +71,11 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
* More devices added in future * More devices added in future
*/ */
[ID_AD7887] = { [ID_AD7887] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 12, 16, 0), 0), 1, 1, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
......
...@@ -336,11 +336,11 @@ static irqreturn_t ad799x_event_handler(int irq, void *private) ...@@ -336,11 +336,11 @@ static irqreturn_t ad799x_event_handler(int irq, void *private)
if (status & (1 << i)) if (status & (1 << i))
iio_push_event(indio_dev, iio_push_event(indio_dev,
i & 0x1 ? i & 0x1 ?
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
(i >> 1), (i >> 1),
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING) : IIO_EV_DIR_RISING) :
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
(i >> 1), (i >> 1),
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING), IIO_EV_DIR_FALLING),
...@@ -486,16 +486,16 @@ static const struct iio_info ad7993_4_7_8_info = { ...@@ -486,16 +486,16 @@ static const struct iio_info ad7993_4_7_8_info = {
static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
[ad7991] = { [ad7991] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 12, 16, 0), 0), 1, 1, IIO_ST('u', 12, 16, 0), 0),
.channel[2] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, .channel[2] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('u', 12, 16, 0), 0), 2, 2, IIO_ST('u', 12, 16, 0), 0),
.channel[3] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, .channel[3] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('u', 12, 16, 0), 0), 3, 3, IIO_ST('u', 12, 16, 0), 0),
.channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4), .channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
...@@ -504,16 +504,16 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -504,16 +504,16 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.info = &ad7991_info, .info = &ad7991_info,
}, },
[ad7995] = { [ad7995] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 10, 16, 0), 0), 0, 0, IIO_ST('u', 10, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 10, 16, 0), 0), 1, 1, IIO_ST('u', 10, 16, 0), 0),
.channel[2] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, .channel[2] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('u', 10, 16, 0), 0), 2, 2, IIO_ST('u', 10, 16, 0), 0),
.channel[3] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, .channel[3] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('u', 10, 16, 0), 0), 3, 3, IIO_ST('u', 10, 16, 0), 0),
.channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4), .channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
...@@ -522,16 +522,16 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -522,16 +522,16 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.info = &ad7991_info, .info = &ad7991_info,
}, },
[ad7999] = { [ad7999] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 10, 16, 0), 0), 0, 0, IIO_ST('u', 10, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 10, 16, 0), 0), 1, 1, IIO_ST('u', 10, 16, 0), 0),
.channel[2] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, .channel[2] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('u', 10, 16, 0), 0), 2, 2, IIO_ST('u', 10, 16, 0), 0),
.channel[3] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, .channel[3] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('u', 10, 16, 0), 0), 3, 3, IIO_ST('u', 10, 16, 0), 0),
.channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4), .channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
...@@ -540,10 +540,10 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -540,10 +540,10 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.info = &ad7991_info, .info = &ad7991_info,
}, },
[ad7992] = { [ad7992] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 12, 16, 0), 0), 1, 1, IIO_ST('u', 12, 16, 0), 0),
.channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2), .channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2),
...@@ -553,16 +553,16 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -553,16 +553,16 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.info = &ad7992_info, .info = &ad7992_info,
}, },
[ad7993] = { [ad7993] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 10, 16, 0), 0), 0, 0, IIO_ST('u', 10, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 10, 16, 0), 0), 1, 1, IIO_ST('u', 10, 16, 0), 0),
.channel[2] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, .channel[2] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('u', 10, 16, 0), 0), 2, 2, IIO_ST('u', 10, 16, 0), 0),
.channel[3] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, .channel[3] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('u', 10, 16, 0), 0), 3, 3, IIO_ST('u', 10, 16, 0), 0),
.channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4), .channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
...@@ -572,16 +572,16 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -572,16 +572,16 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.info = &ad7993_4_7_8_info, .info = &ad7993_4_7_8_info,
}, },
[ad7994] = { [ad7994] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 12, 16, 0), 0), 1, 1, IIO_ST('u', 12, 16, 0), 0),
.channel[2] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, .channel[2] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('u', 12, 16, 0), 0), 2, 2, IIO_ST('u', 12, 16, 0), 0),
.channel[3] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, .channel[3] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('u', 12, 16, 0), 0), 3, 3, IIO_ST('u', 12, 16, 0), 0),
.channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4), .channel[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
...@@ -591,28 +591,28 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -591,28 +591,28 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.info = &ad7993_4_7_8_info, .info = &ad7993_4_7_8_info,
}, },
[ad7997] = { [ad7997] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 10, 16, 0), 0), 0, 0, IIO_ST('u', 10, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 10, 16, 0), 0), 1, 1, IIO_ST('u', 10, 16, 0), 0),
.channel[2] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, .channel[2] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('u', 10, 16, 0), 0), 2, 2, IIO_ST('u', 10, 16, 0), 0),
.channel[3] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, .channel[3] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('u', 10, 16, 0), 0), 3, 3, IIO_ST('u', 10, 16, 0), 0),
.channel[4] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 4, 0, .channel[4] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 4, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
4, 4, IIO_ST('u', 10, 16, 0), 0), 4, 4, IIO_ST('u', 10, 16, 0), 0),
.channel[5] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 5, 0, .channel[5] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 5, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
5, 5, IIO_ST('u', 10, 16, 0), 0), 5, 5, IIO_ST('u', 10, 16, 0), 0),
.channel[6] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 6, 0, .channel[6] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 6, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
6, 6, IIO_ST('u', 10, 16, 0), 0), 6, 6, IIO_ST('u', 10, 16, 0), 0),
.channel[7] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 7, 0, .channel[7] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 7, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
7, 7, IIO_ST('u', 10, 16, 0), 0), 7, 7, IIO_ST('u', 10, 16, 0), 0),
.channel[8] = IIO_CHAN_SOFT_TIMESTAMP(8), .channel[8] = IIO_CHAN_SOFT_TIMESTAMP(8),
...@@ -622,28 +622,28 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = { ...@@ -622,28 +622,28 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.info = &ad7993_4_7_8_info, .info = &ad7993_4_7_8_info,
}, },
[ad7998] = { [ad7998] = {
.channel[0] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0, .channel[0] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
0, 0, IIO_ST('u', 12, 16, 0), 0), 0, 0, IIO_ST('u', 12, 16, 0), 0),
.channel[1] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, .channel[1] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
1, 1, IIO_ST('u', 12, 16, 0), 0), 1, 1, IIO_ST('u', 12, 16, 0), 0),
.channel[2] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0, .channel[2] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
2, 2, IIO_ST('u', 12, 16, 0), 0), 2, 2, IIO_ST('u', 12, 16, 0), 0),
.channel[3] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0, .channel[3] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
3, 3, IIO_ST('u', 12, 16, 0), 0), 3, 3, IIO_ST('u', 12, 16, 0), 0),
.channel[4] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 4, 0, .channel[4] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 4, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
4, 4, IIO_ST('u', 12, 16, 0), 0), 4, 4, IIO_ST('u', 12, 16, 0), 0),
.channel[5] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 5, 0, .channel[5] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 5, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
5, 5, IIO_ST('u', 12, 16, 0), 0), 5, 5, IIO_ST('u', 12, 16, 0), 0),
.channel[6] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 6, 0, .channel[6] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 6, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
6, 6, IIO_ST('u', 12, 16, 0), 0), 6, 6, IIO_ST('u', 12, 16, 0), 0),
.channel[7] = IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 7, 0, .channel[7] = IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 7, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
7, 7, IIO_ST('u', 12, 16, 0), 0), 7, 7, IIO_ST('u', 12, 16, 0), 0),
.channel[8] = IIO_CHAN_SOFT_TIMESTAMP(8), .channel[8] = IIO_CHAN_SOFT_TIMESTAMP(8),
......
...@@ -574,14 +574,22 @@ static int max1363_write_thresh(struct iio_dev *indio_dev, ...@@ -574,14 +574,22 @@ static int max1363_write_thresh(struct iio_dev *indio_dev,
} }
static const u64 max1363_event_codes[] = { static const u64 max1363_event_codes[] = {
IIO_UNMOD_EVENT_CODE(IIO_IN, 0, IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING), IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 0,
IIO_UNMOD_EVENT_CODE(IIO_IN, 1, IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING), IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING),
IIO_UNMOD_EVENT_CODE(IIO_IN, 2, IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING), IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 1,
IIO_UNMOD_EVENT_CODE(IIO_IN, 3, IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING), IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING),
IIO_UNMOD_EVENT_CODE(IIO_IN, 0, IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING), IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 2,
IIO_UNMOD_EVENT_CODE(IIO_IN, 1, IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING), IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING),
IIO_UNMOD_EVENT_CODE(IIO_IN, 2, IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING), IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 3,
IIO_UNMOD_EVENT_CODE(IIO_IN, 3, IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING), IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING),
IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 0,
IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING),
IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 1,
IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING),
IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 2,
IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING),
IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 3,
IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING),
}; };
static irqreturn_t max1363_event_handler(int irq, void *private) static irqreturn_t max1363_event_handler(int irq, void *private)
......
...@@ -1802,19 +1802,19 @@ static irqreturn_t adt7316_event_handler(int irq, void *private) ...@@ -1802,19 +1802,19 @@ static irqreturn_t adt7316_event_handler(int irq, void *private)
time); time);
if (stat1 & (1 << 5)) if (stat1 & (1 << 5))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, 1, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 1,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_EITHER), IIO_EV_DIR_EITHER),
time); time);
if (stat1 & (1 << 6)) if (stat1 & (1 << 6))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, 2, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 2,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_EITHER), IIO_EV_DIR_EITHER),
time); time);
if (stat1 & (1 << 7)) if (stat1 & (1 << 7))
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, 3, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 3,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_EITHER), IIO_EV_DIR_EITHER),
time); time);
...@@ -1823,7 +1823,7 @@ static irqreturn_t adt7316_event_handler(int irq, void *private) ...@@ -1823,7 +1823,7 @@ static irqreturn_t adt7316_event_handler(int irq, void *private)
if (!ret) { if (!ret) {
if (stat2 & ADT7316_INT_MASK2_VDD) if (stat2 & ADT7316_INT_MASK2_VDD)
iio_push_event(indio_dev, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN, IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
0, 0,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING), IIO_EV_DIR_RISING),
......
...@@ -122,12 +122,12 @@ static const struct iio_chan_spec adis16060_channels[] = { ...@@ -122,12 +122,12 @@ static const struct iio_chan_spec adis16060_channels[] = {
.channel2 = IIO_MOD_Z, .channel2 = IIO_MOD_Z,
.address = ADIS16060_GYRO, .address = ADIS16060_GYRO,
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.address = ADIS16060_AIN1, .address = ADIS16060_AIN1,
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.address = ADIS16060_AIN2, .address = ADIS16060_AIN2,
......
...@@ -113,12 +113,12 @@ static const struct iio_chan_spec adis16080_channels[] = { ...@@ -113,12 +113,12 @@ static const struct iio_chan_spec adis16080_channels[] = {
.channel2 = IIO_MOD_Z, .channel2 = IIO_MOD_Z,
.address = ADIS16080_DIN_GYRO, .address = ADIS16080_DIN_GYRO,
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.address = ADIS16080_DIN_AIN1, .address = ADIS16080_DIN_AIN1,
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.address = ADIS16080_DIN_AIN2, .address = ADIS16080_DIN_AIN2,
......
...@@ -405,11 +405,11 @@ enum adis16260_channel { ...@@ -405,11 +405,11 @@ enum adis16260_channel {
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), \ (1 << IIO_CHAN_INFO_SCALE_SEPARATE), \
temp, ADIS16260_SCAN_TEMP, \ temp, ADIS16260_SCAN_TEMP, \
IIO_ST('u', 12, 16, 0), 0), \ IIO_ST('u', 12, 16, 0), 0), \
IIO_CHAN(IIO_IN, 0, 1, 0, "supply", 0, 0, \ IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "supply", 0, 0, \
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), \ (1 << IIO_CHAN_INFO_SCALE_SEPARATE), \
in_supply, ADIS16260_SCAN_SUPPLY, \ in_supply, ADIS16260_SCAN_SUPPLY, \
IIO_ST('u', 12, 16, 0), 0), \ IIO_ST('u', 12, 16, 0), 0), \
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0, \ IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0, \
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), \ (1 << IIO_CHAN_INFO_SCALE_SEPARATE), \
in_aux, ADIS16260_SCAN_AUX_ADC, \ in_aux, ADIS16260_SCAN_AUX_ADC, \
IIO_ST('u', 12, 16, 0), 0), \ IIO_ST('u', 12, 16, 0), 0), \
...@@ -475,7 +475,7 @@ static int adis16260_read_raw(struct iio_dev *indio_dev, ...@@ -475,7 +475,7 @@ static int adis16260_read_raw(struct iio_dev *indio_dev,
else else
*val2 = 1278; *val2 = 1278;
return IIO_VAL_INT_PLUS_MICRO; return IIO_VAL_INT_PLUS_MICRO;
case IIO_IN: case IIO_VOLTAGE:
*val = 0; *val = 0;
if (chan->channel == 0) if (chan->channel == 0)
*val2 = 18315; *val2 = 18315;
......
...@@ -44,10 +44,6 @@ enum iio_chan_type { ...@@ -44,10 +44,6 @@ enum iio_chan_type {
IIO_CAPACITANCE, IIO_CAPACITANCE,
}; };
/* Nasty hack to avoid massive churn */
#define IIO_IN IIO_VOLTAGE
#define IIO_IN_DIFF IIO_VOLTAGE_DIFF
enum iio_modifier { enum iio_modifier {
IIO_NO_MOD, IIO_NO_MOD,
IIO_MOD_X, IIO_MOD_X,
......
...@@ -111,10 +111,10 @@ static struct iio_chan_spec ad5933_channels[] = { ...@@ -111,10 +111,10 @@ static struct iio_chan_spec ad5933_channels[] = {
IIO_CHAN(IIO_TEMP, 0, 1, 1, NULL, 0, 0, 0, IIO_CHAN(IIO_TEMP, 0, 1, 1, NULL, 0, 0, 0,
0, AD5933_REG_TEMP_DATA, IIO_ST('s', 14, 16, 0), 0), 0, AD5933_REG_TEMP_DATA, IIO_ST('s', 14, 16, 0), 0),
/* Ring Channels */ /* Ring Channels */
IIO_CHAN(IIO_IN, 0, 1, 0, "real_raw", 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "real_raw", 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
AD5933_REG_REAL_DATA, 0, IIO_ST('s', 16, 16, 0), 0), AD5933_REG_REAL_DATA, 0, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, "imag_raw", 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "imag_raw", 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SEPARATE), (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
AD5933_REG_IMAG_DATA, 1, IIO_ST('s', 16, 16, 0), 0), AD5933_REG_IMAG_DATA, 1, IIO_ST('s', 16, 16, 0), 0),
}; };
......
...@@ -511,7 +511,7 @@ static int adis16400_read_raw(struct iio_dev *indio_dev, ...@@ -511,7 +511,7 @@ static int adis16400_read_raw(struct iio_dev *indio_dev,
*val = 0; *val = 0;
*val2 = st->variant->gyro_scale_micro; *val2 = st->variant->gyro_scale_micro;
return IIO_VAL_INT_PLUS_MICRO; return IIO_VAL_INT_PLUS_MICRO;
case IIO_IN: case IIO_VOLTAGE:
*val = 0; *val = 0;
if (chan->channel == 0) if (chan->channel == 0)
*val2 = 2418; *val2 = 2418;
...@@ -652,7 +652,7 @@ static struct iio_chan_spec adis16400_channels[] = { ...@@ -652,7 +652,7 @@ static struct iio_chan_spec adis16400_channels[] = {
.scan_index = ADIS16400_SCAN_TEMP, .scan_index = ADIS16400_SCAN_TEMP,
.scan_type = IIO_ST('s', 12, 16, 0), .scan_type = IIO_ST('s', 12, 16, 0),
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = (1 << IIO_CHAN_INFO_SCALE_SEPARATE), .info_mask = (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
...@@ -758,7 +758,7 @@ static struct iio_chan_spec adis16350_channels[] = { ...@@ -758,7 +758,7 @@ static struct iio_chan_spec adis16350_channels[] = {
.scan_index = ADIS16350_SCAN_TEMP_Z, .scan_index = ADIS16350_SCAN_TEMP_Z,
.scan_type = IIO_ST('s', 12, 16, 0), .scan_type = IIO_ST('s', 12, 16, 0),
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = (1 << IIO_CHAN_INFO_SCALE_SEPARATE), .info_mask = (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
...@@ -825,7 +825,7 @@ static struct iio_chan_spec adis16300_channels[] = { ...@@ -825,7 +825,7 @@ static struct iio_chan_spec adis16300_channels[] = {
.scan_index = ADIS16400_SCAN_TEMP, .scan_index = ADIS16400_SCAN_TEMP,
.scan_type = IIO_ST('s', 12, 16, 0), .scan_type = IIO_ST('s', 12, 16, 0),
}, { }, {
.type = IIO_IN, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = (1 << IIO_CHAN_INFO_SCALE_SEPARATE), .info_mask = (1 << IIO_CHAN_INFO_SCALE_SEPARATE),
......
...@@ -663,7 +663,7 @@ static const struct attribute_group ade7758_attribute_group = { ...@@ -663,7 +663,7 @@ static const struct attribute_group ade7758_attribute_group = {
}; };
static struct iio_chan_spec ade7758_channels[] = { static struct iio_chan_spec ade7758_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, "raw", 0, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "raw", 0, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
AD7758_WT(AD7758_PHASE_A, AD7758_VOLTAGE), AD7758_WT(AD7758_PHASE_A, AD7758_VOLTAGE),
0, IIO_ST('s', 24, 32, 0), 0), 0, IIO_ST('s', 24, 32, 0), 0),
...@@ -683,7 +683,7 @@ static struct iio_chan_spec ade7758_channels[] = { ...@@ -683,7 +683,7 @@ static struct iio_chan_spec ade7758_channels[] = {
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
AD7758_WT(AD7758_PHASE_A, AD7758_REACT_PWR), AD7758_WT(AD7758_PHASE_A, AD7758_REACT_PWR),
4, IIO_ST('s', 24, 32, 0), 0), 4, IIO_ST('s', 24, 32, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, "raw", 1, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "raw", 1, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
AD7758_WT(AD7758_PHASE_B, AD7758_VOLTAGE), AD7758_WT(AD7758_PHASE_B, AD7758_VOLTAGE),
5, IIO_ST('s', 24, 32, 0), 0), 5, IIO_ST('s', 24, 32, 0), 0),
...@@ -703,7 +703,7 @@ static struct iio_chan_spec ade7758_channels[] = { ...@@ -703,7 +703,7 @@ static struct iio_chan_spec ade7758_channels[] = {
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
AD7758_WT(AD7758_PHASE_B, AD7758_REACT_PWR), AD7758_WT(AD7758_PHASE_B, AD7758_REACT_PWR),
9, IIO_ST('s', 24, 32, 0), 0), 9, IIO_ST('s', 24, 32, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, "raw", 2, 0, IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, "raw", 2, 0,
(1 << IIO_CHAN_INFO_SCALE_SHARED), (1 << IIO_CHAN_INFO_SCALE_SHARED),
AD7758_WT(AD7758_PHASE_C, AD7758_VOLTAGE), AD7758_WT(AD7758_PHASE_C, AD7758_VOLTAGE),
10, IIO_ST('s', 24, 32, 0), 0), 10, IIO_ST('s', 24, 32, 0), 0),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment