drm/amd/powerplay: Tidy up vega10_fan_ctrl_set_default_mode()
authorTom St Denis <tom.stdenis@amd.com>
Thu, 7 Sep 2017 16:26:42 +0000 (12:26 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 12 Sep 2017 18:31:59 +0000 (14:31 -0400)
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c

index 4e364035945c44779d493178f6ea24b434e1d591..cda7fcfeefd7b1430509477f21e583077b56cce3 100644 (file)
@@ -173,14 +173,13 @@ int vega10_fan_ctrl_set_default_mode(struct pp_hwmgr *hwmgr)
 
        if (!hwmgr->fan_ctrl_is_in_default_mode) {
                cgs_write_register(hwmgr->device, reg,
-                               (cgs_read_register(hwmgr->device, reg) &
-                               ~CG_FDO_CTRL2__FDO_PWM_MODE_MASK) |
-                               (hwmgr->fan_ctrl_default_mode <<
-                               CG_FDO_CTRL2__FDO_PWM_MODE__SHIFT));
+                       CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),
+                               CG_FDO_CTRL2, FDO_PWM_MODE,
+                               hwmgr->fan_ctrl_default_mode));
                cgs_write_register(hwmgr->device, reg,
-                               (cgs_read_register(hwmgr->device, reg) &
-                               ~CG_FDO_CTRL2__TMIN_MASK) |
-                               (hwmgr->tmin << CG_FDO_CTRL2__TMIN__SHIFT));
+                       CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),
+                               CG_FDO_CTRL2, TMIN,
+                               hwmgr->tmin << CG_FDO_CTRL2__TMIN__SHIFT));
                hwmgr->fan_ctrl_is_in_default_mode = true;
        }