Fw: [PATCH 2/5] drm/amdgpu: refine pwm1_enable call back functions.

Zhu, Rex Rex.Zhu at amd.com
Fri May 5 12:42:57 UTC 2017


Change-Id: Ie5fe90762f75497fab68b913874956bbeab11e72
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 12 ++----------
 1 file 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 e00ed19..1d9d571 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,

         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;
 }
--
1.9.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20170505/ce357b72/attachment-0001.html>


More information about the amd-gfx mailing list