linux/drivers/cpufreq/cpufreq_governor.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * drivers/cpufreq/cpufreq_governor.h
 *
 * Header file for CPUFreq governors common code
 *
 * Copyright	(C) 2001 Russell King
 *		(C) 2003 Venkatesh Pallipadi <[email protected]>.
 *		(C) 2003 Jun Nakajima <[email protected]>
 *		(C) 2009 Alexander Clouter <[email protected]>
 *		(c) 2012 Viresh Kumar <[email protected]>
 */

#ifndef _CPUFREQ_GOVERNOR_H
#define _CPUFREQ_GOVERNOR_H

#include <linux/atomic.h>
#include <linux/irq_work.h>
#include <linux/cpufreq.h>
#include <linux/sched/cpufreq.h>
#include <linux/kernel_stat.h>
#include <linux/module.h>
#include <linux/mutex.h>

/* Ondemand Sampling types */
enum {};

/*
 * Abbreviations:
 * dbs: used as a shortform for demand based switching It helps to keep variable
 *	names smaller, simpler
 * cdbs: common dbs
 * od_*: On-demand governor
 * cs_*: Conservative governor
 */

/* Governor demand based switching data (per-policy or global). */
struct dbs_data {};

static inline struct dbs_data *to_dbs_data(struct gov_attr_set *attr_set)
{}

#define gov_show_one(_gov, file_name)

#define gov_show_one_common(file_name)

#define gov_attr_ro(_name)

#define gov_attr_rw(_name)

/* Common to all CPUs of a policy */
struct policy_dbs_info {};

static inline void gov_update_sample_delay(struct policy_dbs_info *policy_dbs,
					   unsigned int delay_us)
{}

/* Per cpu structures */
struct cpu_dbs_info {};

/* Common Governor data across policies */
struct dbs_governor {};

static inline struct dbs_governor *dbs_governor_of(struct cpufreq_policy *policy)
{}

/* Governor callback routines */
int cpufreq_dbs_governor_init(struct cpufreq_policy *policy);
void cpufreq_dbs_governor_exit(struct cpufreq_policy *policy);
int cpufreq_dbs_governor_start(struct cpufreq_policy *policy);
void cpufreq_dbs_governor_stop(struct cpufreq_policy *policy);
void cpufreq_dbs_governor_limits(struct cpufreq_policy *policy);

#define CPUFREQ_DBS_GOVERNOR_INITIALIZER(_name_)

/* Governor specific operations */
struct od_ops {};

unsigned int dbs_update(struct cpufreq_policy *policy);
void od_register_powersave_bias_handler(unsigned int (*f)
		(struct cpufreq_policy *, unsigned int, unsigned int),
		unsigned int powersave_bias);
void od_unregister_powersave_bias_handler(void);
ssize_t sampling_rate_store(struct gov_attr_set *attr_set, const char *buf,
			    size_t count);
void gov_update_cpu_data(struct dbs_data *dbs_data);
#endif /* _CPUFREQ_GOVERNOR_H */