<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Rex Zhu <rex.zhu@amd.com><br>
<b>Sent:</b> Wednesday, July 25, 2018 1:03:12 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH 1/2] drm/amd/pp: Convert voltage unit in mV*4 to mV on CZ/ST</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">the voltage showed in debugfs and hwmon should be in mV<br>
<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | 5 +++--<br>
 1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c<br>
index cafa822..b863704 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c<br>
@@ -244,6 +244,7 @@ static int smu8_initialize_dpm_defaults(struct pp_hwmgr *hwmgr)<br>
         return 0;<br>
 }<br>
 <br>
+/* convert form 8bit vid to real voltage in mV*4 */<br>
 static uint32_t smu8_convert_8Bit_index_to_voltage(<br>
                         struct pp_hwmgr *hwmgr, uint16_t voltage)<br>
 {<br>
@@ -1707,13 +1708,13 @@ static int smu8_read_sensor(struct pp_hwmgr *hwmgr, int idx,<br>
         case AMDGPU_PP_SENSOR_VDDNB:<br>
                 tmp = (cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixSMUSVI_NB_CURRENTVID) &<br>
                         CURRENT_NB_VID_MASK) >> CURRENT_NB_VID__SHIFT;<br>
-               vddnb = smu8_convert_8Bit_index_to_voltage(hwmgr, tmp);<br>
+               vddnb = smu8_convert_8Bit_index_to_voltage(hwmgr, tmp) / 4;<br>
                 *((uint32_t *)value) = vddnb;<br>
                 return 0;<br>
         case AMDGPU_PP_SENSOR_VDDGFX:<br>
                 tmp = (cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixSMUSVI_GFX_CURRENTVID) &<br>
                         CURRENT_GFX_VID_MASK) >> CURRENT_GFX_VID__SHIFT;<br>
-               vddgfx = smu8_convert_8Bit_index_to_voltage(hwmgr, (u16)tmp);<br>
+               vddgfx = smu8_convert_8Bit_index_to_voltage(hwmgr, (u16)tmp) / 4;<br>
                 *((uint32_t *)value) = vddgfx;<br>
                 return 0;<br>
         case AMDGPU_PP_SENSOR_UVD_VCLK:<br>
-- <br>
1.9.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>