ARRAY_SIZE(VddPhyClk), &VddPhyClk[0]);
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency);
- rv_read_arg_from_smc(hwmgr, &result);
+ result = smum_get_argument(hwmgr);
rv_data->gfx_min_freq_limit = result * 100;
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency);
- rv_read_arg_from_smc(hwmgr, &result);
+ result = smum_get_argument(hwmgr);
rv_data->gfx_max_freq_limit = result * 100;
return 0;
switch (type) {
case PP_SCLK:
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetGfxclkFrequency);
- rv_read_arg_from_smc(hwmgr, &now);
+ now = smum_get_argument(hwmgr);
size += sprintf(buf + size, "0: %uMhz %s\n",
data->gfx_min_freq_limit / 100,
break;
case PP_MCLK:
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetFclkFrequency);
- rv_read_arg_from_smc(hwmgr, &now);
+ now = smum_get_argument(hwmgr);
for (i = 0; i < mclk_table->count; i++)
size += sprintf(buf + size, "%d: %uMhz %s\n",
switch (idx) {
case AMDGPU_PP_SENSOR_GFX_SCLK:
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetGfxclkFrequency);
- rv_read_arg_from_smc(hwmgr, &sclk);
+ sclk = smum_get_argument(hwmgr);
/* in units of 10KHZ */
*((uint32_t *)value) = sclk * 100;
*size = 4;
break;
case AMDGPU_PP_SENSOR_GFX_MCLK:
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetFclkFrequency);
- rv_read_arg_from_smc(hwmgr, &mclk);
+ mclk = smum_get_argument(hwmgr);
/* in units of 10KHZ */
*((uint32_t *)value) = mclk * 100;
*size = 4;
return 0;
}
-int rv_read_arg_from_smc(struct pp_hwmgr *hwmgr, uint32_t *arg)
+static int rv_read_arg_from_smc(struct pp_hwmgr *hwmgr)
{
uint32_t reg;
reg = soc15_get_register_offset(MP1_HWID, 0,
mmMP1_SMN_C2PMSG_82_BASE_IDX, mmMP1_SMN_C2PMSG_82);
- *arg = cgs_read_register(hwmgr->device, reg);
-
- return 0;
+ return cgs_read_register(hwmgr->device, reg);
}
int rv_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)
rv_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetDriverIfVersion);
- rv_read_arg_from_smc(hwmgr,
- &smc_driver_if_version);
+ smc_driver_if_version = rv_read_arg_from_smc(hwmgr);
if (smc_driver_if_version != SMU10_DRIVER_IF_VERSION) {
pr_err("Attempt to read SMC IF Version Number Failed!\n");
struct cgs_firmware_info info = {0};
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetSmuVersion);
- rv_read_arg_from_smc(hwmgr, &hwmgr->smu_version);
+ hwmgr->smu_version = rv_read_arg_from_smc(hwmgr);
info.version = hwmgr->smu_version >> 8;
cgs_get_firmware_info(hwmgr->device, CGS_UCODE_ID_SMU, &info);
.send_msg_to_smc_with_parameter = &rv_send_msg_to_smc_with_parameter,
.download_pptable_settings = NULL,
.upload_pptable_settings = NULL,
+ .get_argument = rv_read_arg_from_smc,
};