lkml.org 
[lkml]   [2013]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 08/19] bh1770glc: logic change in the proximity read
Date
the prox0_raw file in the sysfs interface reads the proximity
value directly from the register instead of reporting the last
read value; in this way userspace applications can have a real
time value

Signed-off-by: Andi Shyti <andi@etezian.org>
---
drivers/misc/bh1770glc.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c
index ac6d0c8..031a9fa 100644
--- a/drivers/misc/bh1770glc.c
+++ b/drivers/misc/bh1770glc.c
@@ -786,6 +786,11 @@ static ssize_t bh1770_prox_result_show(struct device *dev,
ssize_t ret;

mutex_lock(&chip->mutex);
+ /*
+ * if this function fails the prox_data will store
+ * the value from the previous read
+ */
+ bh1770_ps_get_result(chip);
if (chip->prox_enable_count && !pm_runtime_suspended(dev))
ret = sprintf(buf, "%d\n", chip->prox_data);
else
--
1.7.10.4


\
 
 \ /
  Last update: 2013-06-13 21:01    [W:0.145 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site