diff options
author | Guenter Roeck <linux@roeck-us.net> | 2019-04-15 16:23:48 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2019-04-15 20:19:53 -0400 |
commit | 9f00995e4eb293679597d76462fec2ce152e3500 (patch) | |
tree | 34b245975a4631e2a136e357daad4f735c0398ef | |
parent | 5d9e8b3f809f1c12e32fea7061ad2319d2848600 (diff) |
hwmon: Add support for samples attributes
Add support for the new samples attributes to the hwmon core.
Cc: Krzysztof Adamski <krzysztof.adamski@nokia.com>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/hwmon.c | 5 | ||||
-rw-r--r-- | include/linux/hwmon.h | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index c22dc1e07911..cd91510a5387 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c | |||
@@ -324,6 +324,11 @@ static const char * const hwmon_chip_attrs[] = { | |||
324 | [hwmon_chip_power_reset_history] = "power_reset_history", | 324 | [hwmon_chip_power_reset_history] = "power_reset_history", |
325 | [hwmon_chip_update_interval] = "update_interval", | 325 | [hwmon_chip_update_interval] = "update_interval", |
326 | [hwmon_chip_alarms] = "alarms", | 326 | [hwmon_chip_alarms] = "alarms", |
327 | [hwmon_chip_samples] = "samples", | ||
328 | [hwmon_chip_curr_samples] = "curr_samples", | ||
329 | [hwmon_chip_in_samples] = "in_samples", | ||
330 | [hwmon_chip_power_samples] = "power_samples", | ||
331 | [hwmon_chip_temp_samples] = "temp_samples", | ||
327 | }; | 332 | }; |
328 | 333 | ||
329 | static const char * const hwmon_temp_attr_templates[] = { | 334 | static const char * const hwmon_temp_attr_templates[] = { |
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 7a8cc06a0d61..2b949fa501e1 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h | |||
@@ -40,6 +40,11 @@ enum hwmon_chip_attributes { | |||
40 | hwmon_chip_register_tz, | 40 | hwmon_chip_register_tz, |
41 | hwmon_chip_update_interval, | 41 | hwmon_chip_update_interval, |
42 | hwmon_chip_alarms, | 42 | hwmon_chip_alarms, |
43 | hwmon_chip_samples, | ||
44 | hwmon_chip_curr_samples, | ||
45 | hwmon_chip_in_samples, | ||
46 | hwmon_chip_power_samples, | ||
47 | hwmon_chip_temp_samples, | ||
43 | }; | 48 | }; |
44 | 49 | ||
45 | #define HWMON_C_TEMP_RESET_HISTORY BIT(hwmon_chip_temp_reset_history) | 50 | #define HWMON_C_TEMP_RESET_HISTORY BIT(hwmon_chip_temp_reset_history) |
@@ -49,6 +54,11 @@ enum hwmon_chip_attributes { | |||
49 | #define HWMON_C_REGISTER_TZ BIT(hwmon_chip_register_tz) | 54 | #define HWMON_C_REGISTER_TZ BIT(hwmon_chip_register_tz) |
50 | #define HWMON_C_UPDATE_INTERVAL BIT(hwmon_chip_update_interval) | 55 | #define HWMON_C_UPDATE_INTERVAL BIT(hwmon_chip_update_interval) |
51 | #define HWMON_C_ALARMS BIT(hwmon_chip_alarms) | 56 | #define HWMON_C_ALARMS BIT(hwmon_chip_alarms) |
57 | #define HWMON_C_SAMPLES BIT(hwmon_chip_samples) | ||
58 | #define HWMON_C_CURR_SAMPLES BIT(hwmon_chip_curr_samples) | ||
59 | #define HWMON_C_IN_SAMPLES BIT(hwmon_chip_in_samples) | ||
60 | #define HWMON_C_POWER_SAMPLES BIT(hwmon_chip_power_samples) | ||
61 | #define HWMON_C_TEMP_SAMPLES BIT(hwmon_chip_temp_samples) | ||
52 | 62 | ||
53 | enum hwmon_temp_attributes { | 63 | enum hwmon_temp_attributes { |
54 | hwmon_temp_input = 0, | 64 | hwmon_temp_input = 0, |