summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/prm2xxx.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-02-26 17:31:05 +0400
committerTero Kristo <t-kristo@ti.com>2014-07-04 18:02:16 +0400
commit6bdc4b44b3acc95655b061a88c951c6d9742d8e3 (patch)
tree025428926f739a7fcc448581706fb63d44ed8614 /arch/arm/mach-omap2/prm2xxx.c
parent7e28b465fdea3f0601a1c76e47c50d05c7c603e2 (diff)
downloadlinux-6bdc4b44b3acc95655b061a88c951c6d9742d8e3.tar.xz
ARM: OMAP24xx: PRM: add API for clearing wakeup status bits
This helps to isolate the PRM into its own driver. Signed-off-by: Tero Kristo <t-kristo@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx.c')
-rw-r--r--arch/arm/mach-omap2/prm2xxx.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx.c b/arch/arm/mach-omap2/prm2xxx.c
index a3a3cca2bcc4..86958050547a 100644
--- a/arch/arm/mach-omap2/prm2xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx.c
@@ -114,6 +114,24 @@ void omap2xxx_prm_dpll_reset(void)
omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTCTRL);
}
+/**
+ * omap2xxx_prm_clear_mod_irqs - clear wakeup status bits for a module
+ * @module: PRM module to clear wakeups from
+ * @regs: register offset to clear
+ * @wkst_mask: wakeup status mask to clear
+ *
+ * Clears wakeup status bits for a given module, so that the device can
+ * re-enter idle.
+ */
+void omap2xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 wkst_mask)
+{
+ u32 wkst;
+
+ wkst = omap2_prm_read_mod_reg(module, regs);
+ wkst &= wkst_mask;
+ omap2_prm_write_mod_reg(wkst, module, regs);
+}
+
int omap2xxx_clkdm_sleep(struct clockdomain *clkdm)
{
omap2_prm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,