cpufreq: qcom-hw: enable boost support
authorShawn Guo <shawn.guo@linaro.org>
Wed, 13 Jan 2021 06:52:41 +0000 (14:52 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 18 Jan 2021 06:43:53 +0000 (12:13 +0530)
At least on sdm850, the 2956800 khz is detected as a boost frequency in
function qcom_cpufreq_hw_read_lut().  Let's enable boost support by
calling cpufreq_enable_boost_support(), so that we can get the boost
frequency by switching it on via 'boost' sysfs entry like below.

 $ echo 1 > /sys/devices/system/cpu/cpufreq/boost

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/qcom-cpufreq-hw.c

index 9ed5341..acc645b 100644 (file)
@@ -347,6 +347,12 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
 
        dev_pm_opp_of_register_em(cpu_dev, policy->cpus);
 
+       if (policy_has_boost_freq(policy)) {
+               ret = cpufreq_enable_boost_support();
+               if (ret)
+                       dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
+       }
+
        return 0;
 error:
        devm_iounmap(dev, base);