Commit 0eb52d81 authored by Kevin Wang's avatar Kevin Wang Committed by Alex Deucher

drm/amd/swsmu: allow asic to handle sensor type by itself

1. allow asic to handle sensor type by itself.
2. if not, use smu common sensor to handle it.
Signed-off-by: default avatarKevin Wang <kevin1.wang@amd.com>
Reviewed-by: default avatarKenneth Feng <kenneth.feng@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 48ef409c
......@@ -1948,6 +1948,10 @@ int smu_read_sensor(struct smu_context *smu,
mutex_lock(&smu->mutex);
if (smu->ppt_funcs->read_sensor)
if (!smu->ppt_funcs->read_sensor(smu, sensor, data, size))
goto unlock;
switch (sensor) {
case AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK:
*((uint32_t *)data) = pstate_table->gfxclk_pstate.standard * 100;
......@@ -1978,11 +1982,12 @@ int smu_read_sensor(struct smu_context *smu,
*size = 4;
break;
default:
if (smu->ppt_funcs->read_sensor)
ret = smu->ppt_funcs->read_sensor(smu, sensor, data, size);
*size = 0;
ret = -EOPNOTSUPP;
break;
}
unlock:
mutex_unlock(&smu->mutex);
return ret;
......
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