[PATCH 2/2] apds9802als: fix als sensing range value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hong Liu <hong.liu@xxxxxxxxx>

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

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

 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-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux