From patchwork Fri Oct 23 16:59:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 55590 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 n9NGxTNo026304 for ; Fri, 23 Oct 2009 16:59:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbZJWQ7T (ORCPT ); Fri, 23 Oct 2009 12:59:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752703AbZJWQ7T (ORCPT ); Fri, 23 Oct 2009 12:59:19 -0400 Received: from qw-out-2122.google.com ([74.125.92.25]:11746 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752651AbZJWQ7S (ORCPT ); Fri, 23 Oct 2009 12:59:18 -0400 Received: by qw-out-2122.google.com with SMTP id 9so1391355qwb.37 for ; Fri, 23 Oct 2009 09:59:23 -0700 (PDT) Received: by 10.224.52.221 with SMTP id j29mr5496148qag.347.1256317163517; Fri, 23 Oct 2009 09:59:23 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id 5sm2243958qwg.0.2009.10.23.09.59.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Oct 2009 09:59:22 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/10] OMAP3: PM: CPUidle: obey enable_off_mode flag Date: Fri, 23 Oct 2009 09:59:01 -0700 Message-Id: <1256317148-25506-4-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.4.3 In-Reply-To: <1256317148-25506-3-git-send-email-khilman@deeprootsystems.com> References: <1256317148-25506-1-git-send-email-khilman@deeprootsystems.com> <1256317148-25506-2-git-send-email-khilman@deeprootsystems.com> <1256317148-25506-3-git-send-email-khilman@deeprootsystems.com> 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/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 0bf1bc3..1120494 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -29,6 +29,8 @@ #include #include +#include "pm.h" + #ifdef CONFIG_CPU_IDLE #define OMAP3_MAX_STATES 7 @@ -74,6 +76,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev, { struct omap3_processor_cx *cx = cpuidle_get_statedata(state); struct timespec ts_preidle, ts_postidle, ts_idle; + u32 mpu_state = cx->mpu_state, core_state = cx->core_state; current_cx_state = *cx; @@ -83,8 +86,15 @@ static int omap3_enter_idle(struct cpuidle_device *dev, local_irq_disable(); local_fiq_disable(); - set_pwrdm_state(mpu_pd, cx->mpu_state); - set_pwrdm_state(core_pd, cx->core_state); + if (!enable_off_mode) { + if (mpu_state < PWRDM_POWER_RET) + mpu_state = PWRDM_POWER_RET; + if (core_state < PWRDM_POWER_RET) + core_state = PWRDM_POWER_RET; + } + + set_pwrdm_state(mpu_pd, mpu_state); + set_pwrdm_state(core_pd, core_state); if (omap_irq_pending()) goto return_sleep_time;