From patchwork Wed Jun 20 17:22:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 139384 Delivered-To: patches@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1050833lji; Wed, 20 Jun 2018 10:23:04 -0700 (PDT) X-Received: by 2002:a2e:5111:: with SMTP id f17-v6mr12877022ljb.16.1529515384714; Wed, 20 Jun 2018 10:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529515384; cv=none; d=google.com; s=arc-20160816; b=k+G2rW45ix8xo7Vgohdod9zz/Z7cs8XCGgIxsZIFEax2JmqQQIWbD8v8Et2wXPzkDz c9pBFeGdoJZJJE2IvRuC2CBnXl85QxcO4jdY2Rrqcj3bwGmtfriHWOXA1oMwnhKRss8h i5z7Es9g0jIa51qzUJqml9KsYRAzi+lau09kSS5D+GF27VSJmDuVPNeGvFmIpfus3F6E CSHq8eRx0pjUS1D8UrrhqM+vZ4Y14wGS8QrkVh8vQrEAxgl5tNJ9akR/yOyn3TFA0lf/ 0FMTyqnKh1e+9E4KNE5xzsOEFAkMfOvGt/HqjxT3zWSUJ4oeqFJHZ+efwNTYBVZ1Puh7 oQIw== 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:arc-authentication-results; bh=3WUKn2dvevp+IRdH7T6aKSOygQUa+Gx75wLOTzgVKrQ=; b=EFgORTYrQpRMFValNIlGbK88T6zpqfmeOLNC5cZWXTfuB4axH89G6qPkfCJecXUOVo 8fR3Rr0PmCluosFGzXJyI7TtE/b8HO+Q/FAu/O0Ul4TKt/3f1qfh18qq6BzMkj/l6pfZ 0j0pOyAnf7E4t4XCnCVm/sT/kLyrEZaMa1mrIrnROZKvBoCM4EqzU/uI3rF3VzUWRZI8 bfxCe6pzUwQRopWGMwuPuC3kQ5PZT1sHj3KuXCfBIYv8IWKc7XaXYBTM3fIwrd6AENfp K02fPPBwxb++s4dXacbkZxSSJoX1WGWD+zv+mrv/iLNDhJHpKrcTSaVQGyIkFA1RGsHe +ssQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ccLWxAWK; 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 f68-v6sor730575lje.65.2018.06.20.10.23.04 for (Google Transport Security); Wed, 20 Jun 2018 10:23:04 -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=ccLWxAWK; 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=ccLWxAWKyM1XsPYFwBoyd1FnFJHtFSEKE0BrB3Mz5q7D5iS6hvFeiT/fgp33GKSrIz Gxj57mbMomjqk9vP9cNzlryga3fRrwsq5ynCb8/ACNT1wds3dTiZq6fS5nI0FwmGJaNN Dhc9dmqJto0CMZfqD2+biLfLs6O3t7oDPBPn8= 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=UrhIXKoPAlZp53MDckGn2+H4xZYYeMc33tzXIR7SEo25p4tjfy6iscL4wD2eOflqgA 5xEeY6bIArpBKs4b9FIcLch797DNqYh6ApCpLD4Mtv8GkATXM6MfBfLUL0ln2Bs2vsE/ CKtMBgdQksC3ml7FP4soW2diyUmDFjjcOBVjqo8Oi8HqbZjJm6uK0Sl9udn2AxdijcUj YJARFos1dbFfSP6gq4ICA66VZVzX/IBb+zGDV2xmfKGHzTIFZ+jOzhNHSY1RZcxNdq9v gWuFpBHNSQYMUF4+WV8UU3qifGhrWCw+qYUeEFJ14WQ2jsc+7D65O0cAfsFgyh2e0m0h /+1w== X-Gm-Message-State: APt69E31FfG6hpavPtLL9ZKHwO3xFts1FF6YvNmeCxEwTdf8gIFV/DqH JJnXh8HCk6mM2KY6rjxvTDcI1y0A X-Google-Smtp-Source: ADUXVKKz2Nd7fbMf9oDBOr3m4O64LNkWcMuCIRlWwRXw9QVs6dydR1O2ZmpjNZUXKxJwzp8CW+wBLw== X-Received: by 2002:a2e:2bcb:: with SMTP id r72-v6mr15489218ljr.133.1529515384517; Wed, 20 Jun 2018 10:23:04 -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 b2-v6sm514441lji.85.2018.06.20.10.23.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 10:23:03 -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 16/26] drivers: firmware: psci: Support hierarchical CPU idle states Date: Wed, 20 Jun 2018 19:22:16 +0200 Message-Id: <20180620172226.15012-17-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> 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);