Commit 154061db authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/dpm: implement thermal sensor for CZ/ST

Previous code was just a copy/paste from KV.
Reviewed-by: default avatarTom St Denis <tom.stdenis@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ca3d28de
...@@ -1514,14 +1514,16 @@ static int cz_dpm_set_powergating_state(void *handle, ...@@ -1514,14 +1514,16 @@ static int cz_dpm_set_powergating_state(void *handle,
return 0; return 0;
} }
/* borrowed from KV, need future unify */
static int cz_dpm_get_temperature(struct amdgpu_device *adev) static int cz_dpm_get_temperature(struct amdgpu_device *adev)
{ {
int actual_temp = 0; int actual_temp = 0;
uint32_t temp = RREG32_SMC(0xC0300E0C); uint32_t val = RREG32_SMC(ixTHM_TCON_CUR_TMP);
uint32_t temp = REG_GET_FIELD(val, THM_TCON_CUR_TMP, CUR_TEMP);
if (temp) if (REG_GET_FIELD(val, THM_TCON_CUR_TMP, CUR_TEMP_RANGE_SEL))
actual_temp = 1000 * ((temp / 8) - 49); actual_temp = 1000 * ((temp / 8) - 49);
else
actual_temp = 1000 * (temp / 8);
return actual_temp; return actual_temp;
} }
......
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