From patchwork Tue Apr 24 14:05:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 8080 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 D5EDC23E1D for ; Tue, 24 Apr 2012 14:06:05 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id A2B76A18963 for ; Tue, 24 Apr 2012 14:06:05 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id l4so411067yen.11 for ; Tue, 24 Apr 2012 07:06:05 -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=LTRB69EiLDFJaVxqFM4oM3T8TwgYlTzEt8ulI1pz8As=; b=fU/eGOIdkaapRMGV+7UfzBl+1ot7gCSnyGsXbDzK12dL9jZ6eNTplw3aksE0EbXLFX 9kSuNI5ghz0aG3E46st1AGmsibkGmaqjBO9tV2PtYVbE4TifNSM24C8YMsB+maMnWAol Xt0Wor0zjShuOmM9I/CBK4eoi3z5g6Sv99zVWFdkkv9NZbjqVvOlGZcK88eRVvpYjG+W 9IteHVePoE6uF7cHJpDjsKd2T4zLwkkpGgshCmebwvSiM5FkVIuXPQHPmUqIZ5vJ+fj6 c3iSRM8vxKhCnX2p9ZIdmKuqcVdEwt03TLbDxfqBlSKxNA0rlEtBpekB+quHWw+O9rat Qg8g== Received: by 10.50.194.163 with SMTP id hx3mr10124169igc.49.1335276365050; Tue, 24 Apr 2012 07:06:05 -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 x6csp183994ibt; Tue, 24 Apr 2012 07:06:04 -0700 (PDT) Received: by 10.216.132.8 with SMTP id n8mr12229452wei.36.1335276363298; Tue, 24 Apr 2012 07:06:03 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id bt18si11680888wib.39.2012.04.24.07.06.02 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 07:06:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=209.85.212.172; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by wibhj6 with SMTP id hj6so3194381wib.13 for ; Tue, 24 Apr 2012 07:06:02 -0700 (PDT) Received: by 10.180.101.8 with SMTP id fc8mr31855642wib.12.1335276362773; Tue, 24 Apr 2012 07:06:02 -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.01 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 07:06:02 -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 11/18][V3] ARM: OMAP3: cpuidle - remove the 'valid' field Date: Tue, 24 Apr 2012 16:05:32 +0200 Message-Id: <1335276339-11135-12-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: ALoCoQlrpgZPSwTbHsGwtMOm5aCI/gHV3U1k8h4mQa3hSE43q0d2KZ6JNM2Xa73aTulYhQf5TCHz With the previous changes all the states are valid, except the last state which can be handled by decreasing the number of states. Signed-off-by: Daniel Lezcano Reviewed-by: Jean Pihet --- arch/arm/mach-omap2/cpuidle34xx.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index f394ea6..29b4f87 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -67,7 +67,6 @@ static struct cpuidle_params cpuidle_params_table[] = { struct omap3_idle_statedata { u32 mpu_state; u32 core_state; - u8 valid; }; struct omap3_idle_statedata omap3_idle_data[OMAP3_NUM_STATES]; @@ -191,8 +190,7 @@ static int next_valid_state(struct cpuidle_device *dev, } /* Check if current state is valid */ - if ((cx->valid) && - (cx->mpu_state >= mpu_deepest_state) && + if ((cx->mpu_state >= mpu_deepest_state) && (cx->core_state >= core_deepest_state)) { return index; } else { @@ -216,8 +214,7 @@ static int next_valid_state(struct cpuidle_device *dev, idx--; for (; idx >= 0; idx--) { cx = cpuidle_get_statedata(&dev->states_usage[idx]); - if ((cx->valid) && - (cx->mpu_state >= mpu_deepest_state) && + if ((cx->mpu_state >= mpu_deepest_state) && (cx->core_state >= core_deepest_state)) { next_index = idx; break; @@ -371,7 +368,6 @@ static inline struct omap3_idle_statedata *_fill_cstate_usage( struct omap3_idle_statedata *cx = &omap3_idle_data[idx]; struct cpuidle_state_usage *state_usage = &dev->states_usage[idx]; - cx->valid = cpuidle_params_table[idx].valid; cpuidle_set_statedata(state_usage, cx); return cx; @@ -386,7 +382,6 @@ static inline struct omap3_idle_statedata *_fill_cstate_usage( int __init omap3_idle_init(void) { struct cpuidle_device *dev; - struct cpuidle_driver *drv = &omap3_idle_driver; struct omap3_idle_statedata *cx; mpu_pd = pwrdm_lookup("mpu_pwrdm"); @@ -399,7 +394,6 @@ int __init omap3_idle_init(void) /* C1 . MPU WFI + Core active */ cx = _fill_cstate_usage(dev, 0); - cx->valid = 1; /* C1 is always valid */ cx->mpu_state = PWRDM_POWER_ON; cx->core_state = PWRDM_POWER_ON; @@ -433,7 +427,6 @@ int __init omap3_idle_init(void) cx->mpu_state = PWRDM_POWER_OFF; cx->core_state = PWRDM_POWER_OFF; - drv->state_count = OMAP3_NUM_STATES; cpuidle_register_driver(&omap3_idle_driver); if (cpuidle_register_device(dev)) {