All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] iio: light: rpr0521 disable sensor -bugfix
@ 2017-04-06  6:37 Mikko Koivunen
  2017-04-06  6:37 ` [PATCH 2/6] iio: light: rpr0521 whitespace fixes Mikko Koivunen
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Mikko Koivunen @ 2017-04-06  6:37 UTC (permalink / raw)
  To: jic23; +Cc: pmeerw, knaack.h, lars, linux-iio, Mikko Koivunen

Sensor was marked enabled on each call even if the call was for disabling
sensor.
Tested on LeMaker HiKey with AOSP7.1 kernel 4.4.

Signed-off-by: Mikko Koivunen <mikko.koivunen@fi.rohmeurope.com>
---
 drivers/iio/light/rpr0521.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c
index 7de0f39..c15529b 100644
--- a/drivers/iio/light/rpr0521.c
+++ b/drivers/iio/light/rpr0521.c
@@ -197,8 +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 +214,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.9.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread
[parent not found: <1491390546-22054-1-git-send-email-mikko.koivunen@fi.rohmeurope.com>]

end of thread, other threads:[~2017-04-08 15:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06  6:37 [PATCH 1/6] iio: light: rpr0521 disable sensor -bugfix Mikko Koivunen
2017-04-06  6:37 ` [PATCH 2/6] iio: light: rpr0521 whitespace fixes Mikko Koivunen
2017-04-06  6:37 ` [PATCH 3/6] iio: light: rpr0521 sample_frequency read/write added Mikko Koivunen
2017-04-06  6:37 ` [PATCH 4/6] iio: light: rpr0521 proximity offset " Mikko Koivunen
2017-04-06  6:37 ` [PATCH 5/6] iio: light: rpr0521 channel numbers reordered Mikko Koivunen
2017-04-06  6:37 ` [PATCH 6/6] iio: light: rpr0521 triggered buffer added Mikko Koivunen
2017-04-06  7:55   ` Daniel Baluta
2017-04-07 11:56     ` Koivunen, Mikko
     [not found] <1491390546-22054-1-git-send-email-mikko.koivunen@fi.rohmeurope.com>
     [not found] ` <1491390546-22054-6-git-send-email-mikko.koivunen@fi.rohmeurope.com>
     [not found]   ` <alpine.DEB.2.20.1704051404160.5514@vps.pmeerw.net>
2017-04-07 11:54     ` Koivunen, Mikko
2017-04-08 15:32       ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.