diff options
author | Guenter Roeck <[email protected]> | 2022-01-11 03:01:56 -0800 |
---|---|---|
committer | Guenter Roeck <[email protected]> | 2022-07-13 08:38:17 -0700 |
commit | eaf87c006f03266d4203f0a62e8c8a1cde417152 (patch) | |
tree | b6174083bdb99a183b71e80335b8e1dc0793a8d6 | |
parent | f30ce040a704f30f7ac6d3ec4c3f5390ccaabfe0 (diff) |
hwmon: (lm90) Generate sysfs and udev events for all alarms
So far the driver only generated sysfs and udev events for minimum and
maximum alarms. Also generate events for critical and emergency alarms.
Signed-off-by: Guenter Roeck <[email protected]>
-rw-r--r-- | drivers/hwmon/lm90.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 3820f0e61510..83d027c134be 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -1829,6 +1829,26 @@ static bool lm90_is_tripped(struct i2c_client *client, u16 *status) hwmon_notify_event(data->hwmon_dev, hwmon_temp, hwmon_temp_max_alarm, 2); + if (st & LM90_STATUS_LTHRM) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_crit_alarm, 0); + if (st & LM90_STATUS_RTHRM) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_crit_alarm, 1); + if (st2 & MAX6696_STATUS2_R2THRM) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_crit_alarm, 2); + + if (st2 & MAX6696_STATUS2_LOT2) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_emergency_alarm, 0); + if (st2 & MAX6696_STATUS2_ROT2) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_emergency_alarm, 1); + if (st2 & MAX6696_STATUS2_R2OT2) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_emergency_alarm, 2); + return true; } |