From: Kevin Wang <kevin1.w...@amd.com>

add sensor interface of SCLK and MCKL for sys interface and hwmon.

Signed-off-by: Kevin Wang <kevin1.w...@amd.com>
Reviewed-by: Huang Rui <ray.hu...@amd.com>
Reviewed-by: Evan Quan <evan.q...@amd.com>
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c 
b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 1aef6c6..7c16ece 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -1020,6 +1020,14 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
                ret = smu_v11_0_get_current_activity_percent(smu, data);
                *size = 4;
                break;
+       case AMDGPU_PP_SENSOR_GFX_MCLK:
+               ret = smu_get_current_clk_freq(smu, PPCLK_UCLK, (uint32_t 
*)data);
+               *size = 4;
+               break;
+       case AMDGPU_PP_SENSOR_GFX_SCLK:
+               ret = smu_get_current_clk_freq(smu, PPCLK_GFXCLK, (uint32_t 
*)data);
+               *size = 4;
+               break;
        default:
                ret = -EINVAL;
                break;
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to