Commit 5f85c4d1 authored by Javier Carrasco's avatar Javier Carrasco Committed by Guenter Roeck

hwmon: (core) Add support for humidity min/max alarm

Add min_alarm and max_alarm attributes for humidityX to support devices
that can generate these alarms.
Such attributes already exist for other magnitudes such as tempX.

Tested with a ChipCap 2 temperature-humidity sensor.
Signed-off-by: default avatarJavier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240130-topic-chipcap2-v6-2-260bea05cf9b@gmail.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent cc804e48
...@@ -587,6 +587,8 @@ static const char * const hwmon_humidity_attr_templates[] = { ...@@ -587,6 +587,8 @@ static const char * const hwmon_humidity_attr_templates[] = {
[hwmon_humidity_fault] = "humidity%d_fault", [hwmon_humidity_fault] = "humidity%d_fault",
[hwmon_humidity_rated_min] = "humidity%d_rated_min", [hwmon_humidity_rated_min] = "humidity%d_rated_min",
[hwmon_humidity_rated_max] = "humidity%d_rated_max", [hwmon_humidity_rated_max] = "humidity%d_rated_max",
[hwmon_humidity_min_alarm] = "humidity%d_min_alarm",
[hwmon_humidity_max_alarm] = "humidity%d_max_alarm",
}; };
static const char * const hwmon_fan_attr_templates[] = { static const char * const hwmon_fan_attr_templates[] = {
......
...@@ -295,6 +295,8 @@ enum hwmon_humidity_attributes { ...@@ -295,6 +295,8 @@ enum hwmon_humidity_attributes {
hwmon_humidity_fault, hwmon_humidity_fault,
hwmon_humidity_rated_min, hwmon_humidity_rated_min,
hwmon_humidity_rated_max, hwmon_humidity_rated_max,
hwmon_humidity_min_alarm,
hwmon_humidity_max_alarm,
}; };
#define HWMON_H_ENABLE BIT(hwmon_humidity_enable) #define HWMON_H_ENABLE BIT(hwmon_humidity_enable)
...@@ -308,6 +310,8 @@ enum hwmon_humidity_attributes { ...@@ -308,6 +310,8 @@ enum hwmon_humidity_attributes {
#define HWMON_H_FAULT BIT(hwmon_humidity_fault) #define HWMON_H_FAULT BIT(hwmon_humidity_fault)
#define HWMON_H_RATED_MIN BIT(hwmon_humidity_rated_min) #define HWMON_H_RATED_MIN BIT(hwmon_humidity_rated_min)
#define HWMON_H_RATED_MAX BIT(hwmon_humidity_rated_max) #define HWMON_H_RATED_MAX BIT(hwmon_humidity_rated_max)
#define HWMON_H_MIN_ALARM BIT(hwmon_humidity_min_alarm)
#define HWMON_H_MAX_ALARM BIT(hwmon_humidity_max_alarm)
enum hwmon_fan_attributes { enum hwmon_fan_attributes {
hwmon_fan_enable, hwmon_fan_enable,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment