Commit 92175044 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[CPUFREQ] More misc cleanups.

- CPUFREQ_ALL_CPUS is not a valid argument any more, don't mention it
  in include/linux/cpufreq.h
- without a driver->init() function a cpufreq driver isn't even
  loaded, so remove that check in the per-CPU initialization
- whitespace and clarification changes to linux/cpufreq.

All from Dominik again..
parent 77533ee3
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#define CPUFREQ_ALL_CPUS ((NR_CPUS))
/** /**
* cpufreq_parse_policy - parse a policy string * cpufreq_parse_policy - parse a policy string
* @input_string: the string to parse. * @input_string: the string to parse.
......
...@@ -35,8 +35,6 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); ...@@ -35,8 +35,6 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
#define CPUFREQ_TRANSITION_NOTIFIER (0) #define CPUFREQ_TRANSITION_NOTIFIER (0)
#define CPUFREQ_POLICY_NOTIFIER (1) #define CPUFREQ_POLICY_NOTIFIER (1)
#define CPUFREQ_ALL_CPUS ((NR_CPUS))
/********************** cpufreq policy notifiers *********************/ /********************** cpufreq policy notifiers *********************/
...@@ -57,21 +55,24 @@ struct cpufreq_governor; ...@@ -57,21 +55,24 @@ struct cpufreq_governor;
struct cpufreq_cpuinfo { struct cpufreq_cpuinfo {
unsigned int max_freq; unsigned int max_freq;
unsigned int min_freq; unsigned int min_freq;
unsigned int transition_latency; unsigned int transition_latency; /* in 10^(-9) s */
}; };
struct cpufreq_policy { struct cpufreq_policy {
unsigned int cpu; /* cpu nr or CPUFREQ_ALL_CPUS */ unsigned int cpu; /* cpu nr */
struct cpufreq_cpuinfo cpuinfo;/* see above */
unsigned int min; /* in kHz */ unsigned int min; /* in kHz */
unsigned int max; /* in kHz */ unsigned int max; /* in kHz */
unsigned int cur; /* in kHz, only needed if cpufreq unsigned int cur; /* in kHz, only needed if cpufreq
* governors are used */ * governors are used */
unsigned int policy; /* see above */ unsigned int policy; /* see above */
struct cpufreq_governor *governor; /* see below */ struct cpufreq_governor *governor; /* see below */
struct cpufreq_cpuinfo cpuinfo; /* see above */
struct kobject kobj;
struct semaphore lock; /* CPU ->setpolicy or ->target may struct semaphore lock; /* CPU ->setpolicy or ->target may
only be called once a time */ only be called once a time */
struct kobject kobj;
struct completion kobj_unregister; struct completion kobj_unregister;
}; };
...@@ -86,7 +87,7 @@ struct cpufreq_policy { ...@@ -86,7 +87,7 @@ struct cpufreq_policy {
#define CPUFREQ_POSTCHANGE (1) #define CPUFREQ_POSTCHANGE (1)
struct cpufreq_freqs { struct cpufreq_freqs {
unsigned int cpu; /* cpu nr or CPUFREQ_ALL_CPUS */ unsigned int cpu; /* cpu nr */
unsigned int old; unsigned int old;
unsigned int new; unsigned int new;
}; };
...@@ -156,18 +157,22 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor); ...@@ -156,18 +157,22 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor);
struct freq_attr; struct freq_attr;
struct cpufreq_driver { struct cpufreq_driver {
struct module *owner;
char name[CPUFREQ_NAME_LEN];
struct cpufreq_policy *policy;
/* needed by all drivers */ /* needed by all drivers */
int (*init) (struct cpufreq_policy *policy);
int (*verify) (struct cpufreq_policy *policy); int (*verify) (struct cpufreq_policy *policy);
struct cpufreq_policy *policy;
char name[CPUFREQ_NAME_LEN];
/* define one out of two */ /* define one out of two */
int (*setpolicy) (struct cpufreq_policy *policy); int (*setpolicy) (struct cpufreq_policy *policy);
int (*target) (struct cpufreq_policy *policy, int (*target) (struct cpufreq_policy *policy,
unsigned int target_freq, unsigned int target_freq,
unsigned int relation); unsigned int relation);
struct module *owner;
/* optional, for the moment */ /* optional */
int (*init) (struct cpufreq_policy *policy);
int (*exit) (struct cpufreq_policy *policy); int (*exit) (struct cpufreq_policy *policy);
struct freq_attr **attr; struct freq_attr **attr;
}; };
......
...@@ -337,11 +337,9 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) ...@@ -337,11 +337,9 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
*/ */
policy = &cpufreq_driver->policy[cpu]; policy = &cpufreq_driver->policy[cpu];
policy->cpu = cpu; policy->cpu = cpu;
if (cpufreq_driver->init) {
ret = cpufreq_driver->init(policy); ret = cpufreq_driver->init(policy);
if (ret) if (ret)
goto out; goto out;
}
/* set default policy on this CPU */ /* set default policy on this CPU */
down(&cpufreq_driver_sem); down(&cpufreq_driver_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment