Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
cpufreq.h File Reference
#include <linux/mutex.h>
#include <linux/notifier.h>
#include <linux/threads.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/completion.h>
#include <linux/workqueue.h>
#include <linux/cpumask.h>
#include <asm/div64.h>

Go to the source code of this file.

Data Structures

struct  cpufreq_cpuinfo
 
struct  cpufreq_real_policy
 
struct  cpufreq_policy
 
struct  cpufreq_freqs
 
struct  cpufreq_governor
 
struct  cpufreq_driver
 
struct  freq_attr
 
struct  global_attr
 
struct  cpufreq_frequency_table
 

Macros

#define CPUFREQ_NAME_LEN   16
 
#define CPUFREQ_TRANSITION_NOTIFIER   (0)
 
#define CPUFREQ_POLICY_NOTIFIER   (1)
 
#define CPUFREQ_POLICY_POWERSAVE   (1)
 
#define CPUFREQ_POLICY_PERFORMANCE   (2)
 
#define CPUFREQ_ETERNAL   (-1)
 
#define CPUFREQ_ADJUST   (0)
 
#define CPUFREQ_INCOMPATIBLE   (1)
 
#define CPUFREQ_NOTIFY   (2)
 
#define CPUFREQ_START   (3)
 
#define CPUFREQ_SHARED_TYPE_NONE   (0) /* None */
 
#define CPUFREQ_SHARED_TYPE_HW   (1) /* HW does needed coordination */
 
#define CPUFREQ_SHARED_TYPE_ALL   (2) /* All dependent CPUs should set freq */
 
#define CPUFREQ_SHARED_TYPE_ANY   (3) /* Freq can be set from any dependent CPU*/
 
#define CPUFREQ_PRECHANGE   (0)
 
#define CPUFREQ_POSTCHANGE   (1)
 
#define CPUFREQ_RESUMECHANGE   (8)
 
#define CPUFREQ_SUSPENDCHANGE   (9)
 
#define CPUFREQ_GOV_START   1
 
#define CPUFREQ_GOV_STOP   2
 
#define CPUFREQ_GOV_LIMITS   3
 
#define CPUFREQ_RELATION_L   0 /* lowest frequency at or above target */
 
#define CPUFREQ_RELATION_H   1 /* highest frequency below or at target */
 
#define CPUFREQ_STICKY
 
#define CPUFREQ_CONST_LOOPS
 
#define CPUFREQ_PM_NO_WARN
 
#define cpufreq_freq_attr_ro(_name)
 
#define cpufreq_freq_attr_ro_perm(_name, _perm)
 
#define cpufreq_freq_attr_rw(_name)
 
#define define_one_global_ro(_name)
 
#define define_one_global_rw(_name)
 
#define CPUFREQ_ENTRY_INVALID   ~0
 
#define CPUFREQ_TABLE_END   ~1
 

Functions

int cpufreq_driver_target (struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation)
 
int __cpufreq_driver_target (struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation)
 
int __cpufreq_driver_getavg (struct cpufreq_policy *policy, unsigned int cpu)
 
int cpufreq_register_governor (struct cpufreq_governor *governor)
 
void cpufreq_unregister_governor (struct cpufreq_governor *governor)
 
int cpufreq_register_driver (struct cpufreq_driver *driver_data)
 
int cpufreq_unregister_driver (struct cpufreq_driver *driver_data)
 
void cpufreq_notify_transition (struct cpufreq_freqs *freqs, unsigned int state)
 
int cpufreq_get_policy (struct cpufreq_policy *policy, unsigned int cpu)
 
int cpufreq_update_policy (unsigned int cpu)
 
int cpufreq_frequency_table_cpuinfo (struct cpufreq_policy *policy, struct cpufreq_frequency_table *table)
 
int cpufreq_frequency_table_verify (struct cpufreq_policy *policy, struct cpufreq_frequency_table *table)
 
int cpufreq_frequency_table_target (struct cpufreq_policy *policy, struct cpufreq_frequency_table *table, unsigned int target_freq, unsigned int relation, unsigned int *index)
 
struct cpufreq_frequency_tablecpufreq_frequency_get_table (unsigned int cpu)
 
struct cpufreq_policycpufreq_cpu_get (unsigned int cpu)
 
void cpufreq_cpu_put (struct cpufreq_policy *data)
 
void cpufreq_frequency_table_get_attr (struct cpufreq_frequency_table *table, unsigned int cpu)
 
void cpufreq_frequency_table_put_attr (unsigned int cpu)
 

Variables

struct kobjectcpufreq_global_kobject
 
struct freq_attr cpufreq_freq_attr_scaling_available_freqs
 

Macro Definition Documentation

#define CPUFREQ_ADJUST   (0)

Definition at line 112 of file cpufreq.h.

#define CPUFREQ_CONST_LOOPS
Value:
0x02 /* loops_per_jiffy or other kernel
* "constants" aren't affected by
* frequency transitions */

Definition at line 245 of file cpufreq.h.

#define CPUFREQ_ENTRY_INVALID   ~0

Definition at line 370 of file cpufreq.h.

#define CPUFREQ_ETERNAL   (-1)

Definition at line 72 of file cpufreq.h.

#define cpufreq_freq_attr_ro (   _name)
Value:
static struct freq_attr _name = \
__ATTR(_name, 0444, show_##_name, NULL)

Definition at line 276 of file cpufreq.h.

#define cpufreq_freq_attr_ro_perm (   _name,
  _perm 
)
Value:
static struct freq_attr _name = \
__ATTR(_name, _perm, show_##_name, NULL)

Definition at line 280 of file cpufreq.h.

#define cpufreq_freq_attr_rw (   _name)
Value:
static struct freq_attr _name = \
__ATTR(_name, 0644, show_##_name, store_##_name)

Definition at line 284 of file cpufreq.h.

#define CPUFREQ_GOV_LIMITS   3

Definition at line 169 of file cpufreq.h.

#define CPUFREQ_GOV_START   1

Definition at line 167 of file cpufreq.h.

#define CPUFREQ_GOV_STOP   2

Definition at line 168 of file cpufreq.h.

#define CPUFREQ_INCOMPATIBLE   (1)

Definition at line 113 of file cpufreq.h.

#define CPUFREQ_NAME_LEN   16

Definition at line 24 of file cpufreq.h.

#define CPUFREQ_NOTIFY   (2)

Definition at line 114 of file cpufreq.h.

#define CPUFREQ_PM_NO_WARN
Value:
0x04 /* don't warn on suspend/resume speed
* mismatches */

Definition at line 246 of file cpufreq.h.

#define CPUFREQ_POLICY_NOTIFIER   (1)

Definition at line 32 of file cpufreq.h.

#define CPUFREQ_POLICY_PERFORMANCE   (2)

Definition at line 58 of file cpufreq.h.

#define CPUFREQ_POLICY_POWERSAVE   (1)

Definition at line 57 of file cpufreq.h.

#define CPUFREQ_POSTCHANGE   (1)

Definition at line 125 of file cpufreq.h.

#define CPUFREQ_PRECHANGE   (0)

Definition at line 124 of file cpufreq.h.

#define CPUFREQ_RELATION_H   1 /* highest frequency below or at target */

Definition at line 209 of file cpufreq.h.

#define CPUFREQ_RELATION_L   0 /* lowest frequency at or above target */

Definition at line 208 of file cpufreq.h.

#define CPUFREQ_RESUMECHANGE   (8)

Definition at line 126 of file cpufreq.h.

#define CPUFREQ_SHARED_TYPE_ALL   (2) /* All dependent CPUs should set freq */

Definition at line 119 of file cpufreq.h.

#define CPUFREQ_SHARED_TYPE_ANY   (3) /* Freq can be set from any dependent CPU*/

Definition at line 120 of file cpufreq.h.

#define CPUFREQ_SHARED_TYPE_HW   (1) /* HW does needed coordination */

Definition at line 118 of file cpufreq.h.

#define CPUFREQ_SHARED_TYPE_NONE   (0) /* None */

Definition at line 117 of file cpufreq.h.

#define CPUFREQ_START   (3)

Definition at line 115 of file cpufreq.h.

#define CPUFREQ_STICKY
Value:
0x01 /* the driver isn't removed even if
* all ->init() calls failed */

Definition at line 244 of file cpufreq.h.

#define CPUFREQ_SUSPENDCHANGE   (9)

Definition at line 127 of file cpufreq.h.

#define CPUFREQ_TABLE_END   ~1

Definition at line 371 of file cpufreq.h.

#define CPUFREQ_TRANSITION_NOTIFIER   (0)

Definition at line 31 of file cpufreq.h.

#define define_one_global_ro (   _name)
Value:
static struct global_attr _name = \
__ATTR(_name, 0444, show_##_name, NULL)

Definition at line 296 of file cpufreq.h.

#define define_one_global_rw (   _name)
Value:
static struct global_attr _name = \
__ATTR(_name, 0644, show_##_name, store_##_name)

Definition at line 300 of file cpufreq.h.

Function Documentation

int __cpufreq_driver_getavg ( struct cpufreq_policy policy,
unsigned int  cpu 
)

Definition at line 1508 of file cpufreq.c.

int __cpufreq_driver_target ( struct cpufreq_policy policy,
unsigned int  target_freq,
unsigned int  relation 
)

Definition at line 1466 of file cpufreq.c.

struct cpufreq_policy* cpufreq_cpu_get ( unsigned int  cpu)
read

Definition at line 179 of file cpufreq.c.

void cpufreq_cpu_put ( struct cpufreq_policy data)

Definition at line 197 of file cpufreq.c.

int cpufreq_driver_target ( struct cpufreq_policy policy,
unsigned int  target_freq,
unsigned int  relation 
)

Definition at line 1484 of file cpufreq.c.

struct cpufreq_frequency_table* cpufreq_frequency_get_table ( unsigned int  cpu)
read

Definition at line 228 of file freq_table.c.

int cpufreq_frequency_table_cpuinfo ( struct cpufreq_policy policy,
struct cpufreq_frequency_table table 
)

Definition at line 21 of file freq_table.c.

void cpufreq_frequency_table_get_attr ( struct cpufreq_frequency_table table,
unsigned int  cpu 
)

Definition at line 213 of file freq_table.c.

void cpufreq_frequency_table_put_attr ( unsigned int  cpu)

Definition at line 221 of file freq_table.c.

int cpufreq_frequency_table_target ( struct cpufreq_policy policy,
struct cpufreq_frequency_table table,
unsigned int  target_freq,
unsigned int  relation,
unsigned int index 
)

Definition at line 94 of file freq_table.c.

int cpufreq_frequency_table_verify ( struct cpufreq_policy policy,
struct cpufreq_frequency_table table 
)

Definition at line 54 of file freq_table.c.

int cpufreq_get_policy ( struct cpufreq_policy policy,
unsigned int  cpu 
)

cpufreq_get_policy - get the current cpufreq_policy : struct cpufreq_policy into which the current cpufreq_policy is written

Reads the current cpufreq policy.

Definition at line 1641 of file cpufreq.c.

void cpufreq_notify_transition ( struct cpufreq_freqs freqs,
unsigned int  state 
)

cpufreq_notify_transition - call notifier chain and adjust_jiffies on frequency transition.

This function calls the transition notifiers and the "adjust_jiffies" function. It is called twice on all CPU frequency changes that have external effects.

Definition at line 259 of file cpufreq.c.

int cpufreq_register_driver ( struct cpufreq_driver driver_data)

cpufreq_register_driver - register a CPU Frequency driver : A struct cpufreq_driver containing the values# submitted by the CPU Frequency driver.

Registers a CPU Frequency driver to this core code. This code returns zero on success, -EBUSY when another driver got here first (and isn't unregistered in the meantime).

Definition at line 1849 of file cpufreq.c.

int cpufreq_register_governor ( struct cpufreq_governor governor)

Definition at line 1576 of file cpufreq.c.

int cpufreq_unregister_driver ( struct cpufreq_driver driver)

cpufreq_unregister_driver - unregister the current CPUFreq driver

Unregister the current CPUFreq driver. Only call this if you have the right to do so, i.e. if you have succeeded in initialising before! Returns zero if successful, and -EINVAL if the cpufreq_driver is currently not initialised.

Definition at line 1920 of file cpufreq.c.

void cpufreq_unregister_governor ( struct cpufreq_governor governor)

Definition at line 1600 of file cpufreq.c.

int cpufreq_update_policy ( unsigned int  cpu)

cpufreq_update_policy - re-evaluate an existing cpufreq policy : CPU which shall be re-evaluated

Useful for policy notifiers which have different necessities at different times.

Definition at line 1754 of file cpufreq.c.

Variable Documentation

struct freq_attr cpufreq_freq_attr_scaling_available_freqs

Definition at line 201 of file freq_table.c.

struct kobject* cpufreq_global_kobject

Definition at line 628 of file cpufreq.c.