Commit 1007bc36 authored by Ma Jun's avatar Ma Jun Committed by Alex Deucher

drm/amd/pm: Add reset option for fan_ctrl interfaces

Add reset option for fan_ctrl interfaces.

For example:
User can use the "echo r > acoustic_limit_rpm_threshold" command
to reset acoustic_limit_rpm_threshold to boot value
Signed-off-by: default avatarMa Jun <Jun.Ma2@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c66705c5
...@@ -3680,6 +3680,9 @@ static umode_t fan_curve_visible(struct amdgpu_device *adev) ...@@ -3680,6 +3680,9 @@ static umode_t fan_curve_visible(struct amdgpu_device *adev)
* When you have finished the editing, write "c" (commit) to the file to commit * When you have finished the editing, write "c" (commit) to the file to commit
* your changes. * your changes.
* *
* If you want to reset to the default value, write "r" (reset) to the file to
* reset them
*
* This setting works under auto fan control mode only. It adjusts the PMFW's * This setting works under auto fan control mode only. It adjusts the PMFW's
* behavior about the maximum speed in RPM the fan can spin. Setting via this * behavior about the maximum speed in RPM the fan can spin. Setting via this
* interface will switch the fan control to auto mode implicitly. * interface will switch the fan control to auto mode implicitly.
...@@ -3735,6 +3738,9 @@ static umode_t acoustic_limit_threshold_visible(struct amdgpu_device *adev) ...@@ -3735,6 +3738,9 @@ static umode_t acoustic_limit_threshold_visible(struct amdgpu_device *adev)
* When you have finished the editing, write "c" (commit) to the file to commit * When you have finished the editing, write "c" (commit) to the file to commit
* your changes. * your changes.
* *
* If you want to reset to the default value, write "r" (reset) to the file to
* reset them
*
* This setting works under auto fan control mode only. It can co-exist with * This setting works under auto fan control mode only. It can co-exist with
* other settings which can work also under auto mode. It adjusts the PMFW's * other settings which can work also under auto mode. It adjusts the PMFW's
* behavior about the maximum speed in RPM the fan can spin when ASIC * behavior about the maximum speed in RPM the fan can spin when ASIC
...@@ -3792,6 +3798,9 @@ static umode_t acoustic_target_threshold_visible(struct amdgpu_device *adev) ...@@ -3792,6 +3798,9 @@ static umode_t acoustic_target_threshold_visible(struct amdgpu_device *adev)
* When you have finished the editing, write "c" (commit) to the file to commit * When you have finished the editing, write "c" (commit) to the file to commit
* your changes. * your changes.
* *
* If you want to reset to the default value, write "r" (reset) to the file to
* reset them
*
* This setting works under auto fan control mode only. It can co-exist with * This setting works under auto fan control mode only. It can co-exist with
* other settings which can work also under auto mode. Paring with the * other settings which can work also under auto mode. Paring with the
* acoustic_target_rpm_threshold setting, they define the maximum speed in * acoustic_target_rpm_threshold setting, they define the maximum speed in
...@@ -3850,6 +3859,9 @@ static umode_t fan_target_temperature_visible(struct amdgpu_device *adev) ...@@ -3850,6 +3859,9 @@ static umode_t fan_target_temperature_visible(struct amdgpu_device *adev)
* When you have finished the editing, write "c" (commit) to the file to commit * When you have finished the editing, write "c" (commit) to the file to commit
* your changes. * your changes.
* *
* If you want to reset to the default value, write "r" (reset) to the file to
* reset them
*
* This setting works under auto fan control mode only. It can co-exist with * This setting works under auto fan control mode only. It can co-exist with
* other settings which can work also under auto mode. It adjusts the PMFW's * other settings which can work also under auto mode. It adjusts the PMFW's
* behavior about the minimum fan speed in PWM the fan should spin. Setting * behavior about the minimum fan speed in PWM the fan should spin. Setting
......
...@@ -1533,6 +1533,30 @@ static int smu_v13_0_0_od_restore_table_single(struct smu_context *smu, long inp ...@@ -1533,6 +1533,30 @@ static int smu_v13_0_0_od_restore_table_single(struct smu_context *smu, long inp
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO; od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT); od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
break; break;
case PP_OD_EDIT_ACOUSTIC_LIMIT:
od_table->OverDriveTable.AcousticLimitRpmThreshold =
boot_overdrive_table->OverDriveTable.AcousticLimitRpmThreshold;
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
break;
case PP_OD_EDIT_ACOUSTIC_TARGET:
od_table->OverDriveTable.AcousticTargetRpmThreshold =
boot_overdrive_table->OverDriveTable.AcousticTargetRpmThreshold;
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
break;
case PP_OD_EDIT_FAN_TARGET_TEMPERATURE:
od_table->OverDriveTable.FanTargetTemperature =
boot_overdrive_table->OverDriveTable.FanTargetTemperature;
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
break;
case PP_OD_EDIT_FAN_MINIMUM_PWM:
od_table->OverDriveTable.FanMinimumPwm =
boot_overdrive_table->OverDriveTable.FanMinimumPwm;
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
break;
default: default:
dev_info(adev->dev, "Invalid table index: %ld\n", input); dev_info(adev->dev, "Invalid table index: %ld\n", input);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment