From patchwork Mon Feb 4 12:01:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 14523 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 D020D23F96 for ; Mon, 4 Feb 2013 12:01:52 +0000 (UTC) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by fiordland.canonical.com (Postfix) with ESMTP id 781C7A192D3 for ; Mon, 4 Feb 2013 12:01:52 +0000 (UTC) Received: by mail-ve0-f177.google.com with SMTP id m1so4635239ves.36 for ; Mon, 04 Feb 2013 04:01:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=C/LzMO9s+IZ7Sbv0cWFX2ju56BJoPAj2iQcKAmpyPG0=; b=edcIbTLrSr/BwmfDP3zsy64gsrxztXo5boXD7xd+Pvt6vaaosUm79o5wJBmJZEoJo+ sME8XGZBAZXACQAVNOIAMw34TKrhl43cMz5xO1X+MlgXPg119x6juUa4wpHUVf0FYg/0 Nj/ZJQibZgIOOFybmS9rfuGwnBQqp5SxmucC8/3tPTOuzCYAdzC/NYD3d8iFf21/hT8y Kb7CvVzQPKMXoljg8n/bPvjWWQNX+9aihWfys1PIwj7Ok+PAX8EIujttqSZbQ8GZmZqO rA82SjnUbeZgvtW/QbK9lIVDQ0wWboXdkRFvcWDIYWE6emlk+uTWNrEkeQKkubxR5lRN rsQg== X-Received: by 10.52.21.146 with SMTP id v18mr18946115vde.79.1359979311973; Mon, 04 Feb 2013 04:01:51 -0800 (PST) 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.58.252.8 with SMTP id zo8csp83306vec; Mon, 4 Feb 2013 04:01:50 -0800 (PST) X-Received: by 10.194.58.175 with SMTP id s15mr34613284wjq.31.1359979310384; Mon, 04 Feb 2013 04:01:50 -0800 (PST) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx.google.com with ESMTPS id lv9si5728964wjb.36.2013.02.04.04.01.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 04:01:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.182 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=209.85.212.182; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.182 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-wi0-f182.google.com with SMTP id hi18so1497789wib.3 for ; Mon, 04 Feb 2013 04:01:49 -0800 (PST) X-Received: by 10.194.174.196 with SMTP id bu4mr34513803wjc.35.1359979309751; Mon, 04 Feb 2013 04:01:49 -0800 (PST) Received: from mai.home (AToulouse-654-1-332-150.w86-199.abo.wanadoo.fr. [86.199.219.150]) by mx.google.com with ESMTPS id j9sm12967916wia.5.2013.02.04.04.01.46 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 04:01:48 -0800 (PST) From: Daniel Lezcano To: khilman@deeprootsystems.com, nsekhar@ti.com Cc: patches@linaro.org, linaro-dev@lists.linaro.org, davinci-linux-open-source@linux.davincidsp.com, lenb@kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 1/4][V2] davinci: cpuidle - use global variable for ddr2 flag Date: Mon, 4 Feb 2013 13:01:41 +0100 Message-Id: <1359979304-8715-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359979304-8715-1-git-send-email-daniel.lezcano@linaro.org> References: <1359979304-8715-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQk8sjXySfGzf/I1z/imTfltjvFlzBIYj92kegQbA0QKreB9i3OwuMApKf3VScn//tgHiouv Replace the flag by a simple global boolean in the cpuidle.c. That will allow to cleanup the rest of the code right after, because the ops won't make sense. Signed-off-by: Daniel Lezcano Acked-by: Sekhar Nori --- arch/arm/mach-davinci/cpuidle.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c index 9107691..5fbd470 100644 --- a/arch/arm/mach-davinci/cpuidle.c +++ b/arch/arm/mach-davinci/cpuidle.c @@ -26,8 +26,8 @@ #define DAVINCI_CPUIDLE_MAX_STATES 2 struct davinci_ops { - void (*enter) (u32 flags); - void (*exit) (u32 flags); + void (*enter) (void); + void (*exit) (void); u32 flags; }; @@ -40,20 +40,17 @@ static int davinci_enter_idle(struct cpuidle_device *dev, struct davinci_ops *ops = cpuidle_get_statedata(state_usage); if (ops && ops->enter) - ops->enter(ops->flags); + ops->enter(); index = cpuidle_wrap_enter(dev, drv, index, arm_cpuidle_simple_enter); if (ops && ops->exit) - ops->exit(ops->flags); + ops->exit(); return index; } -/* fields in davinci_ops.flags */ -#define DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN BIT(0) - static struct cpuidle_driver davinci_idle_driver = { .name = "cpuidle-davinci", .owner = THIS_MODULE, @@ -72,6 +69,7 @@ static struct cpuidle_driver davinci_idle_driver = { static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device); static void __iomem *ddr2_reg_base; +static bool ddr2_pdown; static void davinci_save_ddr_power(int enter, bool pdown) { @@ -92,14 +90,14 @@ static void davinci_save_ddr_power(int enter, bool pdown) __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET); } -static void davinci_c2state_enter(u32 flags) +static void davinci_c2state_enter(void) { - davinci_save_ddr_power(1, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN)); + davinci_save_ddr_power(1, ddr2_pdown); } -static void davinci_c2state_exit(u32 flags) +static void davinci_c2state_exit(void) { - davinci_save_ddr_power(0, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN)); + davinci_save_ddr_power(0, ddr2_pdown); } static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = { @@ -124,8 +122,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev) ddr2_reg_base = pdata->ddr2_ctlr_base; - if (pdata->ddr2_pdown) - davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN; + ddr2_pdown = pdata->ddr2_pdown; cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]); device->state_count = DAVINCI_CPUIDLE_MAX_STATES;