Skip to content

Commit

Permalink
hwmon: (lm75) Fixup tmp75b clr_mask
Browse files Browse the repository at this point in the history
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 necessary
to write one byte, the desired bits must be shifted into a 8 bit range.

Fixes: 39abe9d ("hwmon: (lm75) Add support for TMP75B")
Cc: stable@vger.kernel.org
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Link: https://lore.kernel.org/r/20190801075324.4638-1-iker.perez@codethink.co.uk
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Iker Perez del Palomar Sustatxa authored and Guenter Roeck committed Aug 7, 2019
1 parent 38ada2f commit a95a4f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/lm75.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a95a4f3

Please sign in to comment.