lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 28 Sep 2010 13:21:28 +0100
From:	Alan Cox <alan@...ux.intel.com>
To:	linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] apds9802als: fix als sensing range value

From: Hong Liu <hong.liu@...el.com>

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

Signed-off-by: Hong Liu <hong.liu@...el.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);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ