Commit 43314e79 authored by Zhang Rui's avatar Zhang Rui Committed by Srinivas Pandruvada

tools/power/x86/intel-speed-select: Abstract pm_get_clos

Allow platform specific implementation to get CLOS priority setting.

No functional changes are expected.
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
[srinivas.pandruvada@linux.intel.com: changelog edits]
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
parent 904d2baa
......@@ -713,6 +713,25 @@ static int mbox_pm_qos_config(struct isst_id *id, int enable_clos, int priority_
return 0;
}
static int mbox_pm_get_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
{
unsigned int resp;
int ret;
ret = isst_send_mbox_command(id->cpu, CONFIG_CLOS, CLOS_PM_CLOS, clos, 0,
&resp);
if (ret)
return ret;
clos_config->epp = resp & 0x0f;
clos_config->clos_prop_prio = (resp >> 4) & 0x0f;
clos_config->clos_min = (resp >> 8) & 0xff;
clos_config->clos_max = (resp >> 16) & 0xff;
clos_config->clos_desired = (resp >> 24) & 0xff;
return 0;
}
static struct isst_platform_ops mbox_ops = {
.get_disp_freq_multiplier = mbox_get_disp_freq_multiplier,
.get_trl_max_levels = mbox_get_trl_max_levels,
......@@ -733,6 +752,7 @@ static struct isst_platform_ops mbox_ops = {
.get_uncore_p0_p1_info = mbox_get_uncore_p0_p1_info,
.get_clos_information = mbox_get_clos_information,
.pm_qos_config = mbox_pm_qos_config,
.pm_get_clos = mbox_pm_get_clos,
};
struct isst_platform_ops *mbox_get_platform_ops(void)
......
......@@ -627,21 +627,8 @@ int isst_pm_qos_config(struct isst_id *id, int enable_clos, int priority_type)
int isst_pm_get_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
{
unsigned int resp;
int ret;
ret = isst_send_mbox_command(id->cpu, CONFIG_CLOS, CLOS_PM_CLOS, clos, 0,
&resp);
if (ret)
return ret;
clos_config->epp = resp & 0x0f;
clos_config->clos_prop_prio = (resp >> 4) & 0x0f;
clos_config->clos_min = (resp >> 8) & 0xff;
clos_config->clos_max = (resp >> 16) & 0xff;
clos_config->clos_desired = (resp >> 24) & 0xff;
return 0;
CHECK_CB(pm_get_clos);
return isst_ops->pm_get_clos(id, clos, clos_config);
}
int isst_set_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
......
......@@ -201,6 +201,7 @@ struct isst_platform_ops {
void (*get_uncore_p0_p1_info)(struct isst_id *id, int config_index, struct isst_pkg_ctdp_level_info *ctdp_level);
int (*get_clos_information)(struct isst_id *id, int *enable, int *type);
int (*pm_qos_config)(struct isst_id *id, int enable_clos, int priority_type);
int (*pm_get_clos)(struct isst_id *id, int clos, struct isst_clos_config *clos_config);
};
extern int is_cpu_in_power_domain(int cpu, struct isst_id *id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment