summaryrefslogtreecommitdiffstats
path: root/drivers/iio/light
diff options
context:
space:
mode:
authorMikko Koivunen <mikko.koivunen@fi.rohmeurope.com>2017-05-18 15:12:49 +0300
committerJonathan Cameron <jic23@kernel.org>2017-05-21 15:06:10 +0100
commitf87fa26177ac4dd5ebcc1e598a90142ecb4973cb (patch)
tree9c9d51c1ff3fccb3b14f0937dfc7ad6f5dd08940 /drivers/iio/light
parent52325ff42a9aa7bdcbcc5461f6eec4c4f93ed944 (diff)
downloadop-kernel-dev-f87fa26177ac4dd5ebcc1e598a90142ecb4973cb.zip
op-kernel-dev-f87fa26177ac4dd5ebcc1e598a90142ecb4973cb.tar.gz
iio: light: rpr0521 disable sensor -bugfix
Sensor was marked enabled on each call even if the call was for disabling sensor. Signed-off-by: Mikko Koivunen <mikko.koivunen@fi.rohmeurope.com> Acked-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/light')
-rw-r--r--drivers/iio/light/rpr0521.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c
index 7de0f39..03504f6 100644
--- a/drivers/iio/light/rpr0521.c
+++ b/drivers/iio/light/rpr0521.c
@@ -197,7 +197,10 @@ static int rpr0521_als_enable(struct rpr0521_data *data, u8 status)
if (ret < 0)
return ret;
- data->als_dev_en = true;
+ if (status & RPR0521_MODE_ALS_MASK)
+ data->als_dev_en = true;
+ else
+ data->als_dev_en = false;
return 0;
}
@@ -212,7 +215,10 @@ static int rpr0521_pxs_enable(struct rpr0521_data *data, u8 status)
if (ret < 0)
return ret;
- data->pxs_dev_en = true;
+ if (status & RPR0521_MODE_PXS_MASK)
+ data->pxs_dev_en = true;
+ else
+ data->pxs_dev_en = false;
return 0;
}
OpenPOWER on IntegriCloud