From patchwork Tue Apr 24 14:05:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 8074 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 534E123E1D for ; Tue, 24 Apr 2012 14:05:53 +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 19B74A18965 for ; Tue, 24 Apr 2012 14:05:52 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so1457668iag.11 for ; Tue, 24 Apr 2012 07:05:52 -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=ocxhDJ6S0wp6IQULxXgGm2PSPJ9LElbym5OzeyOBFgg=; b=E5mx9JPbZo4MXkoWxPfSmdkXA6+VGkeaL5yeyGMBwQES+nR4Eh92prEuoHtB9KkbPx dEFCBiQHpoegWuKEsHfyC0kgj94M9psXc+F1GoDXdJkuoY9Y1SZpjUBn6jYyerIRqLIS PrXmDZy3uBK/uFsFo1R1krtjzoF1HRBWB6uJP+q+Y8ZKMA4xlyYewVGVA774JTT3vaBr NQXtqXjYjRhrcjDzBFsiDNJmNwgZ1Q9sRCfRT3oQRfdhMPM/opggdFyTVhb+KYKGiy0l KAWJo9R0Y8KpApm8BbMbHHbn6shCz5jMHeZbPCapNNISdCxJNUcynRIwRGHJ1tlGclq4 yNaQ== Received: by 10.50.185.233 with SMTP id ff9mr10311485igc.55.1335276352830; Tue, 24 Apr 2012 07:05:52 -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 x6csp183957ibt; Tue, 24 Apr 2012 07:05:52 -0700 (PDT) Received: by 10.180.81.37 with SMTP id w5mr19396618wix.16.1335276351429; Tue, 24 Apr 2012 07:05:51 -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.05.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 07:05:51 -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:05:51 -0700 (PDT) Received: by 10.180.97.4 with SMTP id dw4mr23138129wib.18.1335276350948; Tue, 24 Apr 2012 07:05:50 -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.05.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 07:05:50 -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 05/18][V3] ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time Date: Tue, 24 Apr 2012 16:05:26 +0200 Message-Id: <1335276339-11135-6-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: ALoCoQlU/KkGmv/6ZnOyFmzP48WRNVfPLfI2wrTIuxymn+ALgBlEnln8KbttsIazUu49ft3hI8AZ We initialize the omap4_idle_data variable at compile time allowing us to remove in the next patch the initialization done at boot time. Signed-off-by: Daniel Lezcano Reviewed-by: Jean Pihet Reviewed-by: Santosh Shilimkar --- arch/arm/mach-omap2/cpuidle44xx.c | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index 38ecd27..9e3effa 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c @@ -31,9 +31,24 @@ struct omap4_idle_statedata { u32 mpu_state; }; -#define OMAP4_NUM_STATES 3 +static struct omap4_idle_statedata omap4_idle_data[] = { + { + .cpu_state = PWRDM_POWER_ON, + .mpu_state = PWRDM_POWER_ON, + .mpu_logic_state = PWRDM_POWER_RET, + }, + { + .cpu_state = PWRDM_POWER_OFF, + .mpu_state = PWRDM_POWER_RET, + .mpu_logic_state = PWRDM_POWER_RET, + }, + { + .cpu_state = PWRDM_POWER_OFF, + .mpu_state = PWRDM_POWER_RET, + .mpu_logic_state = PWRDM_POWER_OFF, + }, +}; -static struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES]; static struct powerdomain *mpu_pd, *cpu0_pd, *cpu1_pd; /** @@ -152,7 +167,7 @@ struct cpuidle_driver omap4_idle_driver = { .desc = "MPUSS OSWR", }, }, - .state_count = OMAP4_NUM_STATES, + .state_count = ARRAY_SIZE(omap4_idle_data), .safe_state_index = 0, };