• Guenter Roeck's avatar
    hwmon: (lm92) Improve auto-detection accuracy · 3a3dbff8
    Guenter Roeck authored
    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: default avatarTzung-Bi Shih <tzungbi@kernel.org>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    3a3dbff8
lm92.c 9.59 KB