From patchwork Tue Apr 24 14:05:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 8082 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A752F23E1D for ; Tue, 24 Apr 2012 14:06:08 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6DE61A1895C for ; Tue, 24 Apr 2012 14:06:08 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so1457668iag.11 for ; Tue, 24 Apr 2012 07:06:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=7eIyKq82C+v+MU7zOibhPZmO5H2dVjmtjvqyC1dDbHo=; b=e2O2C6omJndci5GrTOGjFlfzk9n5XenEa+/b7tJg/UsyaDnpAzn094Dbt4X+PL0wKx +7IQDLQSXdnf0bI8Ii27vDG+t5w9WBDDGBWjfZU1FigfvYsXP46bi1e6E+mru1jiqb2W g772caXX+k0Pxsh3HhYeb6Zp1jNkEbHZ6rNhfY4rXOu+VTTJUzm867b4H39KL7HaQCxP ilGZAGQM4EnjOWynQmUrk2QsbB4aKk/8Dj3dKJ7GAK9hUJC6/4QAL6OpuWJZiBNlqlpD ewey6yAwe+OjLxkHFfHe1G03zSj/eLOD36EW8b+g5qwt+UniEQh2bQ5JzLiCiais0z/W 11iA== Received: by 10.50.207.38 with SMTP id lt6mr3222166igc.55.1335276368212; Tue, 24 Apr 2012 07:06:08 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp184002ibt; Tue, 24 Apr 2012 07:06:07 -0700 (PDT) Received: by 10.180.102.3 with SMTP id fk3mr8219902wib.9.1335276366923; Tue, 24 Apr 2012 07:06:06 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id w28si19326272weq.138.2012.04.24.07.06.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 07:06:06 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-we0-f178.google.com with SMTP id a13so605477wer.37 for ; Tue, 24 Apr 2012 07:06:06 -0700 (PDT) Received: by 10.180.103.35 with SMTP id ft3mr16765363wib.0.1335276366449; Tue, 24 Apr 2012 07:06:06 -0700 (PDT) Received: from localhost.localdomain (AToulouse-159-1-17-225.w92-134.abo.wanadoo.fr. [92.134.64.225]) by mx.google.com with ESMTPS id fl2sm47121222wib.2.2012.04.24.07.06.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 07:06:05 -0700 (PDT) From: Daniel Lezcano To: santosh.shilimkar@ti.com, jean.pihet@newoldbits.com, khilman@ti.com, tony@atomide.com Cc: linux-omap@vger.kernel.org, linaro-dev@lists.linaro.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org Subject: [PATCH 13/18][V3] ARM: OMAP3: define statically the omap3_idle_data Date: Tue, 24 Apr 2012 16:05:34 +0200 Message-Id: <1335276339-11135-14-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1335276339-11135-1-git-send-email-daniel.lezcano@linaro.org> References: <1335276339-11135-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQlxaF7dIbJHSrYa4nRjiqqg8DeNoweWK2BzlcdoB7volQqxhwpv2uIKTVQL1mmY4pNyXWy6 Initialize the omap3_idle_data array at compile time, that will allow to remove the initialization at boot time. Signed-off-by: Daniel Lezcano Reviewed-by: Jean Pihet --- arch/arm/mach-omap2/cpuidle34xx.c | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index a82a887..93e2450 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -44,9 +44,36 @@ struct omap3_idle_statedata { u32 core_state; }; -#define OMAP3_NUM_STATES 7 - -struct omap3_idle_statedata omap3_idle_data[OMAP3_NUM_STATES]; +struct omap3_idle_statedata omap3_idle_data[] = { + { + .mpu_state = PWRDM_POWER_ON, + .core_state = PWRDM_POWER_ON, + }, + { + .mpu_state = PWRDM_POWER_ON, + .core_state = PWRDM_POWER_ON, + }, + { + .mpu_state = PWRDM_POWER_RET, + .core_state = PWRDM_POWER_ON, + }, + { + .mpu_state = PWRDM_POWER_OFF, + .core_state = PWRDM_POWER_ON, + }, + { + .mpu_state = PWRDM_POWER_RET, + .core_state = PWRDM_POWER_RET, + }, + { + .mpu_state = PWRDM_POWER_OFF, + .core_state = PWRDM_POWER_RET, + }, + { + .mpu_state = PWRDM_POWER_OFF, + .core_state = PWRDM_POWER_OFF, + }, +}; struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; @@ -172,7 +199,7 @@ static int next_valid_state(struct cpuidle_device *dev, (cx->core_state >= core_deepest_state)) { return index; } else { - int idx = OMAP3_NUM_STATES - 1; + int idx = ARRAY_SIZE(omap3_idle_data) - 1; /* Reach the current state starting at highest C-state */ for (; idx >= 0; idx--) { @@ -334,7 +361,7 @@ struct cpuidle_driver omap3_idle_driver = { .desc = "MPU OFF + CORE OFF", }, }, - .state_count = OMAP3_NUM_STATES, + .state_count = ARRAY_SIZE(omap3_idle_data), .safe_state_index = 0, };