hwmon: (max6697) Make sure the OVERT mask is set correctly
authorChu Lin <linchuyuan@google.com>
Tue, 23 Jun 2020 22:13:08 +0000 (22:13 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 24 Jun 2020 16:57:25 +0000 (09:57 -0700)
commit016983d138cbe99a5c0aaae0103ee88f5300beb3
tree6a60edeed8a21579ef9c44adb9d34dd40e420bbe
parentb4c8af4c2a226fc9c25e1decbd26fdab1b0993ee
hwmon: (max6697) Make sure the OVERT mask is set correctly

Per the datasheet for max6697, OVERT mask and ALERT mask are different.
For example, the 7th bit of OVERT is the local channel but for alert
mask, the 6th bit is the local channel. Therefore, we can't apply the
same mask for both registers. In addition to that, the max6697 driver
is supposed to be compatibale with different models. I manually went over
all the listed chips and made sure all chip types have the same layout.

Testing;
    mask value of 0x9 should map to 0x44 for ALERT and 0x84 for OVERT.
    I used iotool to read the reg value back to verify. I only tested this
    change on max6581.

Reference:
https://datasheets.maximintegrated.com/en/ds/MAX6581.pdf
https://datasheets.maximintegrated.com/en/ds/MAX6697.pdf
https://datasheets.maximintegrated.com/en/ds/MAX6699.pdf

Signed-off-by: Chu Lin <linchuyuan@google.com>
Fixes: 5372d2d71c46e ("hwmon: Driver for Maxim MAX6697 and compatibles")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/max6697.c