mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
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: Zhang Rui <rui.zhang@intel.com> [srinivas.pandruvada@linux.intel.com: changelog edits] Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
This commit is contained in:
parent
904d2baa8b
commit
43314e798c
3 changed files with 23 additions and 15 deletions
|
@ -713,6 +713,25 @@ static int mbox_pm_qos_config(struct isst_id *id, int enable_clos, int priority_
|
||||||
return 0;
|
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 = {
|
static struct isst_platform_ops mbox_ops = {
|
||||||
.get_disp_freq_multiplier = mbox_get_disp_freq_multiplier,
|
.get_disp_freq_multiplier = mbox_get_disp_freq_multiplier,
|
||||||
.get_trl_max_levels = mbox_get_trl_max_levels,
|
.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_uncore_p0_p1_info = mbox_get_uncore_p0_p1_info,
|
||||||
.get_clos_information = mbox_get_clos_information,
|
.get_clos_information = mbox_get_clos_information,
|
||||||
.pm_qos_config = mbox_pm_qos_config,
|
.pm_qos_config = mbox_pm_qos_config,
|
||||||
|
.pm_get_clos = mbox_pm_get_clos,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct isst_platform_ops *mbox_get_platform_ops(void)
|
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)
|
int isst_pm_get_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
|
||||||
{
|
{
|
||||||
unsigned int resp;
|
CHECK_CB(pm_get_clos);
|
||||||
int ret;
|
return isst_ops->pm_get_clos(id, clos, clos_config);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int isst_set_clos(struct isst_id *id, int clos, struct isst_clos_config *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);
|
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 (*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_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);
|
extern int is_cpu_in_power_domain(int cpu, struct isst_id *id);
|
||||||
|
|
Loading…
Reference in a new issue