linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/9] iio: light: rpr0521 disable sensor -bugfix
@ 2017-05-05 11:19 Mikko Koivunen
  2017-05-05 11:19 ` [PATCH v3 2/9] iio: light: rpr0521 poweroff for probe fails Mikko Koivunen
                   ` (8 more replies)
  0 siblings, 9 replies; 27+ messages in thread
From: Mikko Koivunen @ 2017-05-05 11:19 UTC (permalink / raw)
  To: jic23; +Cc: pmeerw, knaack.h, lars, Daniel Baluta, linux-iio, Mikko Koivunen

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>
---
Tested on LeMaker HiKey with AOSP7.1 kernel 4.4.
Patch v2->v3 changes:
whitespace change.

 drivers/iio/light/rpr0521.c |   10 ++++++++--
 1 file 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;
 }
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-05-17  6:28 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-05 11:19 [PATCH v3 1/9] iio: light: rpr0521 disable sensor -bugfix Mikko Koivunen
2017-05-05 11:19 ` [PATCH v3 2/9] iio: light: rpr0521 poweroff for probe fails Mikko Koivunen
2017-05-07 11:42   ` Jonathan Cameron
2017-05-15 10:32     ` Koivunen, Mikko
2017-05-16 18:07       ` Jonathan Cameron
2017-05-17  6:28         ` Koivunen, Mikko
2017-05-15 12:27     ` Daniel Baluta
2017-05-05 11:19 ` [PATCH v3 3/9] iio: light: rpr0521 on-off sequence change for CONFIG_PM Mikko Koivunen
2017-05-07 11:48   ` Jonathan Cameron
2017-05-15 10:40     ` Koivunen, Mikko
2017-05-16 18:08       ` Jonathan Cameron
2017-05-17  6:28         ` Koivunen, Mikko
2017-05-05 11:19 ` [PATCH v3 4/9] iio: light: rpr0521 magic number to sizeof() on value read Mikko Koivunen
2017-05-05 11:19 ` [PATCH v3 5/9] iio: light: rpr0521 whitespace fixes Mikko Koivunen
2017-05-05 11:19 ` [PATCH v3 6/9] iio: light: rpr0521 sample_frequency read/write Mikko Koivunen
2017-05-07 11:51   ` Jonathan Cameron
2017-05-15 10:42     ` Koivunen, Mikko
2017-05-16 18:15       ` Jonathan Cameron
2017-05-05 11:19 ` [PATCH v3 7/9] iio: light: rpr0521 proximity offset read/write Mikko Koivunen
2017-05-05 11:19 ` [PATCH v3 8/9] iio: light: rpr0521 channel numbers reordered Mikko Koivunen
2017-05-07 11:54   ` Jonathan Cameron
2017-05-05 11:19 ` [PATCH v3 9/9] iio: light: rpr0521 triggered buffer Mikko Koivunen
2017-05-07 12:09   ` Jonathan Cameron
2017-05-15 13:06     ` Koivunen, Mikko
2017-05-05 11:24 ` [PATCH v3 1/9] iio: light: rpr0521 disable sensor -bugfix Daniel Baluta
2017-05-15 10:25   ` Koivunen, Mikko
2017-05-15 12:29     ` Daniel Baluta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).