From patchwork Wed Oct 3 14:38:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 148065 Delivered-To: patches@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp6557756lji; Wed, 3 Oct 2018 07:38:56 -0700 (PDT) X-Received: by 2002:a2e:1b9c:: with SMTP id c28-v6mr1345243ljf.73.1538577536855; Wed, 03 Oct 2018 07:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538577536; cv=none; d=google.com; s=arc-20160816; b=Ni1mUTPH9Zse78uCG2IZlhOcGdOl6hZr5AWrD47W/IHpLNU9ximMy+zZiC4yfh7XLK SOOBkB1BsPR77tu72p+84pADn7sNIo/DvA+iW7JAHfkK0clU4t7VaT3Nu7Y2uUoB5okg 7NIuodU+pVk9lQbTXw4835MOa2K4jN25lcnxlRvukLAl+nxjj92PzGLtjBuMP9jQnY/d 4oz5oe8k4MkjTyQcFobm/BVFQ5FHg/UeRmPDtFb1RvJCONAqn60NHgMwmNqwwyPKpmW5 2MklhyZkphFKLsTSn3XTEn4K8pSl6WMzcWSRH/XP7jq2g82D5jYLas5EZfK10njDusdV Ym8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3WUKn2dvevp+IRdH7T6aKSOygQUa+Gx75wLOTzgVKrQ=; b=ZF6idFiQgD1UoC4hto2lYf+SonMnmYG/vG1gAvYJk5ieeenZljBu9GKNJ/GjFuejTn z8VBSEJ4JX2p+Y2DlGa6djth32hn4BwYUyg/YbSJB0ztheVnuCz1F+nbb/PiV9T9oj5y ppfSnOwsZ0vGKTyJn19FFYqMgcKJAXQJ8sY4WyTrvqkKrdo12/Ect+Y9xh+/DX+7LdOj IljZG6yIfkrAQY+FrqSz56G19FviLb5wERLvjhTUQqjR8TiMqxC7ZMssKANJr2MW9Rm5 ZueV7ub8tgJQVyMgIag0dVvI+J7b+6m4OzcXKNZNUb/DiUzF5B6lFLShmYGM4cmhyIl1 PJPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HckMrUez; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 10-v6sor978646ljv.30.2018.10.03.07.38.56 for (Google Transport Security); Wed, 03 Oct 2018 07:38:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HckMrUez; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=3WUKn2dvevp+IRdH7T6aKSOygQUa+Gx75wLOTzgVKrQ=; b=HckMrUezE7fEmusY25qeIMXC09B5MKn2lggvEGrfhbXvyprgkkZsbk7mSbfl9OS+39 PyEOZG79GlLGsAnHWfz2AlLsFCJdLxauI2i2sQj9/26x5rW7kQtlBpWOut+Ow7BI/pST hDY8lQaAmmvARDGOc0V/ih3wyyznRhC1IGRM4= 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=3WUKn2dvevp+IRdH7T6aKSOygQUa+Gx75wLOTzgVKrQ=; b=Jm7IMFMrG5PxB8zsJTUwH2VxJdaZuiI+p3D0v+vqACelfs5w1h546L68Hrrz7CVtaU ouBaKSe/jlnj2P3dNhjIj4N31FZNbrcUAcfykjEToRTFlSjteTcfEr7ZqU3xMxLsQ/0M vSy+fKRGo+UEeFaFSg7j0V+SW4zuMkCtZN5S8ZpCeh9nv8Bg0HwNL6/RQZVYx8nQlbJi U7/uYN4GXG181Rmaa83Hsd97TR/mI4tIDrmnnGAk10cIig02LiSRPENLywDQBVMavorY LCQRyTnoX7Q2/kSiy9FKFD/weuz1cYFVMXJgb8CNVcUDe0wB4EqZrIPf1/72zKPhD42I y1vw== X-Gm-Message-State: ABuFfojSFbAIsTCIEMjJEJQYG7r5NMWXWBLpUvNtBVzNyFr5W9QaVFWR 2O0KtnCkeyitfgEuHGr9pOvcZfOz X-Google-Smtp-Source: ACcGV62S/kE0nzS+/14hY0+pwMhcgKntySwtELjwoN11ELXKVw3eYUQRrI9eg/ZW2gbrfOGyyqP2qw== X-Received: by 2002:a2e:86ca:: with SMTP id n10-v6mr1531860ljj.90.1538577536631; Wed, 03 Oct 2018 07:38:56 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id 18-v6sm380867ljo.74.2018.10.03.07.38.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 07:38:56 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Tony Lindgren , Kevin Hilman , Lina Iyer , Ulf Hansson , Rob Herring , Viresh Kumar , Vincent Guittot , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Lina Iyer Subject: [PATCH v9 10/11] drivers: firmware: psci: Support hierarchical CPU idle states Date: Wed, 3 Oct 2018 16:38:23 +0200 Message-Id: <20181003143824.13059-11-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181003143824.13059-1-ulf.hansson@linaro.org> References: <20181003143824.13059-1-ulf.hansson@linaro.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(-) -- 2.17.1 diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 9788bfc1cf8b..256b4edbb20a 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);