OSDN Git Service

hwmon: (lm90) Fix/Add detection of G781-1
authorGuenter Roeck <linux@roeck-us.net>
Fri, 3 Dec 2021 00:19:27 +0000 (16:19 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 13 Jul 2022 15:38:18 +0000 (08:38 -0700)
commit0707dda69d85a3c6f5155e5c33e92b49f389e552
tree206a920fad0da7aaa69105662ddf56b6b285b6f1
parentd277fbd53d9d0cd6fc35a8d9003b2e2176fb4948
hwmon: (lm90) Fix/Add detection of G781-1

When support for G781 was added, chips with ID 0x01 were found at I2C
addresses 0x4c and 0x4d. The G781 datasheet (version 1.3 from October 2003)
says that the device ID for G781-1 is 0x03, not 0x01. Also, the datasheet
states that the chip at I2C address is G781 and the chip at I2C address
0x4d is G781-1.

A G781-1 at I2C address 0x4d was now found to have a chip ID of 0x03
as suggested by the datasheet. Accept both 0x01 and 0x03 chip IDs at both
addresses to ensure that all variants of G781 are detected properly.

While at it, improve chip detection accuracy by reading two additional
registers and ensuring that only expected bits are set in those registers.

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