diff options
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx_3xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/prm2xxx_3xxx.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c index bdddf5ca67c4..30517f5af707 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "powerdomain.h" | 20 | #include "powerdomain.h" |
21 | #include "prm2xxx_3xxx.h" | 21 | #include "prm2xxx_3xxx.h" |
22 | #include "prm-regbits-24xx.h" | 22 | #include "prm-regbits-24xx.h" |
23 | #include "clockdomain.h" | ||
23 | 24 | ||
24 | /** | 25 | /** |
25 | * omap2_prm_is_hardreset_asserted - read the HW reset line state of | 26 | * omap2_prm_is_hardreset_asserted - read the HW reset line state of |
@@ -208,3 +209,45 @@ int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm) | |||
208 | return 0; | 209 | return 0; |
209 | } | 210 | } |
210 | 211 | ||
212 | int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1, | ||
213 | struct clockdomain *clkdm2) | ||
214 | { | ||
215 | omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit), | ||
216 | clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
217 | return 0; | ||
218 | } | ||
219 | |||
220 | int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1, | ||
221 | struct clockdomain *clkdm2) | ||
222 | { | ||
223 | omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit), | ||
224 | clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1, | ||
229 | struct clockdomain *clkdm2) | ||
230 | { | ||
231 | return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, | ||
232 | PM_WKDEP, (1 << clkdm2->dep_bit)); | ||
233 | } | ||
234 | |||
235 | int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm) | ||
236 | { | ||
237 | struct clkdm_dep *cd; | ||
238 | u32 mask = 0; | ||
239 | |||
240 | for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { | ||
241 | if (!cd->clkdm) | ||
242 | continue; /* only happens if data is erroneous */ | ||
243 | |||
244 | /* PRM accesses are slow, so minimize them */ | ||
245 | mask |= 1 << cd->clkdm->dep_bit; | ||
246 | atomic_set(&cd->wkdep_usecount, 0); | ||
247 | } | ||
248 | |||
249 | omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, | ||
250 | PM_WKDEP); | ||
251 | return 0; | ||
252 | } | ||
253 | |||