aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Salvador <osalvador.vilardaga@gmail.com>2017-05-18 17:24:34 -0400
committerBen Skeggs <bskeggs@redhat.com>2017-06-16 00:05:01 -0400
commit02e9722da85246c748894734961fbfe0e543c66d (patch)
treed80b9b0ec97dca4ca0a8a29ed55f71798d24298e
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>
-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 = {
692static const struct attribute_group hwmon_power_caps_attrgroup = { 692static const struct attribute_group hwmon_power_caps_attrgroup = {
693 .attrs = hwmon_power_caps_attributes, 693 .attrs = hwmon_power_caps_attributes,
694}; 694};
695
696static const u32 nouveau_config_chip[] = {
697 HWMON_C_UPDATE_INTERVAL,
698 0
699};
700
701static const u32 nouveau_config_in[] = {
702 HWMON_I_INPUT | HWMON_I_MIN | HWMON_I_MAX | HWMON_I_LABEL,
703 0
704};
705
706static const u32 nouveau_config_temp[] = {
707 HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST |
708 HWMON_T_CRIT | HWMON_T_CRIT_HYST | HWMON_T_EMERGENCY |
709 HWMON_T_EMERGENCY_HYST,
710 0
711};
712
713static const u32 nouveau_config_fan[] = {
714 HWMON_F_INPUT,
715 0
716};
717
718static const u32 nouveau_config_pwm[] = {
719 HWMON_PWM_INPUT | HWMON_PWM_ENABLE,
720 0
721};
722
723static const u32 nouveau_config_power[] = {
724 HWMON_P_INPUT | HWMON_P_CAP_MAX | HWMON_P_CRIT,
725 0
726};
727
728static const struct hwmon_channel_info nouveau_chip = {
729 .type = hwmon_chip,
730 .config = nouveau_config_chip,
731};
732
733static const struct hwmon_channel_info nouveau_temp = {
734 .type = hwmon_temp,
735 .config = nouveau_config_temp,
736};
737
738static const struct hwmon_channel_info nouveau_fan = {
739 .type = hwmon_fan,
740 .config = nouveau_config_fan,
741};
742
743static const struct hwmon_channel_info nouveau_in = {
744 .type = hwmon_in,
745 .config = nouveau_config_in,
746};
747
748static const struct hwmon_channel_info nouveau_pwm = {
749 .type = hwmon_pwm,
750 .config = nouveau_config_pwm,
751};
752
753static const struct hwmon_channel_info nouveau_power = {
754 .type = hwmon_power,
755 .config = nouveau_config_power,
756};
757
758static const struct hwmon_channel_info *nouveau_info[] = {
759 &nouveau_chip,
760 &nouveau_temp,
761 &nouveau_fan,
762 &nouveau_in,
763 &nouveau_pwm,
764 &nouveau_power,
765 NULL
766};
695#endif 767#endif
696 768
697int 769int