diff mbox

[RFC,8/8] omap4: powerdomain: Add pwrdm_clear_all_prev_pwrst

Message ID 1285245291-26442-9-git-send-email-rnayak@ti.com (mailing list archive)
State New, archived
Delegated to: Paul Walmsley
Headers show

Commit Message

Rajendra Nayak Sept. 23, 2010, 12:34 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/powerdomains44xx.c b/arch/arm/mach-omap2/powerdomains44xx.c
index 3c4b060..7248647 100644
--- a/arch/arm/mach-omap2/powerdomains44xx.c
+++ b/arch/arm/mach-omap2/powerdomains44xx.c
@@ -44,6 +44,19 @@  int omap4_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
 				OMAP4430_LASTPOWERSTATEENTERED_MASK);
 }
 
+int omap4_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
+{
+	u32 reg;
+
+	omap4_prm_rmw_mod_reg_bits(OMAP4430_LASTPOWERSTATEENTERED_MASK,
+			0x3 << OMAP4430_LASTPOWERSTATEENTERED_SHIFT,
+				pwrdm->prcm_offs, OMAP4_PM_PWSTST);
+	reg = omap4_prm_read_mod_reg(pwrdm->prcm_offs, pwrdm->context_offset);
+	omap4_prm_write_mod_reg(reg, pwrdm->prcm_offs, pwrdm->context_offset);
+
+	return 0;
+}
+
 int omap4_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
 {
 	omap4_prm_rmw_mod_reg_bits(OMAP4430_LOWPOWERSTATECHANGE_MASK,
@@ -151,6 +164,7 @@  struct pwrdm_functions omap4_pwrdm_functions = {
 	.pwrdm_read_next_pwrst	= omap4_pwrdm_read_next_pwrst,
 	.pwrdm_read_pwrst	= omap4_pwrdm_read_pwrst,
 	.pwrdm_read_prev_pwrst	= omap4_pwrdm_read_prev_pwrst,
+	.pwrdm_clear_all_prev_pwrst	= omap4_pwrdm_clear_all_prev_pwrst,
 	.pwrdm_set_lowpwrstchange	= omap4_pwrdm_set_lowpwrstchange,
 	.pwrdm_set_logic_retst	= omap4_pwrdm_set_logic_retst,
 	.pwrdm_read_logic_pwrst	= omap4_pwrdm_read_logic_pwrst,