From bd802481cf4e2d6b549976790343b3f166ccd2a3 Mon Sep 17 00:00:00 2001 From: Kalle Jokiniemi Date: Fri, 29 Aug 2008 13:05:44 +0300 Subject: [PATCH] ARM:OMAP3: Smartreflex disable/enable fix Smartreflex modules have to be disabled when device enters WFI. Previously only suspend idle path had these calls. By moving the disable/enable calls to omap_sram_idle, all idle paths will be covered. Signed-off-by: Kalle Jokiniemi Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/pm34xx.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index a16eb337503..e2d11198a12 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -166,12 +166,19 @@ static void omap_sram_idle(void) printk(KERN_ERR "Invalid mpu state in sram_idle\n"); return; } + /* Disable smartreflex before entering WFI */ + disable_smartreflex(SR1); + disable_smartreflex(SR2); omap2_gpio_prepare_for_retention(); _omap_sram_idle(NULL, save_state); omap2_gpio_resume_after_retention(); + + /* Enable smartreflex after WFI */ + enable_smartreflex(SR1); + enable_smartreflex(SR2); } /* @@ -297,10 +304,6 @@ static int omap3_pm_suspend(void) struct power_state *pwrst; int state, ret = 0; - /* XXX Disable smartreflex before entering suspend */ - disable_smartreflex(SR1); - disable_smartreflex(SR2); - /* Read current next_pwrsts */ list_for_each_entry(pwrst, &pwrst_list, node) pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm); @@ -332,10 +335,6 @@ restore: printk(KERN_INFO "Successfully put all powerdomains " "to target state\n"); - /* XXX Enable smartreflex after suspend */ - enable_smartreflex(SR1); - enable_smartreflex(SR2); - return ret; } -- 2.41.0