Skip to content

Commit

Permalink
hwmon: (lm75) Add support for TMP75B
Browse files Browse the repository at this point in the history
The TMP75B has a different control register, supports 12-bit
resolution and the default conversion rate is 37 Hz.

Signed-off-by: Iker Perez del Palomar Sustatxa <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 May 3, 2019
1 parent be889be commit 39abe9d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Documentation/hwmon/lm75.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ Supported chips:

https://www.st.com/resource/en/datasheet/stlm75.pdf

* Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75C, TMP175, TMP275
* Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75B, TMP75C, TMP175, TMP275

Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 'tmp75', 'tmp75c', 'tmp275'
Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 'tmp75', 'tmp75b', 'tmp75c', 'tmp275'

Addresses scanned: none

Expand All @@ -111,6 +111,8 @@ Supported chips:

http://www.ti.com/product/tmp75

http://www.ti.com/product/tmp75b

http://www.ti.com/product/tmp75c

http://www.ti.com/product/tmp175
Expand Down
11 changes: 11 additions & 0 deletions drivers/hwmon/lm75.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ enum lm75_type { /* keep sorted in alphabetical order */
tmp175,
tmp275,
tmp75,
tmp75b,
tmp75c,
};

Expand Down Expand Up @@ -354,6 +355,11 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
data->resolution = 12;
data->sample_time = MSEC_PER_SEC / 2;
break;
case tmp75b: /* not one-shot mode, Conversion rate 37Hz */
clr_mask |= 1 << 15 | 0x3 << 13;
data->resolution = 12;
data->sample_time = MSEC_PER_SEC / 37;
break;
case tmp75c:
clr_mask |= 1 << 5; /* not one-shot mode */
data->resolution = 12;
Expand Down Expand Up @@ -414,6 +420,7 @@ static const struct i2c_device_id lm75_ids[] = {
{ "tmp175", tmp175, },
{ "tmp275", tmp275, },
{ "tmp75", tmp75, },
{ "tmp75b", tmp75b, },
{ "tmp75c", tmp75c, },
{ /* LIST END */ }
};
Expand Down Expand Up @@ -512,6 +519,10 @@ static const struct of_device_id __maybe_unused lm75_of_match[] = {
.compatible = "ti,tmp75",
.data = (void *)tmp75
},
{
.compatible = "ti,tmp75b",
.data = (void *)tmp75b
},
{
.compatible = "ti,tmp75c",
.data = (void *)tmp75c
Expand Down

0 comments on commit 39abe9d

Please sign in to comment.