Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
From: Dan Robertson <dan@dlrobertson.com>
To: linux-hwmon@vger.kernel.org
Cc: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Dan Robertson <dan@dlrobertson.com>
Subject: [PATCH 2/2] hwmon: (shtc1) fix shtc1 and shtw1 id mask
Date: Thu,  5 Sep 2019 01:45:54 +0000
Message-ID: <20190905014554.21658-3-dan@dlrobertson.com> (raw)
In-Reply-To: <20190905014554.21658-1-dan@dlrobertson.com>

Fix an error in the bitmaskfor the shtc1 and shtw1 bitmask used to
retrieve the chip ID from the ID register. See section 5.7 of the shtw1
or shtc1 datasheet for details.

Fixes: 1a539d372edd9832444e7a3daa710c444c014dc9 ("hwmon: add support for Sensirion SHTC1 sensor")
Signed-off-by: Dan Robertson <dan@dlrobertson.com>
---
 drivers/hwmon/shtc1.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/shtc1.c b/drivers/hwmon/shtc1.c
index 3e9a859a2b58..c628313a20d4 100644
--- a/drivers/hwmon/shtc1.c
+++ b/drivers/hwmon/shtc1.c
@@ -27,14 +27,14 @@ static const unsigned char shtc1_cmd_measure_nonblocking_lpm[] = { 0x60, 0x9c };
 static const unsigned char shtc1_cmd_read_id_reg[]             = { 0xef, 0xc8 };
 
 /* constants for reading the ID register
- * SHTC1: 0x0007 with mask 0x001f
- * SHTW1: 0x0007 with mask 0x001f
+ * SHTC1: 0x0007 with mask 0x003f
+ * SHTW1: 0x0007 with mask 0x003f
  * SHTC3: 0x0807 with mask 0x083f
  */
 #define SHTC3_ID      0x0807
 #define SHTC3_ID_MASK 0x083f
 #define SHTC1_ID      0x0007
-#define SHTC1_ID_MASK 0x001f
+#define SHTC1_ID_MASK 0x003f
 
 /* delays for non-blocking i2c commands, both in us */
 #define SHTC1_NONBLOCKING_WAIT_TIME_HPM  14400
-- 
2.23.0




  parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05  1:01 [PATCH 0/1] hwmon: (shtc1) add support for the SHTC3 sensor Dan Robertson
2019-09-05  1:01 ` [PATCH] " Dan Robertson
2019-09-05  1:45   ` [PATCH 0/2] " Dan Robertson
2019-09-05  1:45     ` [PATCH 1/2] " Dan Robertson
2019-09-10 18:14       ` Guenter Roeck
2019-09-05  1:45     ` Dan Robertson [this message]
2019-09-10 18:43       ` [PATCH 2/2] hwmon: (shtc1) fix shtc1 and shtw1 id mask Guenter Roeck
2019-09-10 18:57         ` Dan Robertson

Reply instructions:

You may reply publically 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=20190905014554.21658-3-dan@dlrobertson.com \
    --to=dan@dlrobertson.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org linux-hwmon@archiver.kernel.org
	public-inbox-index linux-hwmon

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/ public-inbox