All of lore.kernel.org
 help / color / mirror / 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	[thread overview]
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	other threads:[~2019-09-05  2:01 UTC|newest]

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 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=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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.