summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm90.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2021-12-02 21:58:25 -0800
committerGuenter Roeck <linux@roeck-us.net>2022-07-13 08:38:18 -0700
commit2c6cb6c557858672cafb6a5dc89a1df993420831 (patch)
treefb29126c30214bc856c88fdd494e08234501259c /drivers/hwmon/lm90.c
parentaf4540b112c48ac523f964f5014b48291490ac18 (diff)
downloadlinux-stable-2c6cb6c557858672cafb6a5dc89a1df993420831.tar.gz
linux-stable-2c6cb6c557858672cafb6a5dc89a1df993420831.tar.bz2
linux-stable-2c6cb6c557858672cafb6a5dc89a1df993420831.zip
hwmon: (lm90) Add support for ON Semiconductor NCT214 and NCT72
NCT214 and NCT72 are compatible to ADT7461/ADT7461A but have full PEC (packet error checking) support. PEC support is undocumented. Both chips support the undocumented secondary chip and manufacturer ID registers at 0x3e and 0x3f, and return 0x61 as chip ID. Use this information to improve the accuracy of chip detection code. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/lm90.c')
-rw-r--r--drivers/hwmon/lm90.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 9939a77ac00a..63bd7c3dcc6b 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -69,6 +69,9 @@
* / ON Semiconductor. The chips are similar to ADT7461 but support two external
* temperature sensors.
*
+ * This driver also supports NCT72 and NCT214 from ON Semiconductor. The chips
+ * are similar to ADT7461/ADT7461A but have full PEC support (undocumented).
+ *
* This driver also supports the SA56004 from Philips. This device is
* pin-compatible with the LM86, the ED/EDP parts are also address-compatible.
*
@@ -125,7 +128,7 @@ static const unsigned short normal_i2c[] = {
enum chips { adm1023, adm1032, adt7461, adt7461a, adt7481,
g781, lm84, lm90, lm99,
max1617, max6642, max6646, max6648, max6654, max6657, max6659, max6680, max6696,
- nct210, sa56004, tmp451, tmp461, w83l771,
+ nct210, nct72, sa56004, tmp451, tmp461, w83l771,
};
/*
@@ -258,6 +261,8 @@ static const struct i2c_device_id lm90_id[] = {
{ "mc1066", max1617 },
{ "nct1008", adt7461a },
{ "nct210", nct210 },
+ { "nct214", nct72 },
+ { "nct72", nct72 },
{ "w83l771", w83l771 },
{ "sa56004", sa56004 },
{ "thmc10", max1617 },
@@ -349,6 +354,14 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
.data = (void *)adt7461a
},
{
+ .compatible = "onnn,nct214",
+ .data = (void *)nct72
+ },
+ {
+ .compatible = "onnn,nct72",
+ .data = (void *)nct72
+ },
+ {
.compatible = "winbond,w83l771",
.data = (void *)w83l771
},
@@ -534,6 +547,15 @@ static const struct lm90_params lm90_params[] = {
.reg_status2 = MAX6696_REG_STATUS2,
.reg_local_ext = MAX6657_REG_LOCAL_TEMPL,
},
+ [nct72] = {
+ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
+ | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
+ | LM90_HAVE_CRIT | LM90_HAVE_PEC | LM90_HAVE_UNSIGNED_TEMP
+ | LM90_HAVE_LOW | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT,
+ .alert_alarms = 0x7c,
+ .max_convrate = 10,
+ .resolution = 10,
+ },
[nct210] = {
.flags = LM90_HAVE_ALARMS | LM90_HAVE_BROKEN_ALERT
| LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
@@ -1818,12 +1840,23 @@ static const char *lm90_detect_analog(struct i2c_client *client, bool common_add
convrate <= 0x0a)
name = "nct1008";
break;
+ case 0x55: /* NCT72 */
+ if (man_id2 == 0x41 && chip_id2 == 0x61 &&
+ (address == 0x4c || address == 0x4d) && !(config1 & 0x1b) &&
+ convrate <= 0x0a)
+ name = "nct72";
+ break;
case 0x57: /* ADT7461A, NCT1008 (datasheet rev. 3) */
if (man_id2 == 0x41 && chip_id2 == 0x61 &&
(address == 0x4c || address == 0x4d) && !(config1 & 0x1b) &&
convrate <= 0x0a)
name = "adt7461a";
break;
+ case 0x5a: /* NCT214 */
+ if (man_id2 == 0x41 && chip_id2 == 0x61 &&
+ common_address && !(config1 & 0x1b) && convrate <= 0x0a)
+ name = "nct214";
+ break;
case 0x62: /* ADT7481, undocumented */
if (man_id2 == 0x41 && chip_id2 == 0x81 &&
(address == 0x4b || address == 0x4c) && !(config1 & 0x10) &&