Skip to content

Commit

Permalink
hwmon: (lm75) Add TI TMP1075 support
Browse files Browse the repository at this point in the history
TI TMP1075 is a LM75 compatible sensor, so lets
add support for it.

Signed-off-by: Robert Marko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
robimarko authored and groeck committed Jun 17, 2021
1 parent 6e954d2 commit ec081f9
Show file tree
Hide file tree
Showing 2 changed files with 17 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, TMP75B, TMP75C, TMP175, TMP275
* Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75B, TMP75C, TMP175, TMP275, TMP1075

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

Addresses scanned: none

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

https://www.ti.com/product/tmp275

https://www.ti.com/product/TMP1075

* NXP LM75B, PCT2075

Prefix: 'lm75b', 'pct2075'
Expand Down
13 changes: 13 additions & 0 deletions drivers/hwmon/lm75.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum lm75_type { /* keep sorted in alphabetical order */
tmp75,
tmp75b,
tmp75c,
tmp1075,
};

/**
Expand Down Expand Up @@ -293,6 +294,13 @@ static const struct lm75_params device_params[] = {
.clr_mask = 1 << 5, /*not one-shot mode*/
.default_resolution = 12,
.default_sample_time = MSEC_PER_SEC / 12,
},
[tmp1075] = { /* not one-shot mode, 27.5 ms sample rate */
.clr_mask = 1 << 5 | 1 << 6 | 1 << 7,
.default_resolution = 12,
.default_sample_time = 28,
.num_sample_times = 4,
.sample_times = (unsigned int []){ 28, 55, 110, 220 },
}
};

Expand Down Expand Up @@ -662,6 +670,7 @@ static const struct i2c_device_id lm75_ids[] = {
{ "tmp75", tmp75, },
{ "tmp75b", tmp75b, },
{ "tmp75c", tmp75c, },
{ "tmp1075", tmp1075, },
{ /* LIST END */ }
};
MODULE_DEVICE_TABLE(i2c, lm75_ids);
Expand Down Expand Up @@ -771,6 +780,10 @@ static const struct of_device_id __maybe_unused lm75_of_match[] = {
.compatible = "ti,tmp75c",
.data = (void *)tmp75c
},
{
.compatible = "ti,tmp1075",
.data = (void *)tmp1075
},
{ },
};
MODULE_DEVICE_TABLE(of, lm75_of_match);
Expand Down

0 comments on commit ec081f9

Please sign in to comment.