staging: iio: adc: palmas: Correct info_mask configuration
Jinyoung Park [Mon, 2 Sep 2013 14:42:51 +0000 (23:42 +0900)]
Correct info_mask configuration.
- Changed info_mask from 0 to IIO_CHAN_INFO_RAW_SEPARATE_BIT.
- Changed info_mask from IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT to
  IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT.

Bug 1356128

Change-Id: I964f3d345a2ac7006610cd1cf06fefe397ae684e
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/270495
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/staging/iio/adc/palmas_gpadc.c

index e7caad9..2d6ee68 100644 (file)
@@ -346,7 +346,7 @@ static int palmas_gpadc_read_raw(struct iio_dev *indio_dev,
                return -EINVAL;
 
        switch (mask) {
-       case 0:
+       case IIO_CHAN_INFO_RAW:
                mutex_lock(&indio_dev->mlock);
                ret = palmas_gpadc_start_convertion(adc, adc_chan);
                if (ret < 0) {
@@ -359,7 +359,7 @@ static int palmas_gpadc_read_raw(struct iio_dev *indio_dev,
                *val = ret;
                mutex_unlock(&indio_dev->mlock);
                return IIO_VAL_INT;
-       case IIO_CHAN_INFO_CALIBSCALE:
+       case IIO_CHAN_INFO_PROCESSED:
                mutex_lock(&indio_dev->mlock);
                ret = palmas_gpadc_get_calibrated_code(adc, adc_chan);
                if (ret < 0) {
@@ -385,7 +385,8 @@ static const struct iio_info palmas_gpadc_iio_info = {
 {                                                                      \
        .datasheet_name = PALMAS_DATASHEET_NAME(chan),                  \
        .type = IIO_VOLTAGE,                                            \
-       .info_mask_separate = 0 | BIT(IIO_CHAN_INFO_CALIBSCALE),        \
+       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |                  \
+                       BIT(IIO_CHAN_INFO_CALIBSCALE),                  \
        .indexed = 1,                                                   \
        .channel = PALMAS_ADC_CH_##chan,                                \
 }