public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] apds9802als: fix als sensing range value
Date: Tue, 28 Sep 2010 13:21:28 +0100	[thread overview]
Message-ID: <20100928122127.492.81083.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100928122109.492.4630.stgit@localhost.localdomain>

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);


  reply	other threads:[~2010-09-28 13:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 12:21 [PATCH 1/2] Add ALS drivers for the apds9802als Alan Cox
2010-09-28 12:21 ` Alan Cox [this message]
2010-09-28 13:31 ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100928122127.492.81083.stgit@localhost.localdomain \
    --to=alan@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox