summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_hwmon.c
diff options
context:
space:
mode:
authorOscar Salvador <osalvador.vilardaga@gmail.com>2017-05-18 23:24:34 +0200
committerBen Skeggs <bskeggs@redhat.com>2017-06-16 14:05:01 +1000
commit02e9722da85246c748894734961fbfe0e543c66d (patch)
treed80b9b0ec97dca4ca0a8a29ed55f71798d24298e /drivers/gpu/drm/nouveau/nouveau_hwmon.c
parent2863204c6208f8aabeeec163b9d9e827a3da0858 (diff)
drm/nouveau/hwmon: Add config for all sensors and their settings
This is a preparation for the next patches. It just adds the sensors with their possible configurable settings and then fills the struct hwmon_channel_info with all this information. Signed-off-by: Oscar Salvador <osalvador.vilardaga@gmail.com> Reviewed-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_hwmon.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_hwmon.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index 23b1670c1c2f..24b40c5f0836 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -692,6 +692,78 @@ static const struct attribute_group hwmon_power_attrgroup = {
static const struct attribute_group hwmon_power_caps_attrgroup = {
.attrs = hwmon_power_caps_attributes,
};
+
+static const u32 nouveau_config_chip[] = {
+ HWMON_C_UPDATE_INTERVAL,
+ 0
+};
+
+static const u32 nouveau_config_in[] = {
+ HWMON_I_INPUT | HWMON_I_MIN | HWMON_I_MAX | HWMON_I_LABEL,
+ 0
+};
+
+static const u32 nouveau_config_temp[] = {
+ HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST |
+ HWMON_T_CRIT | HWMON_T_CRIT_HYST | HWMON_T_EMERGENCY |
+ HWMON_T_EMERGENCY_HYST,
+ 0
+};
+
+static const u32 nouveau_config_fan[] = {
+ HWMON_F_INPUT,
+ 0
+};
+
+static const u32 nouveau_config_pwm[] = {
+ HWMON_PWM_INPUT | HWMON_PWM_ENABLE,
+ 0
+};
+
+static const u32 nouveau_config_power[] = {
+ HWMON_P_INPUT | HWMON_P_CAP_MAX | HWMON_P_CRIT,
+ 0
+};
+
+static const struct hwmon_channel_info nouveau_chip = {
+ .type = hwmon_chip,
+ .config = nouveau_config_chip,
+};
+
+static const struct hwmon_channel_info nouveau_temp = {
+ .type = hwmon_temp,
+ .config = nouveau_config_temp,
+};
+
+static const struct hwmon_channel_info nouveau_fan = {
+ .type = hwmon_fan,
+ .config = nouveau_config_fan,
+};
+
+static const struct hwmon_channel_info nouveau_in = {
+ .type = hwmon_in,
+ .config = nouveau_config_in,
+};
+
+static const struct hwmon_channel_info nouveau_pwm = {
+ .type = hwmon_pwm,
+ .config = nouveau_config_pwm,
+};
+
+static const struct hwmon_channel_info nouveau_power = {
+ .type = hwmon_power,
+ .config = nouveau_config_power,
+};
+
+static const struct hwmon_channel_info *nouveau_info[] = {
+ &nouveau_chip,
+ &nouveau_temp,
+ &nouveau_fan,
+ &nouveau_in,
+ &nouveau_pwm,
+ &nouveau_power,
+ NULL
+};
#endif
int