summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2016-08-16 21:38:19 +0800
committerAlex Deucher <alexander.deucher@amd.com>2016-09-14 15:10:35 -0400
commit026c881046a352c9ac4f68bb84a5f6c9bc4a7d73 (patch)
tree2d67e9a31dc806c7e82317de5073f8fe303fa539 /drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
parent8bea2527faa13dad21e4307af77b292a8e4ded2f (diff)
downloadlinux-026c881046a352c9ac4f68bb84a5f6c9bc4a7d73.tar.gz
linux-026c881046a352c9ac4f68bb84a5f6c9bc4a7d73.tar.xz
drm/amd/powerplay: wrap get evv voltage functions
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
index cb417c60321c..ca6347142120 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
@@ -697,3 +697,20 @@ int hwmgr_set_user_specify_caps(struct pp_hwmgr *hwmgr)
return 0;
}
+int phm_get_voltage_evv_on_sclk(struct pp_hwmgr *hwmgr, uint8_t voltage_type,
+ uint32_t sclk, uint16_t id, uint16_t *voltage)
+{
+ uint32_t vol;
+ int ret = 0;
+
+ if (hwmgr->chip_id < CHIP_POLARIS10) {
+ atomctrl_get_voltage_evv_on_sclk(hwmgr, voltage_type, sclk, id, voltage);
+ if (*voltage >= 2000 || *voltage == 0)
+ *voltage = 1150;
+ } else {
+ ret = atomctrl_get_voltage_evv_on_sclk_ai(hwmgr, voltage_type, sclk, id, &vol);
+ *voltage = (uint16_t)vol/100;
+ }
+ return ret;
+}
+