aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
diff options
context:
space:
mode:
authorLikun Gao <Likun.Gao@amd.com>2019-01-25 04:45:24 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 16:04:01 -0400
commit96026ce0199c4c0c3d19dd0673dcbaf55e2897d3 (patch)
tree444ebad524697e86200b7044c85d2039f5555915 /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
parentda5f18e8e8cbafe722c679803cd69d03aea22db4 (diff)
drm/amd/powerplay: set fan target interface for hwmon
Add fan1_target set interface to set fan speed for hwmon. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 3875a62352de..d3efba85683f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1606,7 +1606,11 @@ static ssize_t amdgpu_hwmon_set_fan1_target(struct device *dev,
1606 u32 value; 1606 u32 value;
1607 u32 pwm_mode; 1607 u32 pwm_mode;
1608 1608
1609 pwm_mode = amdgpu_dpm_get_fan_control_mode(adev); 1609 if (is_support_sw_smu(adev))
1610 pwm_mode = smu_get_fan_control_mode(&adev->smu);
1611 else
1612 pwm_mode = amdgpu_dpm_get_fan_control_mode(adev);
1613
1610 if (pwm_mode != AMD_FAN_CTRL_MANUAL) 1614 if (pwm_mode != AMD_FAN_CTRL_MANUAL)
1611 return -ENODATA; 1615 return -ENODATA;
1612 1616
@@ -1619,7 +1623,11 @@ static ssize_t amdgpu_hwmon_set_fan1_target(struct device *dev,
1619 if (err) 1623 if (err)
1620 return err; 1624 return err;
1621 1625
1622 if (adev->powerplay.pp_funcs->set_fan_speed_rpm) { 1626 if (is_support_sw_smu(adev)) {
1627 err = smu_set_fan_speed_rpm(&adev->smu, value);
1628 if (err)
1629 return err;
1630 } else if (adev->powerplay.pp_funcs->set_fan_speed_rpm) {
1623 err = amdgpu_dpm_set_fan_speed_rpm(adev, value); 1631 err = amdgpu_dpm_set_fan_speed_rpm(adev, value);
1624 if (err) 1632 if (err)
1625 return err; 1633 return err;