From patchwork Fri Mar 13 16:04:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjeev Premi X-Patchwork-Id: 11760 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 n2DG4bYR029862 for ; Fri, 13 Mar 2009 16:04:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986AbZCMQEh (ORCPT ); Fri, 13 Mar 2009 12:04:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752348AbZCMQEh (ORCPT ); Fri, 13 Mar 2009 12:04:37 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:51633 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757AbZCMQEg (ORCPT ); Fri, 13 Mar 2009 12:04:36 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n2DG4SQN020818 for ; Fri, 13 Mar 2009 11:04:34 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n2DG4Pq3028694; Fri, 13 Mar 2009 21:34:26 +0530 (IST) From: Sanjeev Premi To: linux-omap@vger.kernel.org Cc: Sanjeev Premi Subject: [PATCHv3] PM: Start C-state definitions from base 0 Date: Fri, 13 Mar 2009 21:34:25 +0530 Message-Id: <1236960265-19734-1-git-send-email-premi@ti.com> X-Mailer: git-send-email 1.5.6 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The current definition of C-states starts from base 1. Whereas, the cpuidle driver uses base 0. This patch eliminates need for explicit mapping (add/ sbutract) due to different base values. Signed-off-by: Sanjeev Premi --- arch/arm/mach-omap2/cpuidle34xx.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 62fbb2e..04119e4 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -33,13 +33,13 @@ #ifdef CONFIG_CPU_IDLE -#define OMAP3_MAX_STATES 7 -#define OMAP3_STATE_C1 1 /* C1 - MPU WFI + Core active */ -#define OMAP3_STATE_C2 2 /* C2 - MPU CSWR + Core active */ -#define OMAP3_STATE_C3 3 /* C3 - MPU OFF + Core active */ -#define OMAP3_STATE_C4 4 /* C4 - MPU RET + Core RET */ -#define OMAP3_STATE_C5 5 /* C5 - MPU OFF + Core RET */ -#define OMAP3_STATE_C6 6 /* C6 - MPU OFF + Core OFF */ +#define OMAP3_MAX_STATES 6 +#define OMAP3_STATE_C1 0 /* C1 - MPU WFI + Core active */ +#define OMAP3_STATE_C2 1 /* C2 - MPU CSWR + Core active */ +#define OMAP3_STATE_C3 2 /* C3 - MPU OFF + Core active */ +#define OMAP3_STATE_C4 3 /* C4 - MPU RET + Core RET */ +#define OMAP3_STATE_C5 4 /* C5 - MPU OFF + Core RET */ +#define OMAP3_STATE_C6 5 /* C6 - MPU OFF + Core OFF */ struct omap3_processor_cx { u8 valid; @@ -244,7 +244,7 @@ int omap3_idle_init(void) dev = &per_cpu(omap3_idle_dev, smp_processor_id()); - for (i = 1; i < OMAP3_MAX_STATES; i++) { + for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { cx = &omap3_power_states[i]; state = &dev->states[count];