Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] hwmon: (lm75) Fixup tmp75b clr_mask
@ 2019-08-01  7:53 Iker Perez
  2019-08-01 16:39 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Iker Perez @ 2019-08-01  7:53 UTC (permalink / raw)
  To: linux-hwmon, linux; +Cc: Iker Perez del Palomar Sustatxa

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwmon: (lm75) Fixup tmp75b clr_mask
  2019-08-01  7:53 [PATCH] hwmon: (lm75) Fixup tmp75b clr_mask Iker Perez
@ 2019-08-01 16:39 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-08-01 16:39 UTC (permalink / raw)
  To: Iker Perez; +Cc: linux-hwmon

On Thu, Aug 01, 2019 at 08:53:24AM +0100, Iker Perez wrote:
> 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>

Applied.

Thanks,
Guenter

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01  7:53 [PATCH] hwmon: (lm75) Fixup tmp75b clr_mask Iker Perez
2019-08-01 16:39 ` Guenter Roeck

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


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