Commit 2c6cb6c5 authored by Guenter Roeck's avatar Guenter Roeck

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: default avatarGuenter Roeck <linux@roeck-us.net>
parent af4540b1
...@@ -147,6 +147,26 @@ Supported chips: ...@@ -147,6 +147,26 @@ Supported chips:
https://www.onsemi.com/PowerSolutions/product.do?id=NCT210 https://www.onsemi.com/PowerSolutions/product.do?id=NCT210
* ON Semiconductor NCT214
Prefix: 'nct214'
Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
Datasheet: Publicly available at the ON Semiconductor website
https://www.onsemi.com/PowerSolutions/product.do?id=NCT214
* ON Semiconductor NCT72
Prefix: 'nct72'
Addresses scanned: I2C 0x4c - 0x4d
Datasheet: Publicly available at the ON Semiconductor website
https://www.onsemi.com/PowerSolutions/product.do?id=NCT72
* Maxim MAX1617 * Maxim MAX1617
Prefix: 'max1617' Prefix: 'max1617'
......
...@@ -1365,7 +1365,8 @@ config SENSORS_LM90 ...@@ -1365,7 +1365,8 @@ config SENSORS_LM90
Maxim MAX1617, MAX6642, MAX6646, MAX6647, MAX6648, MAX6649, MAX6654, Maxim MAX1617, MAX6642, MAX6646, MAX6647, MAX6648, MAX6649, MAX6654,
MAX6657, MAX6658, MAX6659, MAX6680, MAX6681, MAX6692, MAX6695, MAX6657, MAX6658, MAX6659, MAX6680, MAX6681, MAX6692, MAX6695,
MAX6696, MAX6696,
ON Semiconductor NCT1008, NCT210, Winbond/Nuvoton W83L771W/G/AWG/ASG, ON Semiconductor NCT1008, NCT210, NCT72, NCT214,
Winbond/Nuvoton W83L771W/G/AWG/ASG,
Philips SA56004, GMT G781, Texas Instruments TMP451 and TMP461 Philips SA56004, GMT G781, Texas Instruments TMP451 and TMP461
sensor chips. sensor chips.
......
...@@ -69,6 +69,9 @@ ...@@ -69,6 +69,9 @@
* / ON Semiconductor. The chips are similar to ADT7461 but support two external * / ON Semiconductor. The chips are similar to ADT7461 but support two external
* temperature sensors. * 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 * This driver also supports the SA56004 from Philips. This device is
* pin-compatible with the LM86, the ED/EDP parts are also address-compatible. * pin-compatible with the LM86, the ED/EDP parts are also address-compatible.
* *
...@@ -125,7 +128,7 @@ static const unsigned short normal_i2c[] = { ...@@ -125,7 +128,7 @@ static const unsigned short normal_i2c[] = {
enum chips { adm1023, adm1032, adt7461, adt7461a, adt7481, enum chips { adm1023, adm1032, adt7461, adt7461a, adt7481,
g781, lm84, lm90, lm99, g781, lm84, lm90, lm99,
max1617, max6642, max6646, max6648, max6654, max6657, max6659, max6680, max6696, 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[] = { ...@@ -258,6 +261,8 @@ static const struct i2c_device_id lm90_id[] = {
{ "mc1066", max1617 }, { "mc1066", max1617 },
{ "nct1008", adt7461a }, { "nct1008", adt7461a },
{ "nct210", nct210 }, { "nct210", nct210 },
{ "nct214", nct72 },
{ "nct72", nct72 },
{ "w83l771", w83l771 }, { "w83l771", w83l771 },
{ "sa56004", sa56004 }, { "sa56004", sa56004 },
{ "thmc10", max1617 }, { "thmc10", max1617 },
...@@ -348,6 +353,14 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = { ...@@ -348,6 +353,14 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
.compatible = "onnn,nct1008", .compatible = "onnn,nct1008",
.data = (void *)adt7461a .data = (void *)adt7461a
}, },
{
.compatible = "onnn,nct214",
.data = (void *)nct72
},
{
.compatible = "onnn,nct72",
.data = (void *)nct72
},
{ {
.compatible = "winbond,w83l771", .compatible = "winbond,w83l771",
.data = (void *)w83l771 .data = (void *)w83l771
...@@ -534,6 +547,15 @@ static const struct lm90_params lm90_params[] = { ...@@ -534,6 +547,15 @@ static const struct lm90_params lm90_params[] = {
.reg_status2 = MAX6696_REG_STATUS2, .reg_status2 = MAX6696_REG_STATUS2,
.reg_local_ext = MAX6657_REG_LOCAL_TEMPL, .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] = { [nct210] = {
.flags = LM90_HAVE_ALARMS | LM90_HAVE_BROKEN_ALERT .flags = LM90_HAVE_ALARMS | LM90_HAVE_BROKEN_ALERT
| LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_LOW | LM90_HAVE_CONVRATE | 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 ...@@ -1818,12 +1840,23 @@ static const char *lm90_detect_analog(struct i2c_client *client, bool common_add
convrate <= 0x0a) convrate <= 0x0a)
name = "nct1008"; name = "nct1008";
break; 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) */ case 0x57: /* ADT7461A, NCT1008 (datasheet rev. 3) */
if (man_id2 == 0x41 && chip_id2 == 0x61 && if (man_id2 == 0x41 && chip_id2 == 0x61 &&
(address == 0x4c || address == 0x4d) && !(config1 & 0x1b) && (address == 0x4c || address == 0x4d) && !(config1 & 0x1b) &&
convrate <= 0x0a) convrate <= 0x0a)
name = "adt7461a"; name = "adt7461a";
break; break;
case 0x5a: /* NCT214 */
if (man_id2 == 0x41 && chip_id2 == 0x61 &&
common_address && !(config1 & 0x1b) && convrate <= 0x0a)
name = "nct214";
break;
case 0x62: /* ADT7481, undocumented */ case 0x62: /* ADT7481, undocumented */
if (man_id2 == 0x41 && chip_id2 == 0x81 && if (man_id2 == 0x41 && chip_id2 == 0x81 &&
(address == 0x4b || address == 0x4c) && !(config1 & 0x10) && (address == 0x4b || address == 0x4c) && !(config1 & 0x10) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment