From patchwork Fri Mar 12 15:39:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 85271 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2CDshL3000493 for ; Fri, 12 Mar 2010 13:54:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758114Ab0CLNyq (ORCPT ); Fri, 12 Mar 2010 08:54:46 -0500 Received: from smtp.nokia.com ([192.100.105.134]:53983 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757962Ab0CLNyp (ORCPT ); Fri, 12 Mar 2010 08:54:45 -0500 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o2CDsgGo009081 for ; Fri, 12 Mar 2010 07:54:44 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 12 Mar 2010 15:54:42 +0200 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 12 Mar 2010 15:54:40 +0200 Received: from localhost.localdomain (sokoban.nmp.nokia.com [172.22.215.13]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o2CDsV8o003701 for ; Fri, 12 Mar 2010 15:54:38 +0200 From: Tero Kristo To: linux-omap@vger.kernel.org Subject: [PATCHv7 7/7] OMAP3: PM: Added support for suspending to INACTIVE state Date: Fri, 12 Mar 2010 17:39:17 +0200 Message-Id: <1268408357-15621-7-git-send-email-tero.kristo@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1268408357-15621-6-git-send-email-tero.kristo@nokia.com> References: <> <1268408357-15621-1-git-send-email-tero.kristo@nokia.com> <1268408357-15621-2-git-send-email-tero.kristo@nokia.com> <1268408357-15621-3-git-send-email-tero.kristo@nokia.com> <1268408357-15621-4-git-send-email-tero.kristo@nokia.com> <1268408357-15621-5-git-send-email-tero.kristo@nokia.com> <1268408357-15621-6-git-send-email-tero.kristo@nokia.com> X-OriginalArrivalTime: 12 Mar 2010 13:54:41.0318 (UTC) FILETIME=[90232C60:01CAC1EB] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 12 Mar 2010 13:54:47 +0000 (UTC) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 78b0926..054ec67 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -625,9 +625,11 @@ int omap3_pwrdm_read_next_pwrst(struct powerdomain *pwrdm) return data->next_state; } -/* This sets pwrdm state (other than mpu & core. Currently only ON & - * RET are supported. Function is assuming that clkdm doesn't have - * hw_sup mode enabled. */ +/* + * This sets pwrdm state, used for suspend target state control and + * switching off-mode. Function is assuming that clkdm doesn't have + * hw_sup mode enabled. + */ int set_pwrdm_state(struct powerdomain *pwrdm, u32 state) { u32 cur_state; @@ -637,11 +639,12 @@ int set_pwrdm_state(struct powerdomain *pwrdm, u32 state) if (pwrdm == NULL || IS_ERR(pwrdm)) return -EINVAL; - while (!(pwrdm->pwrsts & (1 << state))) { - if (state == PWRDM_POWER_OFF) - return ret; - state--; - } + if (state != PWRDM_POWER_INACTIVE) + while (!(pwrdm->pwrsts & (1 << state))) { + if (state == PWRDM_POWER_OFF) + return ret; + state--; + } cur_state = pwrdm_read_next_pwrst(pwrdm); if (cur_state == state)