diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-02-06 09:25:56 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-02-06 09:25:56 -0300 |
commit | ab809efaeba0cca20cfcda23852b0ee958f6ea69 (patch) | |
tree | 36b168deb9908cba8605bb8fa026bdacc26560db /drivers/platform/x86/amd/pmf/sps.c | |
parent | 17f248aa8664ff5b3643491136283e73b5c18166 (diff) | |
parent | d2d11f342b179f1894a901f143ec7c008caba43e (diff) | |
download | linux-stable-ab809efaeba0cca20cfcda23852b0ee958f6ea69.tar.gz linux-stable-ab809efaeba0cca20cfcda23852b0ee958f6ea69.tar.bz2 linux-stable-ab809efaeba0cca20cfcda23852b0ee958f6ea69.zip |
Merge remote-tracking branch 'torvalds/master' into perf/core
To sync with libbpf, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'drivers/platform/x86/amd/pmf/sps.c')
-rw-r--r-- | drivers/platform/x86/amd/pmf/sps.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/platform/x86/amd/pmf/sps.c b/drivers/platform/x86/amd/pmf/sps.c index dba7e36962dc..bed762d47a14 100644 --- a/drivers/platform/x86/amd/pmf/sps.c +++ b/drivers/platform/x86/amd/pmf/sps.c @@ -70,6 +70,24 @@ void amd_pmf_update_slider(struct amd_pmf_dev *dev, bool op, int idx, } } +int amd_pmf_set_sps_power_limits(struct amd_pmf_dev *pmf) +{ + int mode; + + mode = amd_pmf_get_pprof_modes(pmf); + if (mode < 0) + return mode; + + amd_pmf_update_slider(pmf, SLIDER_OP_SET, mode, NULL); + + return 0; +} + +bool is_pprof_balanced(struct amd_pmf_dev *pmf) +{ + return (pmf->current_profile == PLATFORM_PROFILE_BALANCED) ? true : false; +} + static int amd_pmf_profile_get(struct platform_profile_handler *pprof, enum platform_profile_option *profile) { @@ -105,15 +123,10 @@ static int amd_pmf_profile_set(struct platform_profile_handler *pprof, enum platform_profile_option profile) { struct amd_pmf_dev *pmf = container_of(pprof, struct amd_pmf_dev, pprof); - int mode; pmf->current_profile = profile; - mode = amd_pmf_get_pprof_modes(pmf); - if (mode < 0) - return mode; - amd_pmf_update_slider(pmf, SLIDER_OP_SET, mode, NULL); - return 0; + return amd_pmf_set_sps_power_limits(pmf); } int amd_pmf_init_sps(struct amd_pmf_dev *dev) @@ -123,6 +136,9 @@ int amd_pmf_init_sps(struct amd_pmf_dev *dev) dev->current_profile = PLATFORM_PROFILE_BALANCED; amd_pmf_load_defaults_sps(dev); + /* update SPS balanced power mode thermals */ + amd_pmf_set_sps_power_limits(dev); + dev->pprof.profile_get = amd_pmf_profile_get; dev->pprof.profile_set = amd_pmf_profile_set; |