From patchwork Fri Feb 1 13:48:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 14400 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 9A86C23E39 for ; Fri, 1 Feb 2013 13:48:26 +0000 (UTC) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by fiordland.canonical.com (Postfix) with ESMTP id 388E3A1979B for ; Fri, 1 Feb 2013 13:48:26 +0000 (UTC) Received: by mail-vc0-f181.google.com with SMTP id d16so2477555vcd.12 for ; Fri, 01 Feb 2013 05:48:25 -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=qh8aw++ccjsAogN4xeY3Z3OVd4y3x03JgePxJM3zOMc=; b=dmZt8LYPcdnUjvp6q1W5Xb1VmK4CBsQnhL57kBjC9Sitk1XGqcWtmxdF270xCFT4Gd AkLvwe6fKNwohELGCESNX7Nz7dSSGDvRyDol/iehL5zp7lfe8bB4BqQqd4pvU7GjwQRw TnvLecaROPb+b9wExESZzVzha0bVS2bgO4H2y0ypEgtPo5Oz2oF1/hhKZ3J49/VoKso1 DyhqjCN/BRp1EK0owFr+C7ct0c+wh/LLHX0x+JNP/in4aDPh6DV8HUr1X0QT6ooDi1ve tjhrh1i0gdVMODAB+ui4QeHqQ9elINl7mSKGfk+s8kKTaTVbhM3zfoy9Khyg5AHdg8jw 92/Q== X-Received: by 10.52.27.50 with SMTP id q18mr10055206vdg.20.1359726505686; Fri, 01 Feb 2013 05:48:25 -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 zo8csp117356vec; Fri, 1 Feb 2013 05:48:19 -0800 (PST) X-Received: by 10.180.8.130 with SMTP id r2mr3033863wia.28.1359726498828; Fri, 01 Feb 2013 05:48:18 -0800 (PST) Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by mx.google.com with ESMTPS id em9si681754wid.32.2013.02.01.05.48.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 05:48:18 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.54 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.54 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-wg0-f54.google.com with SMTP id fm10so2831409wgb.21 for ; Fri, 01 Feb 2013 05:48:18 -0800 (PST) X-Received: by 10.194.108.229 with SMTP id hn5mr22083164wjb.8.1359726498232; Fri, 01 Feb 2013 05:48:18 -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 bd7sm3692703wib.8.2013.02.01.05.48.15 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 05:48:17 -0800 (PST) From: Daniel Lezcano To: nsekhar@ti.com, khilman@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] davinci: cpuidle - use global variable for ddr2 flag Date: Fri, 1 Feb 2013 14:48:12 +0100 Message-Id: <1359726495-8024-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359726495-8024-1-git-send-email-daniel.lezcano@linaro.org> References: <1359726495-8024-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQnTp3/fP3bUhST6FoBTILR5kv4skFn34fWLxh4xK+kR04o5xBCe9W1BPOrDlp5puBSysBCF 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 anymore. 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..ebb8808 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 = false; 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;