From patchwork Fri Jun 29 06:19:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 140507 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp453213ljj; Thu, 28 Jun 2018 23:22:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdb3tsLAl9Dx9HFOZjTCUDlOYXcty8dg/BtdYbwqN3HiL1tI/CIo++ft0bL0eyI8+FZOWlE X-Received: by 2002:aa7:8058:: with SMTP id y24-v6mr13131299pfm.148.1530253349396; Thu, 28 Jun 2018 23:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530253349; cv=none; d=google.com; s=arc-20160816; b=MpdA9RImH+tZTm9kDPrxPTZQ0uOUB4kyWb+sVHbYgkpX/8QgQsfizsWOhDiXUHj85R d4AvxINZsxfHTM+G2Z2acj91qyNPgGWBtM/ibO8X+AqWPPUxE4H26Tx7PkBmSiDqil4I AE5mBL81edVmajFsh98MUkhc0CSGtfFAmDlrTz+A126njqOw/V7ydnMUtaWdSYQ69P03 NupvANo3QDAIPCfuYGGVLG9drxdeqYmjnBjuCUzFynPw8tvMSbq7w2hH+nAkPo1SoBKu BAGksXmReL44QbzCa25iP2ZnDsQbDxMafQURcC0n62pnz6nGIruKxkcE31YYTrMoUFOM KbNA== 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=S4eygS426BABBAsQSIESeCrT2oWeYHdrfhnghVokkWA=; b=rBZ8vjqqPRcx6Nn9NpNojN4/QpoDx2jEa2uf2cxsWr0u5kY8vloa0EcjaEP3Zf8tL2 KNw9KnYCf3GI69G1bWhC+8tSiLZfl0b38HooqY5Xv7mWFdkoxAJcUboeqQhGhC7vDxmG DUM6l6Q8IFJheuGz3Mc8mNt9GQdfyUbFmpyUX7QPHJP+SIVJJxHPTpdriwcRzQniNi6x YTw3LMvumtgHiGUwjZScrjDzcnQNZt06aDjj8qybVZhkz/ENvqDEV9Pdrg6oz3UGbwYj ZQIh6WXUVOvvMEsgYZWAxqLolQx/rDbrxbJnWgIVjRfeHISogPki00R97maH6ezx9yhR FdAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V932m0Q4; 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 l4-v6si8183357plt.497.2018.06.28.23.22.29; Thu, 28 Jun 2018 23:22:29 -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=V932m0Q4; 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 S933943AbeF2GW1 (ORCPT + 31 others); Fri, 29 Jun 2018 02:22:27 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:44873 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754342AbeF2GUC (ORCPT ); Fri, 29 Jun 2018 02:20:02 -0400 Received: by mail-pg0-f68.google.com with SMTP id b10-v6so3534217pgq.11 for ; Thu, 28 Jun 2018 23:20:02 -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=S4eygS426BABBAsQSIESeCrT2oWeYHdrfhnghVokkWA=; b=V932m0Q4haBm2tcIysbJW8MMYcBwvDbEly/TZrjjyBjgxbCR/0s8FngAI1amd5iNcF kaGlaSEQfikQ1kkQNKteNjVo/goaM7pF0x2yFJVDsGWz1acsHfeAVyGmnPSjfPsBxSP9 WgVksM6E5lXD40dnxxXwhqU4Dg76rfUALkwZw= 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=S4eygS426BABBAsQSIESeCrT2oWeYHdrfhnghVokkWA=; b=SqCjNYkpK2wt7M2ooRZn39ML8WlIV/FSpWJAu9ooszkpbCVhkALzNuuiZxnsqp9d3V BoYJp4PyKgEZLWgvobawEoUVNidWij/1KnbXn3elsYQWubtMkGzwX78UuFNZYGApxre9 3QOs8DFiBMQgluYiRklOnsx1gBYdSRevoB34DUAT1nszIAqgY37RKFtPiY5lnHHk2i5L y/0z553fj39uYCDtn+h33U93DnxxOoN+rs3HBVialklcoga2mkAm/I0ND+Jlyxg6zaQH 3h6qWqzmAFucoNjgLDrUt2OoVlfQePPVIkYQOWkEu6q/jW/eHkEM2AS+Q1aw/L1TsDsS rgog== X-Gm-Message-State: APt69E3PiKWP/99gxCitgEGpLBjNuD9y/SqwKFeyMKCXSKHqzW1BnPQ8 HHIpbXwfBmeUXPLsQ/THCw+SKw== X-Received: by 2002:a62:1f8c:: with SMTP id l12-v6mr4414317pfj.143.1530253202061; Thu, 28 Jun 2018 23:20:02 -0700 (PDT) Received: from localhost ([122.172.117.17]) by smtp.gmail.com with ESMTPSA id f7-v6sm1976454pfj.101.2018.06.28.23.20.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 23:20:01 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , ulf.hansson@linaro.org, Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rajendra Nayak , linux-kernel@vger.kernel.org Subject: [PATCH 02/10] OPP: Identify and mark genpd OPP tables Date: Fri, 29 Jun 2018 11:49:32 +0530 Message-Id: X-Mailer: git-send-email 2.18.0.rc1.242.g61856ae69a2c In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need to handle genpd OPP tables differently, this is already the case at one location and will be extended going forward. Add another field to the OPP table to check if the table belongs to a genpd or not. Signed-off-by: Viresh Kumar --- drivers/opp/of.c | 6 ++++-- drivers/opp/opp.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) -- 2.18.0.rc1.242.g61856ae69a2c diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 44a6b81fd228..218b8997d817 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -88,6 +88,9 @@ void _of_init_opp_table(struct opp_table *opp_table, struct device *dev) of_property_read_u32(np, "voltage-tolerance", &opp_table->voltage_tolerance_v1); + if (of_find_property(np, "#power-domain-cells", NULL)) + opp_table->is_genpd = true; + /* Get OPP table node */ opp_np = _opp_of_get_opp_desc_node(np, 0); of_node_put(np); @@ -314,8 +317,7 @@ static int _opp_add_static_v2(struct opp_table *opp_table, struct device *dev, ret = of_property_read_u64(np, "opp-hz", &rate); if (ret < 0) { /* "opp-hz" is optional for devices like power domains. */ - if (!of_find_property(dev->of_node, "#power-domain-cells", - NULL)) { + if (!opp_table->is_genpd) { dev_err(dev, "%s: opp-hz not found\n", __func__); goto free_opp; } diff --git a/drivers/opp/opp.h b/drivers/opp/opp.h index 7c540fd063b2..3cd3b7b167b5 100644 --- a/drivers/opp/opp.h +++ b/drivers/opp/opp.h @@ -138,6 +138,7 @@ enum opp_table_access { * @regulators: Supply regulators * @regulator_count: Number of power supply regulators * @genpd_performance_state: Device's power domain support performance state. + * @is_genpd: Marks if the OPP table belongs to a genpd. * @set_opp: Platform specific set_opp callback * @set_opp_data: Data to be passed to set_opp callback * @dentry: debugfs dentry pointer of the real device directory (not links). @@ -174,6 +175,7 @@ struct opp_table { struct regulator **regulators; unsigned int regulator_count; bool genpd_performance_state; + bool is_genpd; int (*set_opp)(struct dev_pm_set_opp_data *data); struct dev_pm_set_opp_data *set_opp_data;