From: Guenter Roeck <linux@roeck-us.net>
To: linux-hwmon@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
Slawomir Stepien <sst@poczta.fm>,
Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 01/40] hwmon: (lm90) Generate sysfs and udev events for all alarms
Date: Wed, 25 May 2022 06:56:30 -0700 [thread overview]
Message-ID: <20220525135709.2899592-2-linux@roeck-us.net> (raw)
In-Reply-To: <20220525135709.2899592-1-linux@roeck-us.net>
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>
---
drivers/hwmon/lm90.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
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;
}
--
2.35.1
next prev parent reply other threads:[~2022-05-25 14:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 13:56 [PATCH 00/40] hwmon: (lm90) Various improvements to lm90 driver Guenter Roeck
2022-05-25 13:56 ` Guenter Roeck [this message]
2022-05-25 13:56 ` [PATCH 02/40] hwmon: (lm90) Rework alarm/status handling Guenter Roeck
2022-05-25 13:56 ` [PATCH 03/40] hwmon: (lm90) Reorder include files in alphabetical order Guenter Roeck
2022-05-25 13:56 ` [PATCH 04/40] hwmon: (lm90) Reorder chip enumeration to be " Guenter Roeck
2022-05-25 13:56 ` [PATCH 05/40] hwmon: (lm90) Use BIT macro Guenter Roeck
-- strict thread matches above, loose matches on Subject: below --
2022-05-25 13:57 [PATCH 00/40] hwmon: (lm90) Various improvements to lm90 driver Guenter Roeck
2022-05-25 13:57 ` [PATCH 01/40] hwmon: (lm90) Generate sysfs and udev events for all alarms Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220525135709.2899592-2-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sst@poczta.fm \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox