From patchwork Fri Apr 17 23:49:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 6235991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5F805BF4A6 for ; Fri, 17 Apr 2015 23:52:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8340620397 for ; Fri, 17 Apr 2015 23:52:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A920A20394 for ; Fri, 17 Apr 2015 23:52:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YjG1E-00062f-LX; Fri, 17 Apr 2015 23:49:56 +0000 Received: from mail-pd0-f178.google.com ([209.85.192.178]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YjG10-0005xj-H1 for linux-arm-kernel@lists.infradead.org; Fri, 17 Apr 2015 23:49:43 +0000 Received: by pdea3 with SMTP id a3so142836173pde.3 for ; Fri, 17 Apr 2015 16:49:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FcQoHYqogZEWAFUOArZw0PzN6BDs/hSuMFaPsOY0KUw=; b=OildoQY/6LFAZ20sw5CZfVMxa5eGFa1CBIttUZnE8kQuz/zrtiAonmW6uIlEMxCY8g Clzc11QjHfwlIMLrHcciFTJHC8/M3O63y2ymGScty2qBrIGihfzrlkCMmRfjPQObZkoJ sDSYXC4y62UAxnNYfLc3olMk8xAJqH1TV7cCAhQdQPVuApLidfBJJTAXoPGOa3y4RwIR D0njQ6agdremaXss0LhXUI3IyEQ5CI3rx6COwRbq+9SV/ey/KKiqTcPBW2FgumJUNnK8 V+QGftRQKFuNsRM8RQ4a66luyJOHe/CDM1ncuaH2BjaDB0NtGYDcOfi7s+4gn8cl0hyR V3/Q== X-Gm-Message-State: ALoCoQksnuimTC8uJkFsIBMjNscny6dMx2sPLKAv3qzmmhKu8ql87eJs7kRW814bwn5iAkrKw7Mu X-Received: by 10.70.136.106 with SMTP id pz10mr9468446pdb.105.1429314561636; Fri, 17 Apr 2015 16:49:21 -0700 (PDT) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by mx.google.com with ESMTPSA id hv7sm11157144pdb.86.2015.04.17.16.49.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 16:49:20 -0700 (PDT) From: Lina Iyer To: arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, Will.Deacon@arm.com, lorenzo.pieralisi@arm.com Subject: [PATCH RFC 1/7] arm: Modify cpuidle_ops structures to match ARM64 Date: Fri, 17 Apr 2015 17:49:03 -0600 Message-Id: <1429314549-6730-2-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429314549-6730-1-git-send-email-lina.iyer@linaro.org> References: <1429314549-6730-1-git-send-email-lina.iyer@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150417_164942_585218_74AF7223 X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -0.7 (/) Cc: khilman@linaro.org, mlocke@codeaurora.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, daniel.lezcano@linaro.org, sboyd@codeaurora.org, msivasub@codeaurora.org, bryanh@codeaurora.org, Lina Iyer , galak@codeaurora.org, linux-arm-kernel@lists.infradead.org, agross@codeaurora.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP SoC's tend to reuse the same hardware block for both ARM and ARM64 based cpus. As such the idle setup and enter functions are generally common. Using the same arguments as cpu_operations for cpuidle callbacks, allow reuse of the same driver for many SoCs. Signed-off-by: Lina Iyer --- arch/arm/include/asm/cpuidle.h | 4 ++-- arch/arm/kernel/cpuidle.c | 2 +- drivers/soc/qcom/spm.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h index 0f84249..08768da 100644 --- a/arch/arm/include/asm/cpuidle.h +++ b/arch/arm/include/asm/cpuidle.h @@ -30,8 +30,8 @@ static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev, struct device_node; struct cpuidle_ops { - int (*suspend)(int cpu, unsigned long arg); - int (*init)(struct device_node *, int cpu); + int (*suspend)(unsigned long arg); + int (*init)(struct device_node *, unsigned int cpu); }; struct of_cpuidle_method { diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c index 318da33..703926e 100644 --- a/arch/arm/kernel/cpuidle.c +++ b/arch/arm/kernel/cpuidle.c @@ -56,7 +56,7 @@ int arm_cpuidle_suspend(int index) int cpu = smp_processor_id(); if (cpuidle_ops[cpu].suspend) - ret = cpuidle_ops[cpu].suspend(cpu, index); + ret = cpuidle_ops[cpu].suspend(index); return ret; } diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c index b562af8..5d0dd8c 100644 --- a/drivers/soc/qcom/spm.c +++ b/drivers/soc/qcom/spm.c @@ -197,8 +197,9 @@ static int qcom_cpu_spc(int cpu) return ret; } -static int qcom_idle_enter(int cpu, unsigned long index) +static int qcom_idle_enter(unsigned long index) { + int cpu = smp_processor_id(); return per_cpu(qcom_idle_ops, cpu)[index](cpu); } @@ -207,7 +208,7 @@ static const struct of_device_id qcom_idle_state_match[] __initconst = { { }, }; -static int __init qcom_cpuidle_init(struct device_node *cpu_node, int cpu) +static int __init qcom_cpuidle_init(struct device_node *cpu_node, u32 cpu) { const struct of_device_id *match_id; struct device_node *state_node;