lkml.org 
[lkml]   [2010]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] apds9802als: fix als sensing range value
Date
From: Hong Liu <hong.liu@intel.com>

The 4K and 64K in the hw spec acutally means 4095 (12bit) and 65535 (16bit).

Signed-off-by: Hong Liu <hong.liu@intel.com>
---

drivers/misc/apds9802als.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c
index cfd004a..a55a215 100644
--- a/drivers/misc/apds9802als.c
+++ b/drivers/misc/apds9802als.c
@@ -55,9 +55,9 @@ static ssize_t als_sensing_range_show(struct device *dev,
if (val < 0)
return val;
if (val & 1)
- return sprintf(buf, "4000\n");
+ return sprintf(buf, "4095\n");
else
- return sprintf(buf, "64000\n");
+ return sprintf(buf, "65535\n");
}

static ssize_t als_lux_output_data_show(struct device *dev,
@@ -111,7 +111,7 @@ static ssize_t als_sensing_range_store(struct device *dev,
/* Reset the bits before setting them */
ret_val = ret_val & 0xFA;

- if (val == 1) /* Setting the continous measurement up to 8k LUX */
+ if (val == 1) /* Setting the continous measurement up to 4k LUX */
ret_val = (ret_val | 0x05);
else /* Setting the continous measurement up to 64k LUX*/
ret_val = (ret_val | 0x04);


\
 
 \ /
  Last update: 2010-09-28 15:11    [W:1.565 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site