Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1034220imm; Wed, 20 Jun 2018 10:26:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIeiVW3m/i2Oxf24J9Ax02qB7lSWGeukQhm845/HWMFYGFZtVtQTurAHAwV6tOu+VXD4X0N X-Received: by 2002:a65:4e86:: with SMTP id b6-v6mr19890439pgs.322.1529515613107; Wed, 20 Jun 2018 10:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529515613; cv=none; d=google.com; s=arc-20160816; b=jUOFeXrGyCHVxB71pY+yQy+Ee2jqoBdP1OqBwonRzkyIuriF++ECoBq6kn0LBG2vCC /1AX3E+SDiYIzlcCnXC1BLqShSpEEz1fRGAJua2KA6lVeogUGiLpud55eoQG6BPbiU5H N9izXdEEX1X/Sx7In2CK/VFC2cV0IaWXc90fuLcBG89Qr8zDCzEYjIzZPrvojbkpeBeC kZdTIJloacSHP963n4jGSus2l+l99ZRV5FKfiUX+YfT4bfW7p0iD/IN4PowkOoEpRAzI 9T82a4FO60oJ5DtlUSgY7rgJQTl/gTspxdcGDfQ9Q4LzK07x9cYWJOe03BJhcDq9MBLp hTnw== 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=3WUKn2dvevp+IRdH7T6aKSOygQUa+Gx75wLOTzgVKrQ=; b=GYfbSm63pZDjEqVWSrbRyiA34KNfhvj8HmdPffkEqY+MMv1WiNOA847M2z7hECAZsa LFixpuTtl9iLymARNhQpo3dJb+AvUS+PK/EYTY7ufaMVjk95LEUaxr654A03A5V5DWjV GpOyXnzq2ojtsrNf11GbFRn+IZzeHAqYZA/70zDUfH8Q7Q6juF2gwcuAHrFNjbsOAVc1 1vX1Sgnu+KCEnmxdmT84/5C8mY0pXKCd9/F2mDEKDa6xelQ6qBs+770IDlVbR0EzWAIB ZM0cXVYU0hM7qwJQn/ufXg2vGEdmMGMeshYq5End0j/DZ3TfAWXVQf6ktqe+Z0mWvdtD 6iTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ccLWxAWK; 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 a89-v6si2912395pla.177.2018.06.20.10.26.38; Wed, 20 Jun 2018 10:26:53 -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=ccLWxAWK; 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 S932634AbeFTRXK (ORCPT + 99 others); Wed, 20 Jun 2018 13:23:10 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:44038 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754573AbeFTRXG (ORCPT ); Wed, 20 Jun 2018 13:23:06 -0400 Received: by mail-lf0-f66.google.com with SMTP id p23-v6so445729lfh.11 for ; Wed, 20 Jun 2018 10:23:05 -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=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=KauugXIzuOq24ucYuG6Tasz5BohoG9uNBQ/9xHDhhbCkBSmDqBwQjUhuvJ2E3BDOkj zBYRWurSknreBONiM6KjgicQHHLY1F+B/b16AUfML7VKesjuQRJjxwzPOldiY+WwnnWI P637PFtH2+U/ulCa6KJrEVHJiE0MmxYKaRSycw6EXw1dL8KY3IxWE92HBLIjYtb9WcPP UP26yxJsY6jj0/nTJ7aTzMKedyOdhUqEzor+LolGzV7ds4sD18+a8W10hP8j/isszaFb FA0vKMTFqhC5/iqNpXzt2LT426SRjy9ICslE83089ua90acEDpxsKMByIxbP7dbIWZx2 3rcw== X-Gm-Message-State: APt69E19Fq9t7QbM/vD3mqfH4as+LRWFccOqab0ql5hRnYHcFJlJjlp9 a+mJg7Qoke7VYXP5XTw/8Pj7Lg== X-Received: by 2002:a2e:2bcb:: with SMTP id r72-v6mr15489218ljr.133.1529515384517; Wed, 20 Jun 2018 10:23:04 -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.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> 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 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); -- 2.17.1