Skip to content

Commit

Permalink
hwmon: (lm90) Generate sysfs and udev events for all alarms
Browse files Browse the repository at this point in the history
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 <linux@roeck-us.net>
  • Loading branch information
Guenter Roeck committed Jul 13, 2022
1 parent f30ce04 commit eaf87c0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/hwmon/lm90.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit eaf87c0

Please sign in to comment.