Skip to content

Commit

Permalink
hwmon: (lm90) Enable full PEC support for ADT7461A
Browse files Browse the repository at this point in the history
Experiments show that ADT7461A and NCT1008 support PEC, even though it is
not documented. Enable support for it in the driver. Since ADT7461 only
supports partial PEC, this means that the configuration for ADT7461A
needs to be separated from ADT7461.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Guenter Roeck committed Jul 13, 2022
1 parent 425f5b5 commit d70fa73
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions drivers/hwmon/lm90.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static const unsigned short normal_i2c[] = {
0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x48, 0x49, 0x4a, 0x4b, 0x4c,
0x4d, 0x4e, 0x4f, I2C_CLIENT_END };

enum chips { adm1032, adt7461, g781, lm86, lm90, lm99,
enum chips { adm1032, adt7461, adt7461a, g781, lm86, lm90, lm99,
max6646, max6654, max6657, max6659, max6680, max6696,
sa56004, tmp451, tmp461, w83l771,
};
Expand Down Expand Up @@ -207,7 +207,7 @@ enum chips { adm1032, adt7461, g781, lm86, lm90, lm99,
static const struct i2c_device_id lm90_id[] = {
{ "adm1032", adm1032 },
{ "adt7461", adt7461 },
{ "adt7461a", adt7461 },
{ "adt7461a", adt7461a },
{ "g781", g781 },
{ "lm90", lm90 },
{ "lm86", lm86 },
Expand All @@ -224,7 +224,7 @@ static const struct i2c_device_id lm90_id[] = {
{ "max6681", max6680 },
{ "max6695", max6696 },
{ "max6696", max6696 },
{ "nct1008", adt7461 },
{ "nct1008", adt7461a },
{ "w83l771", w83l771 },
{ "sa56004", sa56004 },
{ "tmp451", tmp451 },
Expand All @@ -244,7 +244,7 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
},
{
.compatible = "adi,adt7461a",
.data = (void *)adt7461
.data = (void *)adt7461a
},
{
.compatible = "gmt,g781",
Expand Down Expand Up @@ -312,7 +312,7 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
},
{
.compatible = "onnn,nct1008",
.data = (void *)adt7461
.data = (void *)adt7461a
},
{
.compatible = "winbond,w83l771",
Expand Down Expand Up @@ -360,6 +360,13 @@ static const struct lm90_params lm90_params[] = {
.alert_alarms = 0x7c,
.max_convrate = 10,
},
[adt7461a] = {
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
| LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
| LM90_HAVE_CRIT | LM90_HAVE_PEC,
.alert_alarms = 0x7c,
.max_convrate = 10,
},
[g781] = {
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
| LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT,
Expand Down

0 comments on commit d70fa73

Please sign in to comment.