linux/drivers/cpufreq/cpufreq_governor.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * drivers/cpufreq/cpufreq_governor.c
 *
 * 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]>
 */

#define pr_fmt(fmt)

#include <linux/export.h>
#include <linux/kernel_stat.h>
#include <linux/slab.h>

#include "cpufreq_governor.h"

#define CPUFREQ_DBS_MIN_SAMPLING_INTERVAL

static DEFINE_PER_CPU(struct cpu_dbs_info, cpu_dbs);

static DEFINE_MUTEX(gov_dbs_data_mutex);

/* Common sysfs tunables */
/*
 * sampling_rate_store - update sampling rate effective immediately if needed.
 *
 * If new rate is smaller than the old, simply updating
 * dbs.sampling_rate might not be appropriate. For example, if the
 * original sampling_rate was 1 second and the requested new sampling rate is 10
 * ms because the user needs immediate reaction from ondemand governor, but not
 * sure if higher frequency will be required or not, then, the governor may
 * change the sampling rate too late; up to 1 second later. Thus, if we are
 * reducing the sampling rate, we need to make the new value effective
 * immediately.
 *
 * This must be called with dbs_data->mutex held, otherwise traversing
 * policy_dbs_list isn't safe.
 */
ssize_t sampling_rate_store(struct gov_attr_set *attr_set, const char *buf,
			    size_t count)
{}
EXPORT_SYMBOL_GPL();

/**
 * gov_update_cpu_data - Update CPU load data.
 * @dbs_data: Top-level governor data pointer.
 *
 * Update CPU load data for all CPUs in the domain governed by @dbs_data
 * (that may be a single policy or a bunch of them if governor tunables are
 * system-wide).
 *
 * Call under the @dbs_data mutex.
 */
void gov_update_cpu_data(struct dbs_data *dbs_data)
{}
EXPORT_SYMBOL_GPL();

unsigned int dbs_update(struct cpufreq_policy *policy)
{}
EXPORT_SYMBOL_GPL();

static void dbs_work_handler(struct work_struct *work)
{}

static void dbs_irq_work(struct irq_work *irq_work)
{}

static void dbs_update_util_handler(struct update_util_data *data, u64 time,
				    unsigned int flags)
{}

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

static inline void gov_clear_update_util(struct cpufreq_policy *policy)
{}

static struct policy_dbs_info *alloc_policy_dbs_info(struct cpufreq_policy *policy,
						     struct dbs_governor *gov)
{}

static void free_policy_dbs_info(struct policy_dbs_info *policy_dbs,
				 struct dbs_governor *gov)
{}

static void cpufreq_dbs_data_release(struct kobject *kobj)
{}

int cpufreq_dbs_governor_init(struct cpufreq_policy *policy)
{}
EXPORT_SYMBOL_GPL();

void cpufreq_dbs_governor_exit(struct cpufreq_policy *policy)
{}
EXPORT_SYMBOL_GPL();

int cpufreq_dbs_governor_start(struct cpufreq_policy *policy)
{}
EXPORT_SYMBOL_GPL();

void cpufreq_dbs_governor_stop(struct cpufreq_policy *policy)
{}
EXPORT_SYMBOL_GPL();

void cpufreq_dbs_governor_limits(struct cpufreq_policy *policy)
{}
EXPORT_SYMBOL_GPL();