linux/drivers/cpufreq/cpufreq_conservative.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  drivers/cpufreq/cpufreq_conservative.c
 *
 *  Copyright (C)  2001 Russell King
 *            (C)  2003 Venkatesh Pallipadi <[email protected]>.
 *                      Jun Nakajima <[email protected]>
 *            (C)  2009 Alexander Clouter <[email protected]>
 */

#include <linux/slab.h>
#include "cpufreq_governor.h"

struct cs_policy_dbs_info {};

static inline struct cs_policy_dbs_info *to_dbs_info(struct policy_dbs_info *policy_dbs)
{}

struct cs_dbs_tuners {};

/* Conservative governor macros */
#define DEF_FREQUENCY_UP_THRESHOLD
#define DEF_FREQUENCY_DOWN_THRESHOLD
#define DEF_FREQUENCY_STEP
#define DEF_SAMPLING_DOWN_FACTOR
#define MAX_SAMPLING_DOWN_FACTOR

static inline unsigned int get_freq_step(struct cs_dbs_tuners *cs_tuners,
					 struct cpufreq_policy *policy)
{}

/*
 * Every sampling_rate, we check, if current idle time is less than 20%
 * (default), then we try to increase frequency. Every sampling_rate *
 * sampling_down_factor, we check, if current idle time is more than 80%
 * (default), then we try to decrease frequency
 *
 * Frequency updates happen at minimum steps of 5% (default) of maximum
 * frequency
 */
static unsigned int cs_dbs_update(struct cpufreq_policy *policy)
{}

/************************** sysfs interface ************************/

static ssize_t sampling_down_factor_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 down_threshold_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 freq_step_store(struct gov_attr_set *attr_set, const char *buf,
			       size_t count)
{}

gov_show_one_common(sampling_rate);
gov_show_one_common(sampling_down_factor);
gov_show_one_common(up_threshold);
gov_show_one_common(ignore_nice_load);
gov_show_one(cs, down_threshold);
gov_show_one(cs, freq_step);

gov_attr_rw();
gov_attr_rw();
gov_attr_rw();
gov_attr_rw();
gov_attr_rw();
gov_attr_rw();

static struct attribute *cs_attrs[] =;
ATTRIBUTE_GROUPS();

/************************** sysfs end ************************/

static struct policy_dbs_info *cs_alloc(void)
{}

static void cs_free(struct policy_dbs_info *policy_dbs)
{}

static int cs_init(struct dbs_data *dbs_data)
{}

static void cs_exit(struct dbs_data *dbs_data)
{}

static void cs_start(struct cpufreq_policy *policy)
{}

static struct dbs_governor cs_governor =;

#define CPU_FREQ_GOV_CONSERVATIVE

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
struct cpufreq_governor *cpufreq_default_governor(void)
{
	return &CPU_FREQ_GOV_CONSERVATIVE;
}
#endif

cpufreq_governor_init(CPU_FREQ_GOV_CONSERVATIVE);
cpufreq_governor_exit(CPU_FREQ_GOV_CONSERVATIVE);