aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2011-02-25 18:06:47 -0500
committerPaul Walmsley <paul@pwsan.com>2011-02-25 18:06:47 -0500
commit32d4034eea9c5c2b2edc365e1a0787c8f5b84c3c (patch)
tree688c5a025999ec237ea6d5c8fbae2f018095fc82 /arch/arm/mach-omap2
parent3673d1ef5dc94d8b942c33fe1895a0ff52efbc3c (diff)
OMAP: clockdomain: 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 clockdomain 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>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/clockdomain.c10
-rw-r--r--arch/arm/mach-omap2/clockdomain.h37
-rw-r--r--arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/clockdomains44xx_data.c2
4 files changed, 47 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 58e42f76603f..f70b06ae8664 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -44,6 +44,7 @@ static LIST_HEAD(clkdm_list);
44/* array of clockdomain deps to be added/removed when clkdm in hwsup mode */ 44/* array of clockdomain deps to be added/removed when clkdm in hwsup mode */
45static struct clkdm_autodep *autodeps; 45static struct clkdm_autodep *autodeps;
46 46
47static struct clkdm_ops *arch_clkdm;
47 48
48/* Private functions */ 49/* Private functions */
49 50
@@ -292,6 +293,7 @@ static void _disable_hwsup(struct clockdomain *clkdm)
292 * clkdm_init - set up the clockdomain layer 293 * clkdm_init - set up the clockdomain layer
293 * @clkdms: optional pointer to an array of clockdomains to register 294 * @clkdms: optional pointer to an array of clockdomains to register
294 * @init_autodeps: optional pointer to an array of autodeps to register 295 * @init_autodeps: optional pointer to an array of autodeps to register
296 * @custom_funcs: func pointers for arch specfic implementations
295 * 297 *
296 * Set up internal state. If a pointer to an array of clockdomains 298 * Set up internal state. If a pointer to an array of clockdomains
297 * @clkdms was supplied, loop through the list of clockdomains, 299 * @clkdms was supplied, loop through the list of clockdomains,
@@ -300,12 +302,18 @@ static void _disable_hwsup(struct clockdomain *clkdm)
300 * @init_autodeps was provided, register those. No return value. 302 * @init_autodeps was provided, register those. No return value.
301 */ 303 */
302void clkdm_init(struct clockdomain **clkdms, 304void clkdm_init(struct clockdomain **clkdms,
303 struct clkdm_autodep *init_autodeps) 305 struct clkdm_autodep *init_autodeps,
306 struct clkdm_ops *custom_funcs)
304{ 307{
305 struct clockdomain **c = NULL; 308 struct clockdomain **c = NULL;
306 struct clockdomain *clkdm; 309 struct clockdomain *clkdm;
307 struct clkdm_autodep *autodep = NULL; 310 struct clkdm_autodep *autodep = NULL;
308 311
312 if (!custom_funcs)
313 WARN(1, "No custom clkdm functions registered\n");
314 else
315 arch_clkdm = custom_funcs;
316
309 if (clkdms) 317 if (clkdms)
310 for (c = clkdms; *c; c++) 318 for (c = clkdms; *c; c++)
311 _clkdm_register(*c); 319 _clkdm_register(*c);
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index 9b459c26fb85..71ad265cf133 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -116,7 +116,42 @@ struct clockdomain {
116 struct list_head node; 116 struct list_head node;
117}; 117};
118 118
119void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps); 119/**
120 * struct clkdm_ops - Arch specfic function implementations
121 * @clkdm_add_wkdep: Add a wakeup dependency between clk domains
122 * @clkdm_del_wkdep: Delete a wakeup dependency between clk domains
123 * @clkdm_read_wkdep: Read wakeup dependency state between clk domains
124 * @clkdm_clear_all_wkdeps: Remove all wakeup dependencies from the clk domain
125 * @clkdm_add_sleepdep: Add a sleep dependency between clk domains
126 * @clkdm_del_sleepdep: Delete a sleep dependency between clk domains
127 * @clkdm_read_sleepdep: Read sleep dependency state between clk domains
128 * @clkdm_clear_all_sleepdeps: Remove all sleep dependencies from the clk domain
129 * @clkdm_sleep: Force a clockdomain to sleep
130 * @clkdm_wakeup: Force a clockdomain to wakeup
131 * @clkdm_allow_idle: Enable hw supervised idle transitions for clock domain
132 * @clkdm_deny_idle: Disable hw supervised idle transitions for clock domain
133 * @clkdm_clk_enable: Put the clkdm in right state for a clock enable
134 * @clkdm_clk_disable: Put the clkdm in right state for a clock disable
135 */
136struct clkdm_ops {
137 int (*clkdm_add_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
138 int (*clkdm_del_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
139 int (*clkdm_read_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
140 int (*clkdm_clear_all_wkdeps)(struct clockdomain *clkdm);
141 int (*clkdm_add_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
142 int (*clkdm_del_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
143 int (*clkdm_read_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
144 int (*clkdm_clear_all_sleepdeps)(struct clockdomain *clkdm);
145 int (*clkdm_sleep)(struct clockdomain *clkdm);
146 int (*clkdm_wakeup)(struct clockdomain *clkdm);
147 void (*clkdm_allow_idle)(struct clockdomain *clkdm);
148 void (*clkdm_deny_idle)(struct clockdomain *clkdm);
149 int (*clkdm_clk_enable)(struct clockdomain *clkdm);
150 int (*clkdm_clk_disable)(struct clockdomain *clkdm);
151};
152
153void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps,
154 struct clkdm_ops *custom_funcs);
120struct clockdomain *clkdm_lookup(const char *name); 155struct clockdomain *clkdm_lookup(const char *name);
121 156
122int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), 157int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user),
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
index e6f0d18d5e8d..e2a959eab312 100644
--- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
@@ -856,5 +856,5 @@ static struct clockdomain *clockdomains_omap2[] __initdata = {
856 856
857void __init omap2_clockdomains_init(void) 857void __init omap2_clockdomains_init(void)
858{ 858{
859 clkdm_init(clockdomains_omap2, clkdm_autodeps); 859 clkdm_init(clockdomains_omap2, clkdm_autodeps, NULL);
860} 860}
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c
index 10622c914abc..a5000d473d45 100644
--- a/arch/arm/mach-omap2/clockdomains44xx_data.c
+++ b/arch/arm/mach-omap2/clockdomains44xx_data.c
@@ -305,5 +305,5 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = {
305 305
306void __init omap44xx_clockdomains_init(void) 306void __init omap44xx_clockdomains_init(void)
307{ 307{
308 clkdm_init(clockdomains_omap44xx, NULL); 308 clkdm_init(clockdomains_omap44xx, NULL, NULL);
309} 309}