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: 10495651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A1D0460325 for ; Fri, 29 Jun 2018 06:23:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E96C27FAC for ; Fri, 29 Jun 2018 06:23:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82F6E284DC; Fri, 29 Jun 2018 06:23: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=unavailable 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 1815727FAC for ; Fri, 29 Jun 2018 06:23:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932979AbeF2GWZ (ORCPT ); Fri, 29 Jun 2018 02:22:25 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:42909 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754336AbeF2GUC (ORCPT ); Fri, 29 Jun 2018 02:20:02 -0400 Received: by mail-pg0-f65.google.com with SMTP id c10-v6so3537573pgu.9 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=C0JMz55X6AJrq5IgaXysLselo4kfDoH09g1z0u+3a3wVANbqJYw8rsuHkAtLGdU+CN EV7XSEmb7qGrZzB3Mx3M2MocvJ0QpjHcOcwecmXvSSC+Rr06/hUh/3Z5Aura5j0DEC4/ rHApo8XpZ+TZXfATITHvAtLceGBnHKMiXkNA3VtsZ0OYmgWgWIJ9EbTEuSB9VxrzM1JU sXKFSWhoSHhjorSBghp11IGQnnTNDld7Huai2vDFXeyX+NfHQuXsdBsByJvehq4lru9r VLpiXRi09PyVA+Jba3zr0bRwsszZij3yXOj4LYgX1u216Zal7gpE/QqkcKYQxAnRxGap xbGA== X-Gm-Message-State: APt69E1UjczOD5kWZOCvfYfr/OxUWujgXeg8itkCLdjeCKMLCyfgsqbv eKjbChzTkweFSAvXQKliilBCcA== X-Google-Smtp-Source: AAOMgpe9535S8Cd2JDRCzezBza+t9ku+jbYWNukszkUIIpgcO3LiWvvc26wLTGFauCT+OfKM8DRF2Q== 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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;