[PATCH 16/16] drm/amd/powerplay: Tidy up vega10_thermal_initialize()

Zhu, Rex Rex.Zhu at amd.com
Mon Sep 11 11:06:44 UTC 2017


Series is:
Reviewed-by: Rex Zhu <Rex.Zhu at amd.com>



Best Regards

Rex



________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Tom St Denis <tom.stdenis at amd.com>
Sent: Saturday, September 9, 2017 12:01 AM
To: amd-gfx at lists.freedesktop.org
Cc: StDenis, Tom
Subject: [PATCH 16/16] drm/amd/powerplay: Tidy up vega10_thermal_initialize()

Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
index d5d676595f10..5b3c443d4e94 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
@@ -429,19 +429,16 @@ static int vega10_thermal_initialize(struct pp_hwmgr *hwmgr)
                 reg = soc15_get_register_offset(THM_HWID, 0,
                                 mmCG_TACH_CTRL_BASE_IDX, mmCG_TACH_CTRL);
                 cgs_write_register(hwmgr->device, reg,
-                               (cgs_read_register(hwmgr->device, reg) &
-                               ~CG_TACH_CTRL__EDGE_PER_REV_MASK) |
-                               ((hwmgr->thermal_controller.fanInfo.
-                               ucTachometerPulsesPerRevolution - 1) <<
-                               CG_TACH_CTRL__EDGE_PER_REV__SHIFT));
+                       CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),
+                               CG_TACH_CTRL, EDGE_PER_REV,
+                               hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution - 1));
         }

         reg = soc15_get_register_offset(THM_HWID, 0,
                         mmCG_FDO_CTRL2_BASE_IDX, mmCG_FDO_CTRL2);
         cgs_write_register(hwmgr->device, reg,
-                       (cgs_read_register(hwmgr->device, reg) &
-                       ~CG_FDO_CTRL2__TACH_PWM_RESP_RATE_MASK) |
-                       (0x28 << CG_FDO_CTRL2__TACH_PWM_RESP_RATE__SHIFT));
+               CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),
+                       CG_FDO_CTRL2, TACH_PWM_RESP_RATE, 0x28));

         return 0;
 }
--
2.12.0

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of ...


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20170911/f5c0ecb1/attachment-0001.html>


More information about the amd-gfx mailing list