ret = smu_get_current_clk_freq(smu, clk_type, &cur_value);
if (ret)
return size;
+ /* 10KHz -> MHz */
+ cur_value = cur_value / 100;
size += sprintf(buf, "current clk: %uMhz\n", cur_value);
/* if don't has GetDpmClockFreq Message, try get current clock by SmuMetrics_t */
if (smu_msg_get_index(smu, SMU_MSG_GetDpmClockFreq) == 0)
- return smu_get_current_clk_freq_by_table(smu, clk_id, value);
-
- ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetDpmClockFreq,
- (smu_clk_get_index(smu, clk_id) << 16));
- if (ret)
- return ret;
+ ret = smu_get_current_clk_freq_by_table(smu, clk_id, &freq);
+ else {
+ ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetDpmClockFreq,
+ (smu_clk_get_index(smu, clk_id) << 16));
+ if (ret)
+ return ret;
- ret = smu_read_smc_arg(smu, &freq);
- if (ret)
- return ret;
+ ret = smu_read_smc_arg(smu, &freq);
+ if (ret)
+ return ret;
+ }
freq *= 100;
*value = freq;