Commit 3466a8f0 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: maximum code sharing on sensor reading

Move the common code to amdgpu_smu.c instead of having one
copy in both smu_v11_0.c and smu_v12_0.c.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5675123d
...@@ -2322,6 +2322,10 @@ int smu_read_sensor(struct smu_context *smu, ...@@ -2322,6 +2322,10 @@ int smu_read_sensor(struct smu_context *smu,
*(uint32_t *)data = smu->smu_power.power_gate.vcn_gated ? 0 : 1; *(uint32_t *)data = smu->smu_power.power_gate.vcn_gated ? 0 : 1;
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_MIN_FAN_RPM:
*(uint32_t *)data = 0;
*size = 4;
break;
default: default:
if (smu->ppt_funcs->read_sensor) if (smu->ppt_funcs->read_sensor)
ret = smu->ppt_funcs->read_sensor(smu, sensor, data, size); ret = smu->ppt_funcs->read_sensor(smu, sensor, data, size);
......
...@@ -1193,10 +1193,6 @@ int smu_v11_0_read_sensor(struct smu_context *smu, ...@@ -1193,10 +1193,6 @@ int smu_v11_0_read_sensor(struct smu_context *smu,
ret = smu_v11_0_get_gfx_vdd(smu, (uint32_t *)data); ret = smu_v11_0_get_gfx_vdd(smu, (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_MIN_FAN_RPM:
*(uint32_t *)data = 0;
*size = 4;
break;
default: default:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
......
...@@ -221,10 +221,6 @@ int smu_v12_0_read_sensor(struct smu_context *smu, ...@@ -221,10 +221,6 @@ int smu_v12_0_read_sensor(struct smu_context *smu,
ret = smu_get_current_clk_freq(smu, SMU_GFXCLK, (uint32_t *)data); ret = smu_get_current_clk_freq(smu, SMU_GFXCLK, (uint32_t *)data);
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_MIN_FAN_RPM:
*(uint32_t *)data = 0;
*size = 4;
break;
default: default:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
......
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