diff options
author | Nishanth Menon <nm@ti.com> | 2012-10-29 16:01:45 -0400 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2012-11-20 04:46:22 -0500 |
commit | 1b5c1be2c88e8445a20fa1929e26c37e7ca8c926 (patch) | |
tree | 5f5f32ef0452957689e16ace31287885b400bd77 /include/linux/devfreq.h | |
parent | 83116e66a232184f733ecf09a41817cf893ede98 (diff) |
PM / devfreq: map devfreq drivers to governor using name
Allow devfreq drivers to register a preferred governor name
and when the devfreq governor loads itself at a later point
required drivers are managed appropriately, at the time of
unload of a devfreq governor, stop managing those drivers
as well.
Since the governor structures do not need to be exposed
anymore, remove the definitions and make them static
NOTE: devfreq_list_lock is now used to protect governor
start and stop - as this allows us to protect governors and
devfreq with the proper dependencies as needed.
As part of this change, change the registration of exynos
bus driver to request for ondemand using the governor name.
Cc: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Kevin Hilman <khilman@ti.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Nishanth Menon <nm@ti.com>
[Merge conflict resolved by MyungJoo Ham]
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r-- | include/linux/devfreq.h | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 6484a3f8dda8..235248cb2c93 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h | |||
@@ -125,6 +125,7 @@ struct devfreq_governor { | |||
125 | * using devfreq. | 125 | * using devfreq. |
126 | * @profile: device-specific devfreq profile | 126 | * @profile: device-specific devfreq profile |
127 | * @governor: method how to choose frequency based on the usage. | 127 | * @governor: method how to choose frequency based on the usage. |
128 | * @governor_name: devfreq governor name for use with this devfreq | ||
128 | * @nb: notifier block used to notify devfreq object that it should | 129 | * @nb: notifier block used to notify devfreq object that it should |
129 | * reevaluate operable frequencies. Devfreq users may use | 130 | * reevaluate operable frequencies. Devfreq users may use |
130 | * devfreq.nb to the corresponding register notifier call chain. | 131 | * devfreq.nb to the corresponding register notifier call chain. |
@@ -155,6 +156,7 @@ struct devfreq { | |||
155 | struct device dev; | 156 | struct device dev; |
156 | struct devfreq_dev_profile *profile; | 157 | struct devfreq_dev_profile *profile; |
157 | const struct devfreq_governor *governor; | 158 | const struct devfreq_governor *governor; |
159 | char governor_name[DEVFREQ_NAME_LEN]; | ||
158 | struct notifier_block nb; | 160 | struct notifier_block nb; |
159 | struct delayed_work work; | 161 | struct delayed_work work; |
160 | 162 | ||
@@ -176,7 +178,7 @@ struct devfreq { | |||
176 | #if defined(CONFIG_PM_DEVFREQ) | 178 | #if defined(CONFIG_PM_DEVFREQ) |
177 | extern struct devfreq *devfreq_add_device(struct device *dev, | 179 | extern struct devfreq *devfreq_add_device(struct device *dev, |
178 | struct devfreq_dev_profile *profile, | 180 | struct devfreq_dev_profile *profile, |
179 | const struct devfreq_governor *governor, | 181 | const char *governor_name, |
180 | void *data); | 182 | void *data); |
181 | extern int devfreq_remove_device(struct devfreq *devfreq); | 183 | extern int devfreq_remove_device(struct devfreq *devfreq); |
182 | extern int devfreq_suspend_device(struct devfreq *devfreq); | 184 | extern int devfreq_suspend_device(struct devfreq *devfreq); |
@@ -190,17 +192,7 @@ extern int devfreq_register_opp_notifier(struct device *dev, | |||
190 | extern int devfreq_unregister_opp_notifier(struct device *dev, | 192 | extern int devfreq_unregister_opp_notifier(struct device *dev, |
191 | struct devfreq *devfreq); | 193 | struct devfreq *devfreq); |
192 | 194 | ||
193 | #ifdef CONFIG_DEVFREQ_GOV_POWERSAVE | ||
194 | extern const struct devfreq_governor devfreq_powersave; | ||
195 | #endif | ||
196 | #ifdef CONFIG_DEVFREQ_GOV_PERFORMANCE | ||
197 | extern const struct devfreq_governor devfreq_performance; | ||
198 | #endif | ||
199 | #ifdef CONFIG_DEVFREQ_GOV_USERSPACE | ||
200 | extern const struct devfreq_governor devfreq_userspace; | ||
201 | #endif | ||
202 | #ifdef CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND | 195 | #ifdef CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND |
203 | extern const struct devfreq_governor devfreq_simple_ondemand; | ||
204 | /** | 196 | /** |
205 | * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq | 197 | * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq |
206 | * and devfreq_add_device | 198 | * and devfreq_add_device |
@@ -223,7 +215,7 @@ struct devfreq_simple_ondemand_data { | |||
223 | #else /* !CONFIG_PM_DEVFREQ */ | 215 | #else /* !CONFIG_PM_DEVFREQ */ |
224 | static struct devfreq *devfreq_add_device(struct device *dev, | 216 | static struct devfreq *devfreq_add_device(struct device *dev, |
225 | struct devfreq_dev_profile *profile, | 217 | struct devfreq_dev_profile *profile, |
226 | struct devfreq_governor *governor, | 218 | const char *governor_name, |
227 | void *data) | 219 | void *data) |
228 | { | 220 | { |
229 | return NULL; | 221 | return NULL; |
@@ -262,11 +254,6 @@ static int devfreq_unregister_opp_notifier(struct device *dev, | |||
262 | return -EINVAL; | 254 | return -EINVAL; |
263 | } | 255 | } |
264 | 256 | ||
265 | #define devfreq_powersave NULL | ||
266 | #define devfreq_performance NULL | ||
267 | #define devfreq_userspace NULL | ||
268 | #define devfreq_simple_ondemand NULL | ||
269 | |||
270 | #endif /* CONFIG_PM_DEVFREQ */ | 257 | #endif /* CONFIG_PM_DEVFREQ */ |
271 | 258 | ||
272 | #endif /* __LINUX_DEVFREQ_H__ */ | 259 | #endif /* __LINUX_DEVFREQ_H__ */ |