diff options
author | Guenter Roeck <linux@roeck-us.net> | 2018-07-17 20:17:19 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2020-01-24 00:15:09 +0300 |
commit | 002c6b545b85676539add33add8aa7f1f49cbfff (patch) | |
tree | edf4b705ecf0454213b22782107c8edc6516c932 /include/linux/hwmon.h | |
parent | 266cd5835947d08b7c963b6d9d9f15d9e481bd0a (diff) | |
download | linux-002c6b545b85676539add33add8aa7f1f49cbfff.tar.xz |
hwmon: Add support for enable attributes to hwmon core
The hwmon ABI supports enable attributes since commit fb41a710f84e
("hwmon: Document the sensor enable attribute"), but did not
add support for those attributes to the hwmon core. Do that now.
Since the enable attributes are logically the most important attributes,
they are added as first attribute to the attribute list. Move
hwmon_in_enable from last to first place for consistency.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/hwmon.h')
-rw-r--r-- | include/linux/hwmon.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index dcda9589cdaf..5e609f25878c 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -60,7 +60,8 @@ enum hwmon_chip_attributes { #define HWMON_C_TEMP_SAMPLES BIT(hwmon_chip_temp_samples) enum hwmon_temp_attributes { - hwmon_temp_input = 0, + hwmon_temp_enable, + hwmon_temp_input, hwmon_temp_type, hwmon_temp_lcrit, hwmon_temp_lcrit_hyst, @@ -86,6 +87,7 @@ enum hwmon_temp_attributes { hwmon_temp_reset_history, }; +#define HWMON_T_ENABLE BIT(hwmon_temp_enable) #define HWMON_T_INPUT BIT(hwmon_temp_input) #define HWMON_T_TYPE BIT(hwmon_temp_type) #define HWMON_T_LCRIT BIT(hwmon_temp_lcrit) @@ -112,6 +114,7 @@ enum hwmon_temp_attributes { #define HWMON_T_RESET_HISTORY BIT(hwmon_temp_reset_history) enum hwmon_in_attributes { + hwmon_in_enable, hwmon_in_input, hwmon_in_min, hwmon_in_max, @@ -127,9 +130,9 @@ enum hwmon_in_attributes { hwmon_in_max_alarm, hwmon_in_lcrit_alarm, hwmon_in_crit_alarm, - hwmon_in_enable, }; +#define HWMON_I_ENABLE BIT(hwmon_in_enable) #define HWMON_I_INPUT BIT(hwmon_in_input) #define HWMON_I_MIN BIT(hwmon_in_min) #define HWMON_I_MAX BIT(hwmon_in_max) @@ -145,9 +148,9 @@ enum hwmon_in_attributes { #define HWMON_I_MAX_ALARM BIT(hwmon_in_max_alarm) #define HWMON_I_LCRIT_ALARM BIT(hwmon_in_lcrit_alarm) #define HWMON_I_CRIT_ALARM BIT(hwmon_in_crit_alarm) -#define HWMON_I_ENABLE BIT(hwmon_in_enable) enum hwmon_curr_attributes { + hwmon_curr_enable, hwmon_curr_input, hwmon_curr_min, hwmon_curr_max, @@ -165,6 +168,7 @@ enum hwmon_curr_attributes { hwmon_curr_crit_alarm, }; +#define HWMON_C_ENABLE BIT(hwmon_curr_enable) #define HWMON_C_INPUT BIT(hwmon_curr_input) #define HWMON_C_MIN BIT(hwmon_curr_min) #define HWMON_C_MAX BIT(hwmon_curr_max) @@ -182,6 +186,7 @@ enum hwmon_curr_attributes { #define HWMON_C_CRIT_ALARM BIT(hwmon_curr_crit_alarm) enum hwmon_power_attributes { + hwmon_power_enable, hwmon_power_average, hwmon_power_average_interval, hwmon_power_average_interval_max, @@ -212,6 +217,7 @@ enum hwmon_power_attributes { hwmon_power_crit_alarm, }; +#define HWMON_P_ENABLE BIT(hwmon_power_enable) #define HWMON_P_AVERAGE BIT(hwmon_power_average) #define HWMON_P_AVERAGE_INTERVAL BIT(hwmon_power_average_interval) #define HWMON_P_AVERAGE_INTERVAL_MAX BIT(hwmon_power_average_interval_max) @@ -242,14 +248,17 @@ enum hwmon_power_attributes { #define HWMON_P_CRIT_ALARM BIT(hwmon_power_crit_alarm) enum hwmon_energy_attributes { + hwmon_energy_enable, hwmon_energy_input, hwmon_energy_label, }; +#define HWMON_E_ENABLE BIT(hwmon_energy_enable) #define HWMON_E_INPUT BIT(hwmon_energy_input) #define HWMON_E_LABEL BIT(hwmon_energy_label) enum hwmon_humidity_attributes { + hwmon_humidity_enable, hwmon_humidity_input, hwmon_humidity_label, hwmon_humidity_min, @@ -260,6 +269,7 @@ enum hwmon_humidity_attributes { hwmon_humidity_fault, }; +#define HWMON_H_ENABLE BIT(hwmon_humidity_enable) #define HWMON_H_INPUT BIT(hwmon_humidity_input) #define HWMON_H_LABEL BIT(hwmon_humidity_label) #define HWMON_H_MIN BIT(hwmon_humidity_min) @@ -270,6 +280,7 @@ enum hwmon_humidity_attributes { #define HWMON_H_FAULT BIT(hwmon_humidity_fault) enum hwmon_fan_attributes { + hwmon_fan_enable, hwmon_fan_input, hwmon_fan_label, hwmon_fan_min, @@ -283,6 +294,7 @@ enum hwmon_fan_attributes { hwmon_fan_fault, }; +#define HWMON_F_ENABLE BIT(hwmon_fan_enable) #define HWMON_F_INPUT BIT(hwmon_fan_input) #define HWMON_F_LABEL BIT(hwmon_fan_label) #define HWMON_F_MIN BIT(hwmon_fan_min) |