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: 10624921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E37C16B1 for ; Wed, 3 Oct 2018 14:39:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B22228AF5 for ; Wed, 3 Oct 2018 14:39:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F84C28B0D; Wed, 3 Oct 2018 14:39:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A946328AF7 for ; Wed, 3 Oct 2018 14:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727420AbeJCV1k (ORCPT ); Wed, 3 Oct 2018 17:27:40 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46870 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727486AbeJCV1j (ORCPT ); Wed, 3 Oct 2018 17:27:39 -0400 Received: by mail-lj1-f193.google.com with SMTP id 203-v6so5314355ljj.13 for ; Wed, 03 Oct 2018 07:38:57 -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=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=jab8rIkfxbvFvmgafc6ri3EGz+1KQiS14nHFU9LhzxRPypxYPUj5eGGOngraeoJaOP M0ruEdXkDy1gpy4+tKEJjb6woRdgnjCx9XHXw2PSp+ucg7SHkUEnIRqg7oPKUjeOZxJ2 v2J3Sj1FslM1R+nsv60u+r1RFvCf1WPVuMwXM6vs3VtGvweKt6QbHUpf/q1dmuz96zur hL0u0wroyHJoN2YhxW3F5wKZzoAp2thfqitBCc+qrLniqx6hi9jK5KoRlnQXyFlEZTJX anJ4awaRO7Aj+vZnllbmachyd12yYMq2Fnhtob2TTay2HBLYtBXkW97c3lE2szN88pjJ zYmA== X-Gm-Message-State: ABuFfojwRaJLxFe5rrBYoBgnyhAZNZNveiFH5e62J3QHR+K9e5ZcfCiQ poTUqQxi/RezE+GxPru/+e/lOw== 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) 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> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);