summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJagan Teki <jagan@amarulasolutions.com>2018-12-06 00:14:22 +0300
committerGuenter Roeck <linux@roeck-us.net>2018-12-17 02:13:22 +0300
commit2e9a41bbc1079776dabe42ed8113b086b99ae56c (patch)
treebe45c15ee4b62316d6e47d15be6f7c67f80d3846 /drivers/hwmon
parent48049e205e7071c733508e12b036c3845d0e84a9 (diff)
downloadlinux-2e9a41bbc1079776dabe42ed8113b086b99ae56c.tar.xz
hwmon: (lm75) Add STLM75 support
The STLM75 is a high-precision digital CMOS temperature sensor IC with a sigma-delta temperature-to-digital converter. The configuration register mapping is similar to existing lm75 but the sample rate is 150ms(max). Tested on real hardware and verified temperature readings are correct. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/Kconfig1
-rw-r--r--drivers/hwmon/lm75.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index fe1e75051fd8..7bec39266402 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1035,6 +1035,7 @@ config SENSORS_LM75
- National Semiconductor LM75, LM75A
- NXP's LM75A
- ST Microelectronics STDS75
+ - ST Microelectronics STLM75
- TelCom (now Microchip) TCN75
- Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75,
TMP175, TMP275
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index c7f20543b2bf..62acb9f16ec5 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -50,6 +50,7 @@ enum lm75_type { /* keep sorted in alphabetical order */
max31725,
mcp980x,
stds75,
+ stlm75,
tcn75,
tmp100,
tmp101,
@@ -316,6 +317,10 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
data->resolution = 11;
data->sample_time = MSEC_PER_SEC;
break;
+ case stlm75:
+ data->resolution = 9;
+ data->sample_time = MSEC_PER_SEC / 5;
+ break;
case ds7505:
set_mask |= 3 << 5; /* 12-bit mode */
data->resolution = 12;
@@ -424,6 +429,7 @@ static const struct i2c_device_id lm75_ids[] = {
{ "max31726", max31725, },
{ "mcp980x", mcp980x, },
{ "stds75", stds75, },
+ { "stlm75", stlm75, },
{ "tcn75", tcn75, },
{ "tmp100", tmp100, },
{ "tmp101", tmp101, },
@@ -495,6 +501,10 @@ static const struct of_device_id lm75_of_match[] = {
.data = (void *)stds75
},
{
+ .compatible = "st,stlm75",
+ .data = (void *)stlm75
+ },
+ {
.compatible = "microchip,tcn75",
.data = (void *)tcn75
},