Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1033290imm; Wed, 20 Jun 2018 10:25:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK2QnH/MjgP0gS3FFU7H2/fB8Z7DfwdfVkeQinjEGjMC8NEVlOTzGSOzC42dyPLJLreA1jF X-Received: by 2002:a62:9c9c:: with SMTP id u28-v6mr24010176pfk.90.1529515557961; Wed, 20 Jun 2018 10:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529515557; cv=none; d=google.com; s=arc-20160816; b=dC7X76k5onJ5psC7Hh6Wg24dgy2JYV7bE3hdDoyi0LN78G/xybWdK9vcxfq/sWLxxy iSw7ryYBJi3Qji9eJ5jTMXkZb1Xg2q4yCo9EDNFKE7nqVXaygBoqRTqDX2umEYUIzI2V fCc8G5DxwMhD8I14wySZ0QVYyCgI6eLsxZfR4KXy7q9yjdgas3Vtlfdddl/uxa7K53Nf FL/EtKYwq5TkJ0TxSlkhzQlU6Z8DrQADpEKTsqrd32JscONALp3GPEo69XfR7SdGN0vg 4dDXKuSat/TVBC6PIso1KkNWg2Qwp0CGETP2dmyK7uk0gMnOPX6d6Jsy8nu+gvvNKgJN 24+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=cV7qOWslovasm3reIVu1jS3ltOLzaMhL00jKgYh6Nhw=; b=HemAbIeQUpDWznLOk69RN4rQGJoLJTDkZxwUyMxn6iPVglmfL+YCorv8P0cvPhh1WF JiGBFLSLpf/7LhsJrrmAf+GmFdWBAfogTqvRpoIEn7fi0vMgC85Gg+TfUNB8o0o8u5vE C3rOSgaV0LelAAeAznuS6aVOHXmKPw/iG3d7eJRXlLzbVVIIJwuYfsOTpQvx0RGjIqGN joKRmE9aiPA2bPzzPkiiOSiLSPe/NyOgiR0OR/lLlPgA7/YaJgGPH9McD/CIEWYUvoqR arMM3gBwxFvz78520mh3hQajcDzywT4CNGCePsLt8J+no6yJTO7VQYJj3ixP1Dmv91WC FI2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U8pYcg45; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27-v6si2760423pfa.181.2018.06.20.10.25.43; Wed, 20 Jun 2018 10:25:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U8pYcg45; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932805AbeFTRXR (ORCPT + 99 others); Wed, 20 Jun 2018 13:23:17 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:46819 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932691AbeFTRXN (ORCPT ); Wed, 20 Jun 2018 13:23:13 -0400 Received: by mail-lf0-f65.google.com with SMTP id u5-v6so438743lff.13 for ; Wed, 20 Jun 2018 10:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cV7qOWslovasm3reIVu1jS3ltOLzaMhL00jKgYh6Nhw=; b=U8pYcg45t8FOmO1McVT3H9JZ/G4uT7s9zkL4ps+KG/97JI/6Ql0hgjW9pAV01OKjUi lyeaNcYRIuTt8+8veRE0Bzw6OJ9lpOrym7fbVoRr6D+0rpM6K+6snow/l8smcLBEdb5h uXLrPEAmJMZ8jeGhQipkGtVEEJwGc4BPpQO+I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cV7qOWslovasm3reIVu1jS3ltOLzaMhL00jKgYh6Nhw=; b=rIHALvBY0XYzm94zl8uEgLXMssse/m+EiMvse6k2OgX2FP564Oy7zOzyDgLKTLF61D wFX3KXcfxjpWptOCn/vFDQ40hbSIDOFhk2B+/bSKlgCjxJOqf5HCRC+o/u5QNPFZ5Wsm Oma4rNhFLKchGcqBPugASCBJ4bdRm/1r6PuVH0ec/zVxIpAVjMbXQGrntgUeRjRaGHln UaQmhuy+XOCzy8TEYlcYdPeByj3rmKbg3zztRZLpatiXpcUVAuBWT3wAhKK70DcDw/ik /STNkMWrRQTi+iIFo+giniLknZhCs9VNAL1YkNy2dXWNy5QTQyHp3uW0o4bgGl0oTyTI dfTg== X-Gm-Message-State: APt69E1GRj27a61QQzFpkFbopQsEP+Xkfa98eycvUogDP+nuaEHDt4zr ysllds2XYkRhn33FDp0edqbU9QqgR/I= X-Received: by 2002:a2e:5d5d:: with SMTP id r90-v6mr14518777ljb.125.1529515391711; Wed, 20 Jun 2018 10:23:11 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id b2-v6sm514441lji.85.2018.06.20.10.23.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 10:23:11 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , linux-pm@vger.kernel.org Cc: Kevin Hilman , Lina Iyer , Lina Iyer , Ulf Hansson , Rob Herring , Daniel Lezcano , Thomas Gleixner , Vincent Guittot , Stephen Boyd , Juri Lelli , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 20/26] drivers: firmware: psci: Share a few internal PSCI functions Date: Wed, 20 Jun 2018 19:22:20 +0200 Message-Id: <20180620172226.15012-21-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620172226.15012-1-ulf.hansson@linaro.org> References: <20180620172226.15012-1-ulf.hansson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following changes needs to be able to call psci_get|set_domain_state() and psci_dt_parse_state_node(), but from a separate file. Let's make that possible by sharing them via a new internal PSCI header file. Cc: Lina Iyer Signed-off-by: Ulf Hansson --- drivers/firmware/psci/psci.c | 14 ++++++++------ drivers/firmware/psci/psci.h | 13 +++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 drivers/firmware/psci/psci.h diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 40b2b8945018..463f78cda3be 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -34,6 +34,8 @@ #include #include +#include "psci.h" + /* * While a 64-bit OS can make calls with SMC32 calling conventions, for some * calls it is necessary to use SMC64 to pass or return 64-bit values. @@ -90,12 +92,12 @@ static u32 psci_function_id[PSCI_FN_MAX]; static DEFINE_PER_CPU(u32, domain_state); static u32 psci_cpu_suspend_feature; -static inline u32 psci_get_domain_state(void) +u32 psci_get_domain_state(void) { return this_cpu_read(domain_state); } -static inline void psci_set_domain_state(u32 state) +void psci_set_domain_state(u32 state) { this_cpu_write(domain_state, state); } @@ -285,10 +287,7 @@ static int __init psci_features(u32 psci_func_id) psci_func_id, 0, 0); } -#ifdef CONFIG_CPU_IDLE -static DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state); - -static int psci_dt_parse_state_node(struct device_node *np, u32 *state) +int psci_dt_parse_state_node(struct device_node *np, u32 *state) { int err = of_property_read_u32(np, "arm,psci-suspend-param", state); @@ -305,6 +304,9 @@ static int psci_dt_parse_state_node(struct device_node *np, u32 *state) return 0; } +#ifdef CONFIG_CPU_IDLE +static DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state); + static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu) { int i, ret = 0, count = 0; diff --git a/drivers/firmware/psci/psci.h b/drivers/firmware/psci/psci.h new file mode 100644 index 000000000000..dc7b596daa2b --- /dev/null +++ b/drivers/firmware/psci/psci.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __PSCI_H +#define __PSCI_H + +struct device_node; + +u32 psci_get_domain_state(void); +void psci_set_domain_state(u32 state); + +int psci_dt_parse_state_node(struct device_node *np, u32 *state); + +#endif /* __PSCI_H */ -- 2.17.1