File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2581,6 +2581,7 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,
2581
2581
{
2582
2582
struct amdgpu_device * adev = dev_get_drvdata (dev );
2583
2583
int err , ret ;
2584
+ u32 pwm_mode ;
2584
2585
int value ;
2585
2586
2586
2587
if (amdgpu_in_reset (adev ))
@@ -2592,13 +2593,22 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,
2592
2593
if (err )
2593
2594
return err ;
2594
2595
2596
+ if (value == 0 )
2597
+ pwm_mode = AMD_FAN_CTRL_NONE ;
2598
+ else if (value == 1 )
2599
+ pwm_mode = AMD_FAN_CTRL_MANUAL ;
2600
+ else if (value == 2 )
2601
+ pwm_mode = AMD_FAN_CTRL_AUTO ;
2602
+ else
2603
+ return - EINVAL ;
2604
+
2595
2605
ret = pm_runtime_get_sync (adev_to_drm (adev )-> dev );
2596
2606
if (ret < 0 ) {
2597
2607
pm_runtime_put_autosuspend (adev_to_drm (adev )-> dev );
2598
2608
return ret ;
2599
2609
}
2600
2610
2601
- ret = amdgpu_dpm_set_fan_control_mode (adev , value );
2611
+ ret = amdgpu_dpm_set_fan_control_mode (adev , pwm_mode );
2602
2612
2603
2613
pm_runtime_mark_last_busy (adev_to_drm (adev )-> dev );
2604
2614
pm_runtime_put_autosuspend (adev_to_drm (adev )-> dev );
You can’t perform that action at this time.
0 commit comments