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: 2091041 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork1.kernel.org (Postfix) with ESMTP id F0A113FD56 for ; Mon, 4 Feb 2013 12:06:18 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r14C25LY002684; Mon, 4 Feb 2013 06:02:05 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r14C25uE024784; Mon, 4 Feb 2013 06:02:05 -0600 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Mon, 4 Feb 2013 06:02:05 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r14C25SN026476; Mon, 4 Feb 2013 06:02:05 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 255AB8062A; Mon, 4 Feb 2013 06:02:05 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id DB6CA80628 for ; Mon, 4 Feb 2013 06:01:54 -0600 (CST) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id r14C1sTD003332 for ; Mon, 4 Feb 2013 06:01:54 -0600 (CST) Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id r14C1s5Q020166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Feb 2013 06:01:54 -0600 Received: from [216.82.250.51:7748] by server-14.bemta-12.messagelabs.com id E1/D6-02622-233AF015; Mon, 04 Feb 2013 12:01:54 +0000 X-Env-Sender: daniel.lezcano@linaro.org X-Msg-Ref: server-7.tower-108.messagelabs.com!1359979310!10604050!1 X-Originating-IP: [209.85.212.180] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.7; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30571 invoked from network); 4 Feb 2013 12:01:51 -0000 Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by server-7.tower-108.messagelabs.com with RC4-SHA encrypted SMTP; 4 Feb 2013 12:01:51 -0000 Received: by mail-wi0-f180.google.com with SMTP id hi8so2293574wib.13 for ; Mon, 04 Feb 2013 04:01:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=C/LzMO9s+IZ7Sbv0cWFX2ju56BJoPAj2iQcKAmpyPG0=; b=XtdTLBFQO9Zv8rdWPiuke4KSlaNOePgS+AfaKlZIvc4HcniKqbMKWUd1jkaSk7r4Dv 5RVIh3zEROC7oTMquOkTnsuVS1SYTFsk3vtKfiWJvsW+80O1CGK1j0f4vRFb88zhQr0k Ba81OupyQC5LB6JLljcueTajS1C/2Ar4oE3aS/uxcumDfdGF2TeeUbGPPqKoU1FCWK3w PTaGCH+vToIC77JYfOw7zoggS/nCDUmOeMmCvJHdDDmV7C8J/k6oprbyvzKjZvSaYXqA LskLIfU+7E4NSp8Ae8CdRl3P6bXKLob+P05qY5R8yDQzrAcne1ywJzcC+HM0eF6KiB7U 3b6w== 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: , 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: ALoCoQnkB4GgehHSrk1WY2zcs0EWD2cJeRZQ91M8AjUeApXy92KQ7C7EVUzlpFiINx7HsN5wHaa6 CC: , , , , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com 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;