hwmon: (lm90) Add table with supported Analog/ONSEMI devices
authorGuenter Roeck <linux@roeck-us.net>
Fri, 17 Dec 2021 04:05:32 +0000 (20:05 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 13 Jul 2022 15:38:19 +0000 (08:38 -0700)
Add table with device names and known register values for supported
devices from Analog / ON Semiconductor.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm90.c

index 4694807fa69856c011a242d216e6ff385c087efc..c766e548801b3d6a7dce1af7058c3b7b1029d3a2 100644 (file)
@@ -1830,6 +1830,42 @@ static const char *lm90_detect_analog(struct i2c_client *client, bool common_add
        if (status < 0 || config2 < 0 || man_id2 < 0 || chip_id2 < 0)
                return NULL;
 
+       /*
+        * The following chips should be detected by this function. Known
+        * register values are listed. Registers 0x3d .. 0x3e are undocumented
+        * for most of the chips, yet appear to return a well defined value.
+        * Register 0xff is undocumented for some of the chips. Register 0x3f
+        * is undocumented for all chips, but also returns a well defined value.
+        * Values are as reported from real chips unless mentioned otherwise.
+        * The code below checks values for registers 0x3d, 0x3e, and 0xff,
+        * but not for register 0x3f.
+        *
+        * Chip                 Register
+        *              3d      3e      3f      fe      ff      Notes
+        * ----------------------------------------------------------
+        * adm1020      00      00      00      41      39
+        * adm1021      00      00      00      41      03
+        * adm1021a     00      00      00      41      3c
+        * adm1023      00      00      00      41      3c      same as adm1021a
+        * adm1032      00      00      00      41      42
+        *
+        * adt7421      21      41      04      41      04
+        * adt7461      00      00      00      41      51
+        * adt7461a     61      41      05      41      57
+        * adt7481      81      41      02      41      62
+        * adt7482      -       -       -       41      65      datasheet
+        *              82      41      05      41      75      real chip
+        * adt7483      83      41      04      41      94
+        *
+        * nct72        61      41      07      41      55
+        * nct210       00      00      00      41      3f
+        * nct214       61      41      08      41      5a
+        * nct1008      -       -       -       41      57      datasheet rev. 3
+        *              61      41      06      41      54      real chip
+        *
+        * nvt210       -       -       -       41      -       datasheet
+        * nvt211       -       -       -       41      -       datasheet
+        */
        switch (chip_id) {
        case 0x00 ... 0x03:     /* ADM1021 */
        case 0x05 ... 0x0f: