From: Jonathan Cameron Date: Sun, 15 Apr 2012 16:41:25 +0000 (+0100) Subject: staging:iio:impedance Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers. X-Git-Tag: firefly_0821_release~3680^2~2823^2~229^2~170 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=967d3fe0dc84ac26380e8c9d916d90e1977a75d8;p=firefly-linux-kernel-4.4.55.git staging:iio:impedance Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers. Precursor to making value read / write attribute optional. Signed-off-by: Jonathan Cameron Acked-by: Lars-Peter Clausen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index 06b9fe29a817..9d5738aa427a 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -114,6 +114,7 @@ static struct iio_chan_spec ad5933_channels[] = { .indexed = 1, .processed_val = 1, .channel = 0, + .info_mask = IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT, .address = AD5933_REG_TEMP_DATA, .scan_type = { .sign = 's', @@ -125,7 +126,8 @@ static struct iio_chan_spec ad5933_channels[] = { .indexed = 1, .channel = 0, .extend_name = "real_raw", - .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, + .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | + IIO_CHAN_INFO_SCALE_SEPARATE_BIT, .address = AD5933_REG_REAL_DATA, .scan_index = 0, .scan_type = { @@ -138,7 +140,8 @@ static struct iio_chan_spec ad5933_channels[] = { .indexed = 1, .channel = 0, .extend_name = "imag_raw", - .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, + .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | + IIO_CHAN_INFO_SCALE_SEPARATE_BIT, .address = AD5933_REG_IMAG_DATA, .scan_index = 1, .scan_type = { @@ -524,7 +527,8 @@ static int ad5933_read_raw(struct iio_dev *indio_dev, mutex_lock(&indio_dev->mlock); switch (m) { - case 0: + case IIO_CHAN_INFO_RAW: + case IIO_CHAN_INFO_PROCESSED: if (iio_buffer_enabled(indio_dev)) { ret = -EBUSY; goto out;