From patchwork Fri Oct 16 10:49:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 54219 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9GB8hRT026877 for ; Fri, 16 Oct 2009 11:08:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756483AbZJPLEY (ORCPT ); Fri, 16 Oct 2009 07:04:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758124AbZJPLEY (ORCPT ); Fri, 16 Oct 2009 07:04:24 -0400 Received: from smtp.nokia.com ([192.100.122.233]:32269 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756440AbZJPLEX (ORCPT ); Fri, 16 Oct 2009 07:04:23 -0400 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9GB2f4a011809 for ; Fri, 16 Oct 2009 14:02:55 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2009 14:02:51 +0300 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2009 14:02:51 +0300 Received: from localhost.localdomain (sokoban.ntc.nokia.com [172.22.144.95]) by mgw-sa02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9GB2fa1022261 for ; Fri, 16 Oct 2009 14:02:50 +0300 From: Tero Kristo To: linux-omap@vger.kernel.org Subject: [PATCH 07/17] OMAP3: Disable Smartreflex before pwrdm enters RET Date: Fri, 16 Oct 2009 13:49:00 +0300 Message-Id: <1255690150-16853-8-git-send-email-tero.kristo@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1255690150-16853-7-git-send-email-tero.kristo@nokia.com> References: <> <1255690150-16853-1-git-send-email-tero.kristo@nokia.com> <1255690150-16853-2-git-send-email-tero.kristo@nokia.com> <1255690150-16853-3-git-send-email-tero.kristo@nokia.com> <1255690150-16853-4-git-send-email-tero.kristo@nokia.com> <1255690150-16853-5-git-send-email-tero.kristo@nokia.com> <1255690150-16853-6-git-send-email-tero.kristo@nokia.com> <1255690150-16853-7-git-send-email-tero.kristo@nokia.com> X-OriginalArrivalTime: 16 Oct 2009 11:02:51.0583 (UTC) FILETIME=[345534F0:01CA4E50] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 3e5ae14..5854fa7 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -531,11 +531,17 @@ void omap_sram_idle(void) if (pwrdm_read_pwrst(cam_pwrdm) == PWRDM_POWER_ON) omap2_clkdm_deny_idle(mpu_pwrdm->pwrdm_clkdms[0]); - /* CORE */ - if (core_next_state < PWRDM_POWER_ON) { - /* Disable smartreflex before entering WFI */ + /* + * Disable smartreflex before entering WFI. + * Only needed if we are going to enter retention or off. + */ + if (mpu_next_state <= PWRDM_POWER_RET) disable_smartreflex(SR1); + if (core_next_state <= PWRDM_POWER_RET) disable_smartreflex(SR2); + + /* CORE */ + if (core_next_state < PWRDM_POWER_ON) { omap_uart_prepare_idle(0); omap_uart_prepare_idle(1); if (core_next_state == PWRDM_POWER_OFF) { @@ -608,10 +614,17 @@ void omap_sram_idle(void) prm_clear_mod_reg_bits(OMAP3430_AUTO_RET, OMAP3430_GR_MOD, OMAP3_PRM_VOLTCTRL_OFFSET); - /* Enable smartreflex after WFI */ + } + + /* + * Enable smartreflex after WFI. Only needed if we + * entered retention or off. + */ + if (mpu_next_state <= PWRDM_POWER_RET) enable_smartreflex(SR1); + if (core_next_state <= PWRDM_POWER_RET) enable_smartreflex(SR2); - } + if (core_saved_state != core_next_state) pwrdm_set_next_pwrst(core_pwrdm, core_saved_state);