/* needed by all drivers */ int (*init)(struct cpufreq_policy *policy); int (*verify)(struct cpufreq_policy *policy);
/* define one out of two */ int (*setpolicy)(struct cpufreq_policy *policy);
/* * On failure, should always restore frequency to policy->restore_freq * (i.e. old freq). */ int (*target)(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation); /* Deprecated */ int (*target_index)(struct cpufreq_policy *policy, unsigned int index); unsigned int (*fast_switch)(struct cpufreq_policy *policy, unsigned int target_freq);
unsigned int (*resolve_freq)(struct cpufreq_policy *policy, unsigned int target_freq);
unsigned int (*get_intermediate)(struct cpufreq_policy *policy, unsigned int index); int (*target_intermediate)(struct cpufreq_policy *policy, unsigned int index);
/* should be defined, if possible */ unsigned int (*get)(unsigned int cpu);
/* Called to update policy limits on firmware notifications. */ void (*update_limits)(unsigned int cpu);
/* optional */ int (*bios_limit)(int cpu, unsigned int *limit);
int (*online)(struct cpufreq_policy *policy); int (*offline)(struct cpufreq_policy *policy); int (*exit)(struct cpufreq_policy *policy); void (*stop_cpu)(struct cpufreq_policy *policy); int (*suspend)(struct cpufreq_policy *policy); int (*resume)(struct cpufreq_policy *policy);
/* Will be called after the driver is fully initialized */ void (*ready)(struct cpufreq_policy *policy);
struct freq_attr **attr;
/* platform specific boost support code */ bool boost_enabled; int (*set_boost)(int state); };
int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
/* used by the cpuidle framework to setup the broadcast timer */ unsigned int bctimer:1; /* states array must be ordered in decreasing power consumption */ struct cpuidle_state states[CPUIDLE_STATE_MAX]; int state_count; int safe_state_index;
/* the driver handles the cpus in cpumask */ struct cpumask *cpumask;
/* preferred governor to switch at register time */ const char *governor; };