Received: by 10.192.165.156 with SMTP id m28csp1830583imm; Thu, 12 Apr 2018 04:22:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx49azk/y9OZ3b5dNKqZKxkkE7XbM7yjmhnV732n9RhNb33l6Va5Sxi0HMxYWn6NrjndMbN2L X-Received: by 10.98.14.7 with SMTP id w7mr7345936pfi.50.1523532175786; Thu, 12 Apr 2018 04:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523532175; cv=none; d=google.com; s=arc-20160816; b=AYzJUEd21scIJ9MAQ2Vjn6D2mJmH0OLMWLnCvJjF4nz8qLZbD9V9Hlllim2h21LNhT UtjoPSCRWnmdmuZ0Id160SRbPgBQ25/Z1IHs99Gd9s1aoaRok6nGsrduyZc6O3jLfewo BStokqtVfXhQ6AY4+XCNqZutqStXkkAWt+YcJhTshngi2ury7i+2S12Nb6XwOEHD66Tb Cn/8ZLeJzm96LJYerfj9/0KTB9pdpttrILBDDg1L9NObf0v0EtyktEETuQ9e8NLDgQo9 RwXVHx5S0MR5o7c6w4WpsYVuuDwxZEtZN4cELkZJy0ux/ieusjxLQjSDUeT+kFapndLk fpbg== 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=2LpY14KKtV2T2Pymd99d2r4VUa+0CGWSlM2NsNRxYZk=; b=LIMO3CZgl/B7nx0KjQsrw6fyV18CvNvu9G1BGgMTq/SpxYTEemHPk0i94pwc6T2tUM 1kxQrqlyoKfWLCmdflqg9+ESZI3IUSvz+DVO26QlF2SOj1w7djmYHaj5CiinW8Zn6OVA 8MjhmbylYxfE736GEQgT+xrmQCtbrt4aWzZnpM/ig/zlgUXFxhOObIDnLzkFMoHwyuWH zzgnga2+1XqIrq/Gn4yI+c6szArSdFGEyf81m/ceHSK7Clz6C2GNmk7TwmJ8g0UC9rbV iA7UKwRIQzPD9K7nvOJAfLR6nQbnxpayFaZYlJtrHo7ARgBHRPFhuWtTTgnL3RYWZdZM zN8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F+PrMGzP; 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 x24si2484517pfa.98.2018.04.12.04.22.18; Thu, 12 Apr 2018 04:22:55 -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=F+PrMGzP; 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 S1753189AbeDLLR6 (ORCPT + 99 others); Thu, 12 Apr 2018 07:17:58 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:44292 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753148AbeDLLPI (ORCPT ); Thu, 12 Apr 2018 07:15:08 -0400 Received: by mail-lf0-f68.google.com with SMTP id g203-v6so7096997lfg.11 for ; Thu, 12 Apr 2018 04:15:07 -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=2LpY14KKtV2T2Pymd99d2r4VUa+0CGWSlM2NsNRxYZk=; b=F+PrMGzPM0c59NpwIkVVRgJZsDbtLvyWLGfI1iQFyctYpNN7zLpP7DueH3aPDpbYhv 6NBcl06puVrFm63vo47Cx2nuCiVojwRFwhDUnLIML+I/SsPtk4PQf23NOJMTEcChm3jt IT+Fk3nodp91ZSrKmmmS+Yoj9dI4eoAMD5ZtA= 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=2LpY14KKtV2T2Pymd99d2r4VUa+0CGWSlM2NsNRxYZk=; b=F3hQ7yZkccNG0snoE8yNOJ3odqoCS4KFAIpM5tD/mAI02Ztdw3dHiGIeIedaMTNrRs 81SNIC8cK8Nee8S96CNT6AMD3B6iiJxx+jyhb+49ESi9j+sozBMlDTTc7uRiHhKnmSmr p7tz/z/yL1/H0Y1x7by9GIDXtddbZdbjOxmjKWecHLZ3z7P7R4MBYe/oVqUGIdSDjmUo F5pyW7KTFt3dA+JqmNU2CJYhyd3+T6F1f+XpHcrbGPCqbb9RZF77IccmPSy1KRVEDDvU N5yirsi9jNtX6y2B24s0ojfGQhvQDCf6Iii68v9zPwdVT87dzHACr+EVK2I7QSemnT3D veDA== X-Gm-Message-State: ALQs6tAX51QVt0h8iHQnHSbacsK9KXzrJhsphEU8FiMvh1nNU9cYSS4L oebgvI/bG2tG9xSL7qZLwLjCdw== X-Received: by 10.46.65.73 with SMTP id o70mr403882lja.140.1523531706720; Thu, 12 Apr 2018 04:15:06 -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 r29sm543187lje.72.2018.04.12.04.15.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Apr 2018 04:15:06 -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 v7 16/26] drivers: firmware: psci: Support hierarchical CPU idle states Date: Thu, 12 Apr 2018 13:14:21 +0200 Message-Id: <1523531671-27491-17-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523531671-27491-1-git-send-email-ulf.hansson@linaro.org> References: <1523531671-27491-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lina Iyer Currently CPU's idle states are represented in a flattened model, via the "cpu-idle-states" binding from within the CPU's device nodes. Support the hierarchical layout, simply by converting to calling the new OF helper, of_get_cpu_state_node(). Cc: Lina Iyer Suggested-by: Sudeep Holla Signed-off-by: Lina Iyer Co-developed-by: Ulf Hansson Signed-off-by: Ulf Hansson --- drivers/firmware/psci/psci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 9788bfc..256b4ed 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -294,8 +294,7 @@ static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu) struct device_node *state_node; /* Count idle states */ - while ((state_node = of_parse_phandle(cpu_node, "cpu-idle-states", - count))) { + while ((state_node = of_get_cpu_state_node(cpu_node, count))) { count++; of_node_put(state_node); } @@ -308,7 +307,7 @@ static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu) return -ENOMEM; for (i = 0; i < count; i++) { - state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i); + state_node = of_get_cpu_state_node(cpu_node, i); ret = psci_dt_parse_state_node(state_node, &psci_states[i]); of_node_put(state_node); -- 2.7.4