]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hwmon: (lm92) Improve auto-detection accuracy
authorGuenter Roeck <linux@roeck-us.net>
Wed, 17 Jul 2024 19:13:12 +0000 (12:13 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 27 Aug 2024 15:10:22 +0000 (08:10 -0700)
commit3a3dbff8a71ae7c8c6fbf900864ab79fd001bd29
tree9491f4b6a48d3e442e972980276c8b6d5bcf4a11
parent85f72ffe0f302c0837dc9dad5ba75dfcd5b35acd
hwmon: (lm92) Improve auto-detection accuracy

Checking three configuration register bits and the manufacturer ID
register to auto-detect LM92 is a bit vague. Repeat twice on replicated
register addresses to improve detection accuracy.  Check the manufacturer
ID first and bail out immediately without reading the other register if
there is a mismatch to reduce the number of i2c transfers needed in that
case. Also explicitly test for an error from reading the configuration
register to avoid potential situations where the returned error masked
against 0xe0 is 0.

While at it, drop "lm92: Found National Semiconductor LM92 chip" detection
noise.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm92.c