drm/amdgpu: refine amdgpu pwm1_enable sysfs interface.
authorRex Zhu <Rex.Zhu@amd.com>
Fri, 5 May 2017 08:56:45 +0000 (16:56 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 May 2017 17:36:21 +0000 (13:36 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

index 990fde2cf4fd366504ea30ad0b4039bb938c77f4..7df503aedb692b86c7111bd81f63ac60eba793c4 100644 (file)
@@ -867,8 +867,7 @@ static ssize_t amdgpu_hwmon_get_pwm1_enable(struct device *dev,
 
        pwm_mode = amdgpu_dpm_get_fan_control_mode(adev);
 
-       /* never 0 (full-speed), fuse or smc-controlled always */
-       return sprintf(buf, "%i\n", pwm_mode == FDO_PWM_MODE_STATIC ? 1 : 2);
+       return sprintf(buf, "%i\n", pwm_mode);
 }
 
 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,
        if (err)
                return err;
 
-       switch (value) {
-       case 1: /* manual, percent-based */
-               amdgpu_dpm_set_fan_control_mode(adev, FDO_PWM_MODE_STATIC);
-               break;
-       default: /* disable */
-               amdgpu_dpm_set_fan_control_mode(adev, 0);
-               break;
-       }
+       amdgpu_dpm_set_fan_control_mode(adev, value);
 
        return count;
 }