From 12627578523d2d9396cae76b1dad0ed3dccf1730 Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Tue, 21 Dec 2010 20:01:18 -0700 Subject: OMAP: powerdomain: Arch specific funcs for logic control Define the following architecture specific funtions for omap2/3/4 .pwrdm_set_logic_retst .pwrdm_read_logic_pwrst .pwrdm_read_prev_logic_pwrst .pwrdm_read_logic_retst Convert the platform-independent framework to call these functions. Signed-off-by: Rajendra Nayak Signed-off-by: Paul Walmsley Cc: Benoit Cousson Cc: Kevin Hilman Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman Tested-by: Santosh Shilimkar Tested-by: Rajendra Nayak --- arch/arm/mach-omap2/powerdomain44xx.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'arch/arm/mach-omap2/powerdomain44xx.c') diff --git a/arch/arm/mach-omap2/powerdomain44xx.c b/arch/arm/mach-omap2/powerdomain44xx.c index 5dc337c0e5d5..996790acebc9 100644 --- a/arch/arm/mach-omap2/powerdomain44xx.c +++ b/arch/arm/mach-omap2/powerdomain44xx.c @@ -47,9 +47,35 @@ static int omap4_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) OMAP4430_LASTPOWERSTATEENTERED_MASK); } +static int omap4_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) +{ + u32 v; + + v = pwrst << __ffs(OMAP4430_LOGICRETSTATE_MASK); + prm_rmw_mod_reg_bits(OMAP4430_LOGICRETSTATE_MASK, v, + pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL); + + return 0; +} + +static int omap4_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm) +{ + return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP4_PM_PWSTST, + OMAP4430_LOGICSTATEST_MASK); +} + +static int omap4_pwrdm_read_logic_retst(struct powerdomain *pwrdm) +{ + return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL, + OMAP4430_LOGICRETSTATE_MASK); +} + struct pwrdm_ops omap4_pwrdm_operations = { .pwrdm_set_next_pwrst = omap4_pwrdm_set_next_pwrst, .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_set_logic_retst = omap4_pwrdm_set_logic_retst, + .pwrdm_read_logic_pwrst = omap4_pwrdm_read_logic_pwrst, + .pwrdm_read_logic_retst = omap4_pwrdm_read_logic_retst, }; -- cgit v1.2.3