Skip to content

Commit 6d44e43

Browse files
ChiaYuShihgroeck
authored andcommitted
hwmon: (nct7904) Read all SMI status registers in probe function
When nct7904 power up, it compares current sensor readings against the default threshold immediately. This results in false alarms on startup. Read all SMI status registers in probe function to clear the alarms. Signed-off-by: Amy Shih <[email protected]> [groeck: Reworded description] Signed-off-by: Guenter Roeck <[email protected]>
1 parent bcb543c commit 6d44e43

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/hwmon/nct7904.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#define FANCTL_MAX 4 /* Counted from 1 */
4242
#define TCPU_MAX 8 /* Counted from 1 */
4343
#define TEMP_MAX 4 /* Counted from 1 */
44+
#define SMI_STS_MAX 10 /* Counted from 1 */
4445

4546
#define VT_ADC_CTRL0_REG 0x20 /* Bank 0 */
4647
#define VT_ADC_CTRL1_REG 0x21 /* Bank 0 */
@@ -1009,6 +1010,13 @@ static int nct7904_probe(struct i2c_client *client,
10091010
data->fan_mode[i] = ret;
10101011
}
10111012

1013+
/* Read all of SMI status register to clear alarms */
1014+
for (i = 0; i < SMI_STS_MAX; i++) {
1015+
ret = nct7904_read_reg(data, BANK_0, SMI_STS1_REG + i);
1016+
if (ret < 0)
1017+
return ret;
1018+
}
1019+
10121020
hwmon_dev =
10131021
devm_hwmon_device_register_with_info(dev, client->name, data,
10141022
&nct7904_chip_info, NULL);

0 commit comments

Comments
 (0)