diff options
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.c | 40 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.h | 5 |
2 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index 0fe3f147f262..eb2a472bbf46 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c | |||
@@ -309,3 +309,43 @@ int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_off | |||
309 | 309 | ||
310 | return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; | 310 | return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; |
311 | } | 311 | } |
312 | |||
313 | /** | ||
314 | * omap4_cminst_module_enable - Enable the modulemode inside CLKCTRL | ||
315 | * @mode: Module mode (SW or HW) | ||
316 | * @part: PRCM partition ID that the CM_CLKCTRL register exists in | ||
317 | * @inst: CM instance register offset (*_INST macro) | ||
318 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
319 | * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro) | ||
320 | * | ||
321 | * No return value. | ||
322 | */ | ||
323 | void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs, | ||
324 | u16 clkctrl_offs) | ||
325 | { | ||
326 | u32 v; | ||
327 | |||
328 | v = omap4_cminst_read_inst_reg(part, inst, clkctrl_offs); | ||
329 | v &= ~OMAP4430_MODULEMODE_MASK; | ||
330 | v |= mode << OMAP4430_MODULEMODE_SHIFT; | ||
331 | omap4_cminst_write_inst_reg(v, part, inst, clkctrl_offs); | ||
332 | } | ||
333 | |||
334 | /** | ||
335 | * omap4_cminst_module_disable - Disable the module inside CLKCTRL | ||
336 | * @part: PRCM partition ID that the CM_CLKCTRL register exists in | ||
337 | * @inst: CM instance register offset (*_INST macro) | ||
338 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
339 | * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro) | ||
340 | * | ||
341 | * No return value. | ||
342 | */ | ||
343 | void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, | ||
344 | u16 clkctrl_offs) | ||
345 | { | ||
346 | u32 v; | ||
347 | |||
348 | v = omap4_cminst_read_inst_reg(part, inst, clkctrl_offs); | ||
349 | v &= ~OMAP4430_MODULEMODE_MASK; | ||
350 | omap4_cminst_write_inst_reg(v, part, inst, clkctrl_offs); | ||
351 | } | ||
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h index a98540081f97..f2ea6453ade0 100644 --- a/arch/arm/mach-omap2/cminst44xx.h +++ b/arch/arm/mach-omap2/cminst44xx.h | |||
@@ -20,6 +20,11 @@ extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs); | |||
20 | extern int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs); | 20 | extern int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs); |
21 | extern int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs); | 21 | extern int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs); |
22 | 22 | ||
23 | extern void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs, | ||
24 | u16 clkctrl_offs); | ||
25 | extern void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, | ||
26 | u16 clkctrl_offs); | ||
27 | |||
23 | /* | 28 | /* |
24 | * In an ideal world, we would not export these low-level functions, | 29 | * In an ideal world, we would not export these low-level functions, |
25 | * but this will probably take some time to fix properly | 30 | * but this will probably take some time to fix properly |