All of lore.kernel.org
 help / color / mirror / Atom feed
From: Iker Perez <iker.perez@codethink.co.uk>
To: linux-hwmon@vger.kernel.org, linux@roeck-us.net
Cc: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Subject: [PATCH] hwmon: (lm75) Fixup tmp75b clr_mask
Date: Thu,  1 Aug 2019 08:53:24 +0100	[thread overview]
Message-ID: <20190801075324.4638-1-iker.perez@codethink.co.uk> (raw)

From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>

The configuration register of the tmp75b sensor is 16bit long, however
the first byte is reserved, so there is not no need to take care of it.

Because the order of the bytes is little endian and it is only wanted to
write one byte, the desired bits must be shifted in a 8 bit range.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
---
 drivers/hwmon/lm75.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 3fb9c0a2d6d0..ce5ec403ec73 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -343,7 +343,7 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		data->sample_time = MSEC_PER_SEC / 2;
 		break;
 	case tmp75b:  /* not one-shot mode, Conversion rate 37Hz */
-		clr_mask |= 1 << 15 | 0x3 << 13;
+		clr_mask |= 1 << 7 | 0x3 << 5;
 		data->resolution = 12;
 		data->sample_time = MSEC_PER_SEC / 37;
 		break;
-- 
2.11.0


             reply	other threads:[~2019-08-01  7:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  7:53 Iker Perez [this message]
2019-08-01 16:39 ` [PATCH] hwmon: (lm75) Fixup tmp75b clr_mask Guenter Roeck

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=20190801075324.4638-1-iker.perez@codethink.co.uk \
    --to=iker.perez@codethink.co.uk \
    --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.