22
22
#include <plat/clock.h>
23
23
#include <plat/cpu.h>
25
/* Clockdomain capability flags */
28
* XXX Document CLKDM_CAN_* flags
30
* CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this
31
* clockdomain. (Currently, this applies to OMAP3 clockdomains only.)
26
33
#define CLKDM_CAN_FORCE_SLEEP (1 << 0)
27
34
#define CLKDM_CAN_FORCE_WAKEUP (1 << 1)
28
35
#define CLKDM_CAN_ENABLE_AUTO (1 << 2)
29
36
#define CLKDM_CAN_DISABLE_AUTO (1 << 3)
37
#define CLKDM_NO_AUTODEPS (1 << 4)
31
39
#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)
32
40
#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
116
124
struct list_head node;
119
void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps);
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
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);
161
void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps,
162
struct clkdm_ops *custom_funcs);
120
163
struct clockdomain *clkdm_lookup(const char *name);
122
165
int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user),
132
175
int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
133
176
int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm);
135
void omap2_clkdm_allow_idle(struct clockdomain *clkdm);
136
void omap2_clkdm_deny_idle(struct clockdomain *clkdm);
138
int omap2_clkdm_wakeup(struct clockdomain *clkdm);
139
int omap2_clkdm_sleep(struct clockdomain *clkdm);
141
int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
142
int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
144
extern void __init omap2_clockdomains_init(void);
178
void clkdm_allow_idle(struct clockdomain *clkdm);
179
void clkdm_deny_idle(struct clockdomain *clkdm);
181
int clkdm_wakeup(struct clockdomain *clkdm);
182
int clkdm_sleep(struct clockdomain *clkdm);
184
int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
185
int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
187
extern void __init omap2xxx_clockdomains_init(void);
188
extern void __init omap3xxx_clockdomains_init(void);
145
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);
193
extern struct clkdm_ops omap2_clkdm_operations;
194
extern struct clkdm_ops omap3_clkdm_operations;
195
extern struct clkdm_ops omap4_clkdm_operations;