staging: iio: light: isl29028: fix correct mask value
authorLaxman Dewangan <ldewangan@nvidia.com>
Mon, 16 Apr 2012 15:57:42 +0000 (21:27 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Apr 2012 23:37:05 +0000 (16:37 -0700)
The mask value in the read_raw/write_raw is absolute
value, not the bit position value.
Fixing this in the implemented function to check value,
not with the bit position value.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/light/isl29028.c

index e705e45bbf630d49f368a50d6a71bc686ca6af1e..4e6ac24d7c798fe3dffd9336e5be29265ef19bbf 100644 (file)
@@ -272,7 +272,7 @@ static int isl29028_write_raw(struct iio_dev *indio_dev,
        mutex_lock(&chip->lock);
        switch (chan->type) {
        case IIO_PROXIMITY:
-               if (mask != IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT) {
+               if (mask != IIO_CHAN_INFO_SAMP_FREQ) {
                        dev_err(chip->dev,
                                "proximity: mask value 0x%08lx not supported\n",
                                mask);
@@ -294,7 +294,7 @@ static int isl29028_write_raw(struct iio_dev *indio_dev,
                break;
 
        case IIO_LIGHT:
-               if (mask != IIO_CHAN_INFO_SCALE_SEPARATE_BIT) {
+               if (mask != IIO_CHAN_INFO_SCALE) {
                        dev_err(chip->dev,
                                "light: mask value 0x%08lx not supported\n",
                                mask);
@@ -349,14 +349,14 @@ static int isl29028_read_raw(struct iio_dev *indio_dev,
                ret = IIO_VAL_INT;
                break;
 
-       case IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT:
+       case IIO_CHAN_INFO_SAMP_FREQ:
                if (chan->type != IIO_PROXIMITY)
                        break;
                *val = chip->prox_sampling;
                ret = IIO_VAL_INT;
                break;
 
-       case IIO_CHAN_INFO_SCALE_SEPARATE_BIT:
+       case IIO_CHAN_INFO_SCALE:
                if (chan->type != IIO_LIGHT)
                        break;
                *val = chip->lux_scale;
This page took 0.025138 seconds and 5 git commands to generate.