From patchwork Wed Oct 21 11:51:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Jokiniemi X-Patchwork-Id: 55071 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 n9LBpBIq012342 for ; Wed, 21 Oct 2009 11:51:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753375AbZJULvD (ORCPT ); Wed, 21 Oct 2009 07:51:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753370AbZJULvD (ORCPT ); Wed, 21 Oct 2009 07:51:03 -0400 Received: from smtp1.digia.com ([82.118.214.156]:10266 "EHLO smtp1.digia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753369AbZJULvC (ORCPT ); Wed, 21 Oct 2009 07:51:02 -0400 Received: from smtp1.digia.com (unknown [127.0.0.1]) by IMSA (Postfix) with ESMTP id 7E72D4786C2; Wed, 21 Oct 2009 14:51:04 +0300 (EEST) Received: from IT-EXCH02-HKI.it.local (unknown [10.9.52.55]) by smtp1.digia.com (Postfix) with ESMTP id 70AD24786BE; Wed, 21 Oct 2009 14:51:04 +0300 (EEST) Received: from localhost.localdomain (10.120.146.33) by IT-EXCH02-HKI.it.local (10.9.52.56) with Microsoft SMTP Server id 8.1.340.0; Wed, 21 Oct 2009 14:51:04 +0300 From: Kalle Jokiniemi To: CC: , Kalle Jokiniemi Subject: [PATCH 2/3] PM: Skip PER previous state register read Date: Wed, 21 Oct 2009 14:51:20 +0300 Message-ID: <1256125881-12441-3-git-send-email-kalle.jokiniemi@digia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1256125881-12441-2-git-send-email-kalle.jokiniemi@digia.com> References: <> <1256125881-12441-1-git-send-email-kalle.jokiniemi@digia.com> <1256125881-12441-2-git-send-email-kalle.jokiniemi@digia.com> MIME-Version: 1.0 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 237c819..b70ea19 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -489,12 +489,19 @@ void omap_sram_idle(void) /* PER */ if (per_next_state < PWRDM_POWER_ON) { - per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); - if (per_prev_state == PWRDM_POWER_OFF) { - omap3_per_restore_context(); - omap3_gpio_restore_pad_context(0); - } else if (per_next_state == PWRDM_POWER_OFF) - omap3_gpio_restore_pad_context(1); + if (per_next_state == PWRDM_POWER_OFF) { + /* + * Reading the prev-state takes long time (11us@OPP2), + * only do it, if we really tried to put PER in OFF + */ + per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); + if (per_prev_state == PWRDM_POWER_OFF) { + omap3_per_restore_context(); + omap3_gpio_restore_pad_context(0); + } else if (per_next_state == PWRDM_POWER_OFF) { + omap3_gpio_restore_pad_context(1); + } + } omap2_gpio_resume_after_idle(); omap_uart_resume_idle(2); if (per_state_modified)