drm/radeon: move ci_send_msg_to_smc to where it's used
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 29 Sep 2017 14:07:40 +0000 (10:07 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 9 Oct 2017 00:16:28 +0000 (20:16 -0400)
It's used in ci_dpm.c so move it there and make it static.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/ci_dpm.c
drivers/gpu/drm/radeon/ci_dpm.h
drivers/gpu/drm/radeon/ci_smc.c

index c97fbb2ab48b45dc07e1f359caaf1a1df420794d..7e1b04dc55937fbd450b46bdbfcc383af043a180 100644 (file)
@@ -184,6 +184,7 @@ static int ci_set_overdrive_target_tdp(struct radeon_device *rdev,
                                       u32 target_tdp);
 static int ci_update_uvd_dpm(struct radeon_device *rdev, bool gate);
 
+static PPSMC_Result ci_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg);
 static PPSMC_Result ci_send_msg_to_smc_with_parameter(struct radeon_device *rdev,
                                                      PPSMC_Msg msg, u32 parameter);
 
@@ -1651,6 +1652,27 @@ static int ci_notify_hw_of_power_source(struct radeon_device *rdev,
 }
 #endif
 
+static PPSMC_Result ci_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg)
+{
+       u32 tmp;
+       int i;
+
+       if (!ci_is_smc_running(rdev))
+               return PPSMC_Result_Failed;
+
+       WREG32(SMC_MESSAGE_0, msg);
+
+       for (i = 0; i < rdev->usec_timeout; i++) {
+               tmp = RREG32(SMC_RESP_0);
+               if (tmp != 0)
+                       break;
+               udelay(1);
+       }
+       tmp = RREG32(SMC_RESP_0);
+
+       return (PPSMC_Result)tmp;
+}
+
 static PPSMC_Result ci_send_msg_to_smc_with_parameter(struct radeon_device *rdev,
                                                      PPSMC_Msg msg, u32 parameter)
 {
index 723220ffbea246fb36ef35d28835038b0f2750f2..dff2a63df38f7b0182a13a1367e0983bcd4c12ef 100644 (file)
@@ -330,7 +330,6 @@ int ci_program_jump_on_start(struct radeon_device *rdev);
 void ci_stop_smc_clock(struct radeon_device *rdev);
 void ci_start_smc_clock(struct radeon_device *rdev);
 bool ci_is_smc_running(struct radeon_device *rdev);
-PPSMC_Result ci_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg);
 PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev);
 int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit);
 int ci_read_smc_sram_dword(struct radeon_device *rdev,
index 3356a21d97ec2dd6243c4e650c09f3f4c3ce227c..371121913756922d5984d3077dfeaad446fe07b0 100644 (file)
@@ -163,27 +163,6 @@ bool ci_is_smc_running(struct radeon_device *rdev)
        return false;
 }
 
-PPSMC_Result ci_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg)
-{
-       u32 tmp;
-       int i;
-
-       if (!ci_is_smc_running(rdev))
-               return PPSMC_Result_Failed;
-
-       WREG32(SMC_MESSAGE_0, msg);
-
-       for (i = 0; i < rdev->usec_timeout; i++) {
-               tmp = RREG32(SMC_RESP_0);
-               if (tmp != 0)
-                       break;
-               udelay(1);
-       }
-       tmp = RREG32(SMC_RESP_0);
-
-       return (PPSMC_Result)tmp;
-}
-
 #if 0
 PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev)
 {