diff options
author | Wyes Karny <wyes.karny@amd.com> | 2023-01-31 17:00:08 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-02-03 21:59:41 +0100 |
commit | 36c5014e5460963ad7766487c0e22a7ff28681fc (patch) | |
tree | 076fc06c2c38e23fc5e75360b44abae972c1cb1c /include/linux/amd-pstate.h | |
parent | e22abc6bb97cee240200d037a16b73951df16f9a (diff) | |
download | linux-stable-36c5014e5460963ad7766487c0e22a7ff28681fc.tar.gz linux-stable-36c5014e5460963ad7766487c0e22a7ff28681fc.tar.bz2 linux-stable-36c5014e5460963ad7766487c0e22a7ff28681fc.zip |
cpufreq: amd-pstate: optimize driver working mode selection in amd_pstate_param()
The amd-pstate driver may support multiple working modes.
Introduce a variable to keep track of which mode is currently enabled.
Here we use cppc_state var to indicate which mode is enabled.
This change will help to simplify the the amd_pstate_param() to choose
which mode used for the following driver registration.
Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Tested-by: Wyes Karny <wyes.karny@amd.com>
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Wyes Karny <wyes.karny@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/amd-pstate.h')
-rw-r--r-- | include/linux/amd-pstate.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index 1c4b8659f171..dae2ce0f6735 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -74,4 +74,21 @@ struct amd_cpudata { bool boost_supported; }; +/* + * enum amd_pstate_mode - driver working mode of amd pstate + */ +enum amd_pstate_mode { + AMD_PSTATE_DISABLE = 0, + AMD_PSTATE_PASSIVE, + AMD_PSTATE_ACTIVE, + AMD_PSTATE_MAX, +}; + +static const char * const amd_pstate_mode_string[] = { + [AMD_PSTATE_DISABLE] = "disable", + [AMD_PSTATE_PASSIVE] = "passive", + [AMD_PSTATE_ACTIVE] = "active", + NULL, +}; + #endif /* _LINUX_AMD_PSTATE_H */ |