Commit 657b1f46 authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher

drm/amd/powerplay: Tidy up vega10_fan_ctrl_set_fan_speed_rpm()

Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1f9ba3be
...@@ -330,8 +330,8 @@ int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed) ...@@ -330,8 +330,8 @@ int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed)
uint32_t reg; uint32_t reg;
if (hwmgr->thermal_controller.fanInfo.bNoFan || if (hwmgr->thermal_controller.fanInfo.bNoFan ||
(speed < hwmgr->thermal_controller.fanInfo.ulMinRPM) || (speed < hwmgr->thermal_controller.fanInfo.ulMinRPM) ||
(speed > hwmgr->thermal_controller.fanInfo.ulMaxRPM)) (speed > hwmgr->thermal_controller.fanInfo.ulMaxRPM))
return -1; return -1;
if (PP_CAP(PHM_PlatformCaps_MicrocodeFanControl)) if (PP_CAP(PHM_PlatformCaps_MicrocodeFanControl))
...@@ -343,9 +343,9 @@ int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed) ...@@ -343,9 +343,9 @@ int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed)
reg = soc15_get_register_offset(THM_HWID, 0, reg = soc15_get_register_offset(THM_HWID, 0,
mmCG_TACH_STATUS_BASE_IDX, mmCG_TACH_STATUS); mmCG_TACH_STATUS_BASE_IDX, mmCG_TACH_STATUS);
cgs_write_register(hwmgr->device, reg, cgs_write_register(hwmgr->device, reg,
(cgs_read_register(hwmgr->device, reg) & CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),
~CG_TACH_STATUS__TACH_PERIOD_MASK) | CG_TACH_STATUS, TACH_PERIOD,
(tach_period << CG_TACH_STATUS__TACH_PERIOD__SHIFT)); tach_period));
} }
return vega10_fan_ctrl_set_static_mode(hwmgr, FDO_PWM_MODE_STATIC_RPM); return vega10_fan_ctrl_set_static_mode(hwmgr, FDO_PWM_MODE_STATIC_RPM);
} }
......
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