summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/ni.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2012-12-14 17:57:36 +0100
committerAlex Deucher <alexander.deucher@amd.com>2013-06-27 16:49:17 +0200
commit29a152218980fee821da952cb4edea2e3231ee0c (patch)
treeabef5398674ab0eeaef42e8a4bb2c68043d73c4a /drivers/gpu/drm/radeon/ni.c
parentdrm/radeon: make get_temperature functions a callback (diff)
downloadlinux-29a152218980fee821da952cb4edea2e3231ee0c.tar.xz
linux-29a152218980fee821da952cb4edea2e3231ee0c.zip
drm/radeon: add support for thermal sensor on tn
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/ni.c')
-rw-r--r--drivers/gpu/drm/radeon/ni.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 84583302b081..f88946160854 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -692,6 +692,14 @@ out:
return err;
}
+int tn_get_temp(struct radeon_device *rdev)
+{
+ u32 temp = RREG32_SMC(TN_CURRENT_GNB_TEMP) & 0x7ff;
+ int actual_temp = (temp / 8) - 49;
+
+ return actual_temp * 1000;
+}
+
/*
* Core functions
*/