mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
cpufreq: Allow drivers to enable boost support after registering driver
In some cases it wouldn't be known at time of driver registration, if the driver needs to support boost frequencies. For example, while getting boost information from DT with opp-v2 bindings, we need to parse the bindings for all the CPUs to know if turbo/boost OPPs are supported or not. One way out to do that efficiently is to delay supporting boost mode (i.e. creating /sys/devices/system/cpu/cpufreq/boost file), until the time OPP bindings are parsed. At that point, the driver can enable boost support. This can be done at ->init(), where the frequency table is created. To do that, the driver requires few APIs from cpufreq core that let him do this. This patch provides these APIs. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
79eea44a5d
commit
44139ed494
3 changed files with 75 additions and 20 deletions
|
@ -578,6 +578,8 @@ ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
|
|||
int cpufreq_boost_trigger_state(int state);
|
||||
int cpufreq_boost_supported(void);
|
||||
int cpufreq_boost_enabled(void);
|
||||
int cpufreq_enable_boost_support(void);
|
||||
bool policy_has_boost_freq(struct cpufreq_policy *policy);
|
||||
#else
|
||||
static inline int cpufreq_boost_trigger_state(int state)
|
||||
{
|
||||
|
@ -591,6 +593,16 @@ static inline int cpufreq_boost_enabled(void)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int cpufreq_enable_boost_support(void)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline bool policy_has_boost_freq(struct cpufreq_policy *policy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
/* the following funtion is for cpufreq core use only */
|
||||
struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue