#define pr_fmt(fmt) …
#include <linux/cpu.h>
#include <linux/percpu-defs.h>
#include <linux/slab.h>
#include <linux/tick.h>
#include <linux/sched/cpufreq.h>
#include "cpufreq_ondemand.h"
#define DEF_FREQUENCY_UP_THRESHOLD …
#define DEF_SAMPLING_DOWN_FACTOR …
#define MAX_SAMPLING_DOWN_FACTOR …
#define MICRO_FREQUENCY_UP_THRESHOLD …
#define MIN_FREQUENCY_UP_THRESHOLD …
#define MAX_FREQUENCY_UP_THRESHOLD …
static struct od_ops od_ops;
static unsigned int default_powersave_bias;
static int should_io_be_busy(void)
{ … }
static unsigned int generic_powersave_bias_target(struct cpufreq_policy *policy,
unsigned int freq_next, unsigned int relation)
{ … }
static void ondemand_powersave_bias_init(struct cpufreq_policy *policy)
{ … }
static void dbs_freq_increase(struct cpufreq_policy *policy, unsigned int freq)
{ … }
static void od_update(struct cpufreq_policy *policy)
{ … }
static unsigned int od_dbs_update(struct cpufreq_policy *policy)
{ … }
static struct dbs_governor od_dbs_gov;
static ssize_t io_is_busy_store(struct gov_attr_set *attr_set, const char *buf,
size_t count)
{ … }
static ssize_t up_threshold_store(struct gov_attr_set *attr_set,
const char *buf, size_t count)
{ … }
static ssize_t sampling_down_factor_store(struct gov_attr_set *attr_set,
const char *buf, size_t count)
{ … }
static ssize_t ignore_nice_load_store(struct gov_attr_set *attr_set,
const char *buf, size_t count)
{ … }
static ssize_t powersave_bias_store(struct gov_attr_set *attr_set,
const char *buf, size_t count)
{ … }
gov_show_one_common(sampling_rate);
gov_show_one_common(up_threshold);
gov_show_one_common(sampling_down_factor);
gov_show_one_common(ignore_nice_load);
gov_show_one_common(io_is_busy);
gov_show_one(od, powersave_bias);
gov_attr_rw(…);
gov_attr_rw(…);
gov_attr_rw(…);
gov_attr_rw(…);
gov_attr_rw(…);
gov_attr_rw(…);
static struct attribute *od_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct policy_dbs_info *od_alloc(void)
{ … }
static void od_free(struct policy_dbs_info *policy_dbs)
{ … }
static int od_init(struct dbs_data *dbs_data)
{ … }
static void od_exit(struct dbs_data *dbs_data)
{ … }
static void od_start(struct cpufreq_policy *policy)
{ … }
static struct od_ops od_ops = …;
static struct dbs_governor od_dbs_gov = …;
#define CPU_FREQ_GOV_ONDEMAND …
static void od_set_powersave_bias(unsigned int powersave_bias)
{ … }
void od_register_powersave_bias_handler(unsigned int (*f)
(struct cpufreq_policy *, unsigned int, unsigned int),
unsigned int powersave_bias)
{ … }
EXPORT_SYMBOL_GPL(…);
void od_unregister_powersave_bias_handler(void)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
struct cpufreq_governor *cpufreq_default_governor(void)
{
return &CPU_FREQ_GOV_ONDEMAND;
}
#endif
cpufreq_governor_init(CPU_FREQ_GOV_ONDEMAND);
cpufreq_governor_exit(CPU_FREQ_GOV_ONDEMAND);