summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
diff options
context:
space:
mode:
authorLikun Gao2019-01-25 11:29:31 +0100
committerAlex Deucher2019-03-19 21:04:01 +0100
commit637c1c6644a907a89965fd04d7308fb2e61b6d0c (patch)
tree01a6b1ca978b24dc158b922d27f9ad1748fd0b2f /drivers/gpu/drm/amd/powerplay/smu_v11_0.c
parentdrm/amd/powerplay: debugfs don't check powerplay when SW SMU is enabled. (diff)
downloadkernel-qcow2-linux-637c1c6644a907a89965fd04d7308fb2e61b6d0c.tar.gz
kernel-qcow2-linux-637c1c6644a907a89965fd04d7308fb2e61b6d0c.tar.xz
kernel-qcow2-linux-637c1c6644a907a89965fd04d7308fb2e61b6d0c.zip
drm/amd/powerplay: add fan rpm limit interface for hwmon
Add fan1_min and fan2_max function for hwmon. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/smu_v11_0.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/smu_v11_0.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 48174df19105..8d2531845fd8 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -1092,6 +1092,8 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
enum amd_pp_sensors sensor,
void *data, uint32_t *size)
{
+ struct smu_table_context *table_context = &smu->smu_table;
+ PPTable_t *pptable = table_context->driver_pptable;
int ret = 0;
switch (sensor) {
case AMDGPU_PP_SENSOR_GPU_LOAD:
@@ -1127,6 +1129,14 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
*(uint32_t *)data = smu_feature_is_enabled(smu, FEATURE_DPM_VCE_BIT) ? 1 : 0;
*size = 4;
break;
+ case AMDGPU_PP_SENSOR_MIN_FAN_RPM:
+ *(uint32_t *)data = 0;
+ *size = 4;
+ break;
+ case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
+ *(uint32_t *)data = pptable->FanMaximumRpm;
+ *size = 4;
+ break;
default:
ret = smu_common_read_sensor(smu, sensor, data, size);
break;