aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2019-07-11 14:45:04 +0200
committerGuenter Roeck <linux@roeck-us.net>2019-09-03 12:47:17 -0700
commit557c7ffa2f283166fa863aaa415757f5f485aa62 (patch)
tree2e2b688ec53341d0418ccae74c64b62061b210ab
parentdevice-tree: bindinds: add NXP PCT2075 as compatible device to LM75 (diff)
downloadlinux-dev-557c7ffa2f283166fa863aaa415757f5f485aa62.tar.xz
linux-dev-557c7ffa2f283166fa863aaa415757f5f485aa62.zip
hwmon: (lm75) add support for PCT2075
The NXP PCT2075 is largely compatible with other chips already supported by the LM75 driver. It uses an 11-bit resolution and defaults to 100 ms sampling period. The datasheet is here: https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf Signed-off-by: Daniel Mack <daniel@zonque.org> Link: https://lore.kernel.org/r/20190711124504.7580-2-daniel@zonque.org [groeck: Documentation update] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--Documentation/hwmon/lm75.rst6
-rw-r--r--drivers/hwmon/lm75.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/Documentation/hwmon/lm75.rst b/Documentation/hwmon/lm75.rst
index ba8acbd2a6cb..e749f827c002 100644
--- a/Documentation/hwmon/lm75.rst
+++ b/Documentation/hwmon/lm75.rst
@@ -119,9 +119,9 @@ Supported chips:
http://www.ti.com/product/tmp275
- * NXP LM75B
+ * NXP LM75B, PCT2075
- Prefix: 'lm75b'
+ Prefix: 'lm75b', 'pct2075'
Addresses scanned: none
@@ -129,6 +129,8 @@ Supported chips:
http://www.nxp.com/documents/data_sheet/LM75B.pdf
+ http://www.nxp.com/docs/en/data-sheet/PCT2075.pdf
+
Author: Frodo Looijaard <frodol@dds.nl>
Description
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index cbabab7ac788..0cd1447718c9 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -36,6 +36,7 @@ enum lm75_type { /* keep sorted in alphabetical order */
max6626,
max31725,
mcp980x,
+ pct2075,
stds75,
stlm75,
tcn75,
@@ -317,6 +318,10 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
data->resolution = 9;
data->sample_time = MSEC_PER_SEC / 8;
break;
+ case pct2075:
+ data->resolution = 11;
+ data->sample_time = MSEC_PER_SEC / 10;
+ break;
case mcp980x:
data->resolution_limits = 9;
/* fall through */
@@ -397,6 +402,7 @@ static const struct i2c_device_id lm75_ids[] = {
{ "max31725", max31725, },
{ "max31726", max31725, },
{ "mcp980x", mcp980x, },
+ { "pct2075", pct2075, },
{ "stds75", stds75, },
{ "stlm75", stlm75, },
{ "tcn75", tcn75, },
@@ -467,6 +473,10 @@ static const struct of_device_id __maybe_unused lm75_of_match[] = {
.data = (void *)mcp980x
},
{
+ .compatible = "nxp,pct2075",
+ .data = (void *)pct2075
+ },
+ {
.compatible = "st,stds75",
.data = (void *)stds75
},