diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index a9f68753ec7f..68548fbdee09 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -1120,12 +1120,19 @@ static ssize_t amdgpu_hwmon_set_pwm1(struct device *dev, | |||
1120 | struct amdgpu_device *adev = dev_get_drvdata(dev); | 1120 | struct amdgpu_device *adev = dev_get_drvdata(dev); |
1121 | int err; | 1121 | int err; |
1122 | u32 value; | 1122 | u32 value; |
1123 | u32 pwm_mode; | ||
1123 | 1124 | ||
1124 | /* Can't adjust fan when the card is off */ | 1125 | /* Can't adjust fan when the card is off */ |
1125 | if ((adev->flags & AMD_IS_PX) && | 1126 | if ((adev->flags & AMD_IS_PX) && |
1126 | (adev->ddev->switch_power_state != DRM_SWITCH_POWER_ON)) | 1127 | (adev->ddev->switch_power_state != DRM_SWITCH_POWER_ON)) |
1127 | return -EINVAL; | 1128 | return -EINVAL; |
1128 | 1129 | ||
1130 | pwm_mode = amdgpu_dpm_get_fan_control_mode(adev); | ||
1131 | if (pwm_mode != AMD_FAN_CTRL_MANUAL) { | ||
1132 | pr_info("manual fan speed control should be enabled first\n"); | ||
1133 | return -EINVAL; | ||
1134 | } | ||
1135 | |||
1129 | err = kstrtou32(buf, 10, &value); | 1136 | err = kstrtou32(buf, 10, &value); |
1130 | if (err) | 1137 | if (err) |
1131 | return err; | 1138 | return err; |