From patchwork Wed Mar 14 16:58:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 131683 Delivered-To: patches@linaro.org Received: by 10.80.210.197 with SMTP id q5csp410600edg; Wed, 14 Mar 2018 09:59:28 -0700 (PDT) X-Received: by 2002:a19:cc58:: with SMTP id c85-v6mr3784445lfg.53.1521046768267; Wed, 14 Mar 2018 09:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521046768; cv=none; d=google.com; s=arc-20160816; b=oePAO5m5AWWEb+f/Nc12uyQEJjwrgXgj2P0LsL5uqdN3ZkMXDMrsITHyf5Q/1koQvM c9SpMAvwYrd17f1LcCKIv5dkLCp4TkmwdARRTb1Ex5DhH3LMQRpFVHM2xQBopnduAhr2 OnC+IVR1TamxxeEgIHufJk+V0u3LmR6zLeXQpS+pyBt/7qu9dOuKAnOaOO7Gdy4/7EtZ VLU2XcUuOXl7GwRQVNLQYu+ZbCLor89/kEvOkY9Nw4Qzp+7+6roWeotXjP7X+BlRo9GJ jHqljAu5dj4EE56IXOkjD3w8OoHdkGPpBDUvKoaJFooNSu5SvIP8ydf8JH13cYb2pRmR m6jg== 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=noP03dTVE/dG12N4mOws/4QMhMXSC6OgsTnjw22R1Bg=; b=N69WyYchhlctg7nFJXJz11uOpe4En41dG3kFdCqQRZ6J72v941h7UBwakkES8v49xK QyPTE024usH7RFOgzlz4jHVbA6mO5b4OZL8b9hFIFu9doTBYY0LqSIK9O7fo5/It9tby b5BFrb2ea03IsjLmbMpiIBht7q6uClcxT9cQ6in9RrB3hh270Ep9fAjQrC5J9ZzgF++U mgyfj4dim5FJgX9evDWhFRkGSUnrn+ymoQU6ySsBmybILozU0kvit3vC5BXrQ0ougPkX QRlCuXEHb00xnQoTa8EEcpYscIAEOBPn2m0audXY1c1tF4kT+++VBPNS17mh89mZiG7v Fsbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EmxaaiMm; 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 m9-v6sor874751lfj.8.2018.03.14.09.59.28 for (Google Transport Security); Wed, 14 Mar 2018 09:59:28 -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=EmxaaiMm; 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=noP03dTVE/dG12N4mOws/4QMhMXSC6OgsTnjw22R1Bg=; b=EmxaaiMmxZdK7+FI2z2ZfZXXL4BzvOW4ZkDEdDJq5pTUP53KXWFRYCFJJgi/ipweWu wdhtR4rcTm4oEho+QpemCnU7h2N4YFKNOPrvST2kPytvSaPQ3AoBliCYclH8Fw74jVTZ vaNs8+3cjx07W68fNAHXTKhUZsoG6ufcYGBaU= 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=noP03dTVE/dG12N4mOws/4QMhMXSC6OgsTnjw22R1Bg=; b=qtt4c+M4hFxRFmjBplNeNje7HpKrc+Id1yQOA1XPmBDXuJkvCag4tYF+2b1UPBXr0X jMgKIafDi6JutMfDCfjaVjufPzsZOWSrFXLmA+9ahrVN8FvYgpoUFEM8Aw92CYTOjgaF TY1nRFJN+I04g/tID3D/DtsB/Nl+wo8vxkT4N27RcpufXwHcZtHIsyHxlgEFXWqr0Z1Z Q6/huGdKMY7ioEESUTHXWn6wSu9f8HC4bWazd5WamdnGJi+ekm+CfoZn4b2pAK8oONsM BiTzJNLeUf2fm7S+9mJLX9k0x6tferV3fXDsuq5xWSBy0Uh3iPBHZqfJAii13e6DC7fZ iKvg== X-Gm-Message-State: AElRT7FQdfIfFNDrvZeLxz47V/uKjvTWxseIbI7Wmhw0fz49VcAaaos3 1vnESIGmZxDR4myBMBxhvQTKLdPE X-Google-Smtp-Source: AG47ELtwuG3YokhXiELvebmymrYGi8ufIkfwPTNLxSUnbKG3WIjYpOzeaytos8BOox34lTJ09JKEWQ== X-Received: by 2002:a19:1cc4:: with SMTP id c187-v6mr3805279lfc.44.1521046767969; Wed, 14 Mar 2018 09:59:27 -0700 (PDT) Return-Path: Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id t24-v6sm724849lfi.30.2018.03.14.09.59.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Mar 2018 09:59:27 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , 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 v6 14/25] drivers: firmware: psci: Support hierarchical CPU idle states Date: Wed, 14 Mar 2018 17:58:24 +0100 Message-Id: <1521046715-30683-15-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521046715-30683-1-git-send-email-ulf.hansson@linaro.org> References: <1521046715-30683-1-git-send-email-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.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index 9788bfc..256b4ed 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/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);