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: 6235861 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5DD2D9F399 for ; Fri, 17 Apr 2015 23:49:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85C862038D for ; Fri, 17 Apr 2015 23:49:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96435203A1 for ; Fri, 17 Apr 2015 23:49:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753517AbbDQXtX (ORCPT ); Fri, 17 Apr 2015 19:49:23 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:36043 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753251AbbDQXtW (ORCPT ); Fri, 17 Apr 2015 19:49:22 -0400 Received: by pdea3 with SMTP id a3so142836176pde.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=kjQDw4IATqUWGbVk9mn+KGWt5vY7TgHb/2NAnv7xXo5nCFeM/BnhRNFrpSpIOAQM+v DfbYrSL9beb3xx/tItwoAxOqQyD1RFrfQA5y6f951x70Glkuitgh8iPP7nvEz0rXBLNr tzH604ke80OCal0VKCkf551aBcvgD68+IAxPojVVeQG8AsUu8MHYCnUBMSTezIxDPHXU EOjnmOPEDVsu/HSBRA2leH2/gLbsRdOQ0v9UqZ4nZyCux+4sHuBcByxEttrEoNtaqJTp 3eCtrDQpAsyRGMlpmGxZGS4NfRxBe1pMbH17QIwntVMc29xE7FwINq9hd0WRnqZXwUJk OFCw== X-Gm-Message-State: ALoCoQlEd/iH6clingxHtF0eZ2qpuLnEgWIbIKt6b7BpWfT3ZGc/gbiqimGhMe0vtXsZV2CslIlo 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 Cc: daniel.lezcano@linaro.org, khilman@linaro.org, sboyd@codeaurora.org, galak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, msivasub@codeaurora.org, agross@codeaurora.org, mlocke@codeaurora.org, bryanh@codeaurora.org, Lina Iyer 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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;