staging: iio: light: isl29028: fix correct mask value
Subsystems (3)
PATCH 1/1 staging: iio: light: isl29028: fix correct mask value
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.
---
Somehow this was missed on my testing.
I tested today again with linux next and found this issue.
drivers/staging/iio/light/isl29028.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/iio/light/isl29028.c +4 -4
@@ -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;
Signature · 1 line
1.7.1.1
Quoted 4 lines · Laxman Dewangan
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.
Oops I should have caught that.
Sorry
Quoted 2 lines
Signed-off-by Laxman Dewangan <[email protected]>
Quoted 57 lines
---
Somehow this was missed on my testing.
I tested today again with linux next and found this issue.
drivers/staging/iio/light/isl29028.c| 8 ++++----1 files changed, 4 insertions(+), 4 deletions(-)drivers/staging/iio/light/isl29028.c +1
-1@@ -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);drivers/staging/iio/light/isl29028.c +1
-1@@ -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);drivers/staging/iio/light/isl29028.c +2
-2@@ -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;Signature · 6 lines
1.7.1.1 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Greg KH
maintainerQuoted 8 lines · Jonathan Cameron
Quoted 4 lines · Laxman Dewangan
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.
Quoted 5 lines
Oops I should have caught that.
SorryQuoted 2 lines
Signed-off-by Laxman Dewangan <[email protected]>Acked-by <[email protected]>
You need to put your name here, not just an email address :)