diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2017-05-05 04:56:45 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-10 13:36:21 -0400 |
commit | aad22ca4368082cdd1cff1c55d8607c94ea1a74b (patch) | |
tree | dfe852600c25f34f91b626c159a82546ae7b5914 /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
parent | 4f93f09e5c3e59e72aa1ae877b24ae0cacdfdfa8 (diff) |
drm/amdgpu: refine amdgpu pwm1_enable sysfs interface.
Make the interface consistent.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 990fde2cf4fd..7df503aedb69 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -867,8 +867,7 @@ static ssize_t amdgpu_hwmon_get_pwm1_enable(struct device *dev, | |||
867 | 867 | ||
868 | pwm_mode = amdgpu_dpm_get_fan_control_mode(adev); | 868 | pwm_mode = amdgpu_dpm_get_fan_control_mode(adev); |
869 | 869 | ||
870 | /* never 0 (full-speed), fuse or smc-controlled always */ | 870 | return sprintf(buf, "%i\n", pwm_mode); |
871 | return sprintf(buf, "%i\n", pwm_mode == FDO_PWM_MODE_STATIC ? 1 : 2); | ||
872 | } | 871 | } |
873 | 872 | ||
874 | static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev, | 873 | static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev, |
@@ -887,14 +886,7 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev, | |||
887 | if (err) | 886 | if (err) |
888 | return err; | 887 | return err; |
889 | 888 | ||
890 | switch (value) { | 889 | amdgpu_dpm_set_fan_control_mode(adev, value); |
891 | case 1: /* manual, percent-based */ | ||
892 | amdgpu_dpm_set_fan_control_mode(adev, FDO_PWM_MODE_STATIC); | ||
893 | break; | ||
894 | default: /* disable */ | ||
895 | amdgpu_dpm_set_fan_control_mode(adev, 0); | ||
896 | break; | ||
897 | } | ||
898 | 890 | ||
899 | return count; | 891 | return count; |
900 | } | 892 | } |