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

staging:iio:cdc Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers.

Precursor to making value read / write attribute optional.
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 967d3fe0
...@@ -104,7 +104,7 @@ static int ad7150_read_raw(struct iio_dev *indio_dev, ...@@ -104,7 +104,7 @@ static int ad7150_read_raw(struct iio_dev *indio_dev,
struct ad7150_chip_info *chip = iio_priv(indio_dev); struct ad7150_chip_info *chip = iio_priv(indio_dev);
switch (mask) { switch (mask) {
case 0: case IIO_CHAN_INFO_RAW:
ret = i2c_smbus_read_word_data(chip->client, ret = i2c_smbus_read_word_data(chip->client,
ad7150_addresses[chan->channel][0]); ad7150_addresses[chan->channel][0]);
if (ret < 0) if (ret < 0)
...@@ -429,7 +429,8 @@ static const struct iio_chan_spec ad7150_channels[] = { ...@@ -429,7 +429,8 @@ static const struct iio_chan_spec ad7150_channels[] = {
.type = IIO_CAPACITANCE, .type = IIO_CAPACITANCE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT,
.event_mask = .event_mask =
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) |
...@@ -441,7 +442,8 @@ static const struct iio_chan_spec ad7150_channels[] = { ...@@ -441,7 +442,8 @@ static const struct iio_chan_spec ad7150_channels[] = {
.type = IIO_CAPACITANCE, .type = IIO_CAPACITANCE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT,
.event_mask = .event_mask =
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) |
......
...@@ -329,7 +329,7 @@ static int ad7152_read_raw(struct iio_dev *indio_dev, ...@@ -329,7 +329,7 @@ static int ad7152_read_raw(struct iio_dev *indio_dev,
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
switch (mask) { switch (mask) {
case 0: case IIO_CHAN_INFO_RAW:
/* First set whether in differential mode */ /* First set whether in differential mode */
regval = chip->setup[chan->channel]; regval = chip->setup[chan->channel];
...@@ -436,7 +436,8 @@ static const struct iio_chan_spec ad7152_channels[] = { ...@@ -436,7 +436,8 @@ static const struct iio_chan_spec ad7152_channels[] = {
.type = IIO_CAPACITANCE, .type = IIO_CAPACITANCE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}, { }, {
...@@ -445,14 +446,16 @@ static const struct iio_chan_spec ad7152_channels[] = { ...@@ -445,14 +446,16 @@ static const struct iio_chan_spec ad7152_channels[] = {
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.channel2 = 2, .channel2 = 2,
.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}, { }, {
.type = IIO_CAPACITANCE, .type = IIO_CAPACITANCE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}, { }, {
...@@ -461,7 +464,8 @@ static const struct iio_chan_spec ad7152_channels[] = { ...@@ -461,7 +464,8 @@ static const struct iio_chan_spec ad7152_channels[] = {
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.channel2 = 3, .channel2 = 3,
.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
} }
......
...@@ -123,7 +123,8 @@ static const struct iio_chan_spec ad7746_channels[] = { ...@@ -123,7 +123,8 @@ static const struct iio_chan_spec ad7746_channels[] = {
.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 = AD7746_REG_VT_DATA_HIGH << 8 | .address = AD7746_REG_VT_DATA_HIGH << 8 |
AD7746_VTSETUP_VTMD_EXT_VIN, AD7746_VTSETUP_VTMD_EXT_VIN,
}, },
...@@ -132,7 +133,8 @@ static const struct iio_chan_spec ad7746_channels[] = { ...@@ -132,7 +133,8 @@ static const struct iio_chan_spec ad7746_channels[] = {
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.extend_name = "supply", .extend_name = "supply",
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.address = AD7746_REG_VT_DATA_HIGH << 8 | .address = AD7746_REG_VT_DATA_HIGH << 8 |
AD7746_VTSETUP_VTMD_VDD_MON, AD7746_VTSETUP_VTMD_VDD_MON,
}, },
...@@ -141,6 +143,7 @@ static const struct iio_chan_spec ad7746_channels[] = { ...@@ -141,6 +143,7 @@ static const struct iio_chan_spec ad7746_channels[] = {
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.processed_val = IIO_PROCESSED, .processed_val = IIO_PROCESSED,
.info_mask = IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT,
.address = AD7746_REG_VT_DATA_HIGH << 8 | .address = AD7746_REG_VT_DATA_HIGH << 8 |
AD7746_VTSETUP_VTMD_INT_TEMP, AD7746_VTSETUP_VTMD_INT_TEMP,
}, },
...@@ -149,6 +152,7 @@ static const struct iio_chan_spec ad7746_channels[] = { ...@@ -149,6 +152,7 @@ static const struct iio_chan_spec ad7746_channels[] = {
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.processed_val = IIO_PROCESSED, .processed_val = IIO_PROCESSED,
.info_mask = IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT,
.address = AD7746_REG_VT_DATA_HIGH << 8 | .address = AD7746_REG_VT_DATA_HIGH << 8 |
AD7746_VTSETUP_VTMD_EXT_TEMP, AD7746_VTSETUP_VTMD_EXT_TEMP,
}, },
...@@ -156,7 +160,8 @@ static const struct iio_chan_spec ad7746_channels[] = { ...@@ -156,7 +160,8 @@ static const struct iio_chan_spec ad7746_channels[] = {
.type = IIO_CAPACITANCE, .type = IIO_CAPACITANCE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT | IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT |
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT, IIO_CHAN_INFO_SCALE_SHARED_BIT,
...@@ -168,7 +173,8 @@ static const struct iio_chan_spec ad7746_channels[] = { ...@@ -168,7 +173,8 @@ static const struct iio_chan_spec ad7746_channels[] = {
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.channel2 = 2, .channel2 = 2,
.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT | IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT |
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT, IIO_CHAN_INFO_SCALE_SHARED_BIT,
...@@ -179,7 +185,8 @@ static const struct iio_chan_spec ad7746_channels[] = { ...@@ -179,7 +185,8 @@ static const struct iio_chan_spec ad7746_channels[] = {
.type = IIO_CAPACITANCE, .type = IIO_CAPACITANCE,
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT | IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT |
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT, IIO_CHAN_INFO_SCALE_SHARED_BIT,
...@@ -192,7 +199,8 @@ static const struct iio_chan_spec ad7746_channels[] = { ...@@ -192,7 +199,8 @@ static const struct iio_chan_spec ad7746_channels[] = {
.indexed = 1, .indexed = 1,
.channel = 1, .channel = 1,
.channel2 = 3, .channel2 = 3,
.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT | IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT |
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT, IIO_CHAN_INFO_SCALE_SHARED_BIT,
...@@ -572,7 +580,8 @@ static int ad7746_read_raw(struct iio_dev *indio_dev, ...@@ -572,7 +580,8 @@ static int ad7746_read_raw(struct iio_dev *indio_dev,
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
switch (mask) { switch (mask) {
case 0: case IIO_CHAN_INFO_RAW:
case IIO_CHAN_INFO_PROCESSED:
ret = ad7746_select_channel(indio_dev, chan); ret = ad7746_select_channel(indio_dev, chan);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
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