aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/powerdomain.c
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2010-12-21 22:01:18 -0500
committerPaul Walmsley <paul@pwsan.com>2010-12-21 22:01:18 -0500
commit3b1e8b21fcbd686445f0bb42f84701b4621cdec6 (patch)
tree0de10fe595631821b60bbc847ede377e370bc147 /arch/arm/mach-omap2/powerdomain.c
parent74bea6b9881f4b32f6c0379e46d2f5e16fd34a07 (diff)
OMAP: powerdomain: Infrastructure to put arch specific code
Put infrastructure in place, so arch specific func pointers can be hooked up to the platform-independent part of the framework. This is in preparation of splitting the powerdomain framework into platform-independent part (for all omaps) and platform-specific parts. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Benoit Cousson <b-cousson@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Rajendra Nayak <rnayak@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.c')
-rw-r--r--arch/arm/mach-omap2/powerdomain.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 6527ec30dc17..3aa3eb335416 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -80,6 +80,8 @@ static u16 pwrstst_reg_offs;
80/* pwrdm_list contains all registered struct powerdomains */ 80/* pwrdm_list contains all registered struct powerdomains */
81static LIST_HEAD(pwrdm_list); 81static LIST_HEAD(pwrdm_list);
82 82
83static struct pwrdm_ops *arch_pwrdm;
84
83/* Private functions */ 85/* Private functions */
84 86
85static struct powerdomain *_pwrdm_lookup(const char *name) 87static struct powerdomain *_pwrdm_lookup(const char *name)
@@ -211,6 +213,7 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
211/** 213/**
212 * pwrdm_init - set up the powerdomain layer 214 * pwrdm_init - set up the powerdomain layer
213 * @pwrdm_list: array of struct powerdomain pointers to register 215 * @pwrdm_list: array of struct powerdomain pointers to register
216 * @custom_funcs: func pointers for arch specfic implementations
214 * 217 *
215 * Loop through the array of powerdomains @pwrdm_list, registering all 218 * Loop through the array of powerdomains @pwrdm_list, registering all
216 * that are available on the current CPU. If pwrdm_list is supplied 219 * that are available on the current CPU. If pwrdm_list is supplied
@@ -218,7 +221,7 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
218 * registered. No return value. XXX pwrdm_list is not really a 221 * registered. No return value. XXX pwrdm_list is not really a
219 * "list"; it is an array. Rename appropriately. 222 * "list"; it is an array. Rename appropriately.
220 */ 223 */
221void pwrdm_init(struct powerdomain **pwrdm_list) 224void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs)
222{ 225{
223 struct powerdomain **p = NULL; 226 struct powerdomain **p = NULL;
224 227
@@ -234,6 +237,11 @@ void pwrdm_init(struct powerdomain **pwrdm_list)
234 return; 237 return;
235 } 238 }
236 239
240 if (!custom_funcs)
241 WARN(1, "powerdomain: No custom pwrdm functions registered\n");
242 else
243 arch_pwrdm = custom_funcs;
244
237 if (pwrdm_list) { 245 if (pwrdm_list) {
238 for (p = pwrdm_list; *p; p++) 246 for (p = pwrdm_list; *p; p++)
239 _pwrdm_register(*p); 247 _pwrdm_register(*p);
@@ -1074,4 +1082,3 @@ int pwrdm_post_transition(void)
1074 pwrdm_for_each(_pwrdm_post_transition_cb, NULL); 1082 pwrdm_for_each(_pwrdm_post_transition_cb, NULL);
1075 return 0; 1083 return 0;
1076} 1084}
1077