diff options
Diffstat (limited to 'arch/arm/mach-omap2/clockdomain.h')
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.h | 70 |
1 files changed, 60 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h index 9b459c26fb85..85b3dce65640 100644 --- a/arch/arm/mach-omap2/clockdomain.h +++ b/arch/arm/mach-omap2/clockdomain.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * OMAP2/3 clockdomain framework functions | 4 | * OMAP2/3 clockdomain framework functions |
5 | * | 5 | * |
6 | * Copyright (C) 2008 Texas Instruments, Inc. | 6 | * Copyright (C) 2008 Texas Instruments, Inc. |
7 | * Copyright (C) 2008-2010 Nokia Corporation | 7 | * Copyright (C) 2008-2011 Nokia Corporation |
8 | * | 8 | * |
9 | * Paul Walmsley | 9 | * Paul Walmsley |
10 | * | 10 | * |
@@ -22,11 +22,19 @@ | |||
22 | #include <plat/clock.h> | 22 | #include <plat/clock.h> |
23 | #include <plat/cpu.h> | 23 | #include <plat/cpu.h> |
24 | 24 | ||
25 | /* Clockdomain capability flags */ | 25 | /* |
26 | * Clockdomain flags | ||
27 | * | ||
28 | * XXX Document CLKDM_CAN_* flags | ||
29 | * | ||
30 | * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this | ||
31 | * clockdomain. (Currently, this applies to OMAP3 clockdomains only.) | ||
32 | */ | ||
26 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) | 33 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) |
27 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) | 34 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) |
28 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) | 35 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) |
29 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) | 36 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) |
37 | #define CLKDM_NO_AUTODEPS (1 << 4) | ||
30 | 38 | ||
31 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) | 39 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) |
32 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) | 40 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) |
@@ -116,7 +124,42 @@ struct clockdomain { | |||
116 | struct list_head node; | 124 | struct list_head node; |
117 | }; | 125 | }; |
118 | 126 | ||
119 | void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps); | 127 | /** |
128 | * struct clkdm_ops - Arch specfic function implementations | ||
129 | * @clkdm_add_wkdep: Add a wakeup dependency between clk domains | ||
130 | * @clkdm_del_wkdep: Delete a wakeup dependency between clk domains | ||
131 | * @clkdm_read_wkdep: Read wakeup dependency state between clk domains | ||
132 | * @clkdm_clear_all_wkdeps: Remove all wakeup dependencies from the clk domain | ||
133 | * @clkdm_add_sleepdep: Add a sleep dependency between clk domains | ||
134 | * @clkdm_del_sleepdep: Delete a sleep dependency between clk domains | ||
135 | * @clkdm_read_sleepdep: Read sleep dependency state between clk domains | ||
136 | * @clkdm_clear_all_sleepdeps: Remove all sleep dependencies from the clk domain | ||
137 | * @clkdm_sleep: Force a clockdomain to sleep | ||
138 | * @clkdm_wakeup: Force a clockdomain to wakeup | ||
139 | * @clkdm_allow_idle: Enable hw supervised idle transitions for clock domain | ||
140 | * @clkdm_deny_idle: Disable hw supervised idle transitions for clock domain | ||
141 | * @clkdm_clk_enable: Put the clkdm in right state for a clock enable | ||
142 | * @clkdm_clk_disable: Put the clkdm in right state for a clock disable | ||
143 | */ | ||
144 | struct clkdm_ops { | ||
145 | int (*clkdm_add_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
146 | int (*clkdm_del_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
147 | int (*clkdm_read_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
148 | int (*clkdm_clear_all_wkdeps)(struct clockdomain *clkdm); | ||
149 | int (*clkdm_add_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
150 | int (*clkdm_del_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
151 | int (*clkdm_read_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | ||
152 | int (*clkdm_clear_all_sleepdeps)(struct clockdomain *clkdm); | ||
153 | int (*clkdm_sleep)(struct clockdomain *clkdm); | ||
154 | int (*clkdm_wakeup)(struct clockdomain *clkdm); | ||
155 | void (*clkdm_allow_idle)(struct clockdomain *clkdm); | ||
156 | void (*clkdm_deny_idle)(struct clockdomain *clkdm); | ||
157 | int (*clkdm_clk_enable)(struct clockdomain *clkdm); | ||
158 | int (*clkdm_clk_disable)(struct clockdomain *clkdm); | ||
159 | }; | ||
160 | |||
161 | void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps, | ||
162 | struct clkdm_ops *custom_funcs); | ||
120 | struct clockdomain *clkdm_lookup(const char *name); | 163 | struct clockdomain *clkdm_lookup(const char *name); |
121 | 164 | ||
122 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), | 165 | int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), |
@@ -132,16 +175,23 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | |||
132 | int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); | 175 | int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); |
133 | int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); | 176 | int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); |
134 | 177 | ||
135 | void omap2_clkdm_allow_idle(struct clockdomain *clkdm); | 178 | void clkdm_allow_idle(struct clockdomain *clkdm); |
136 | void omap2_clkdm_deny_idle(struct clockdomain *clkdm); | 179 | void clkdm_deny_idle(struct clockdomain *clkdm); |
137 | 180 | ||
138 | int omap2_clkdm_wakeup(struct clockdomain *clkdm); | 181 | int clkdm_wakeup(struct clockdomain *clkdm); |
139 | int omap2_clkdm_sleep(struct clockdomain *clkdm); | 182 | int clkdm_sleep(struct clockdomain *clkdm); |
140 | 183 | ||
141 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); | 184 | int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); |
142 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); | 185 | int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); |
143 | 186 | ||
144 | extern void __init omap2_clockdomains_init(void); | 187 | extern void __init omap2xxx_clockdomains_init(void); |
188 | extern void __init omap3xxx_clockdomains_init(void); | ||
145 | extern void __init omap44xx_clockdomains_init(void); | 189 | extern void __init omap44xx_clockdomains_init(void); |
190 | extern void _clkdm_add_autodeps(struct clockdomain *clkdm); | ||
191 | extern void _clkdm_del_autodeps(struct clockdomain *clkdm); | ||
192 | |||
193 | extern struct clkdm_ops omap2_clkdm_operations; | ||
194 | extern struct clkdm_ops omap3_clkdm_operations; | ||
195 | extern struct clkdm_ops omap4_clkdm_operations; | ||
146 | 196 | ||
147 | #endif | 197 | #endif |