From patchwork Mon Oct 11 16:57:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 12550619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDD54C433EF for ; Mon, 11 Oct 2021 17:00:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B869D60F6E for ; Mon, 11 Oct 2021 17:00:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B869D60F6E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=marcan.st Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KYfbzaMv9qiyRxIdpH7m8K+k+apwqEmJAULGQMJS0Z8=; b=aR1pDuYRMrAurH YQ/YeDXhvB8upGtwEs+uiomJ+5on95XNDqyV2cJ0EL1Sfhp96atXH+ieQdv7uk2O2F/QTXgvUzZ3h b8BqhRrV+fXDbXIMLiTNpP4T0ecK8Kj+rVh173grNiL6XL8pNfiw2MRyPkiv8YeIA7Er+SKuH/0JS hNFjWKZl57QV2lzeUE95f6/Td3Fn2tFgp11MujoTpv3ws6c4JQ7AuUHyRy+VuM8/L3tVMGbrg9OdK AaW5p3n64Q6vjbyjDeZhrYvHj0eiJJh6zpkpk+w8G9BM7p00Ih6cq7m9gw/cs6To9uUI5Z1N0s3dn +YE7rdsSbgjPC5GBaZGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZydM-00A8Zg-NQ; Mon, 11 Oct 2021 16:58:40 +0000 Received: from marcansoft.com ([212.63.210.85] helo=mail.marcansoft.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZycg-00A8K1-TT for linux-arm-kernel@lists.infradead.org; Mon, 11 Oct 2021 16:58:00 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hector@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 5CA0E42499; Mon, 11 Oct 2021 16:57:52 +0000 (UTC) From: Hector Martin To: linux-arm-kernel@lists.infradead.org Cc: Hector Martin , Alyssa Rosenzweig , Sven Peter , Marc Zyngier , Mark Kettenis , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Viresh Kumar , Nishanth Menon , Catalin Marinas , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 5/9] PM: domains: Add of_genpd_add_provider_simple_noclk() Date: Tue, 12 Oct 2021 01:57:03 +0900 Message-Id: <20211011165707.138157-6-marcan@marcan.st> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011165707.138157-1-marcan@marcan.st> References: <20211011165707.138157-1-marcan@marcan.st> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_095759_137812_E267F0E1 X-CRM114-Status: GOOD ( 13.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is analogous to of_genpd_add_provider_simple(), but calls dev_pm_opp_of_add_table_noclk() instead of dev_pm_opp_of_add_table(). Signed-off-by: Hector Martin --- drivers/base/power/domain.c | 39 +++++++++++++++++++++++++++++-------- include/linux/pm_domain.h | 8 ++++++++ 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 5db704f02e71..3377b9dd514c 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2227,13 +2227,9 @@ static bool genpd_present(const struct generic_pm_domain *genpd) return ret; } -/** - * of_genpd_add_provider_simple() - Register a simple PM domain provider - * @np: Device node pointer associated with the PM domain provider. - * @genpd: Pointer to PM domain associated with the PM domain provider. - */ -int of_genpd_add_provider_simple(struct device_node *np, - struct generic_pm_domain *genpd) +static int _of_genpd_add_provider_simple(struct device_node *np, + struct generic_pm_domain *genpd, + bool getclk) { int ret; @@ -2247,7 +2243,10 @@ int of_genpd_add_provider_simple(struct device_node *np, /* Parse genpd OPP table */ if (genpd->set_performance_state) { - ret = dev_pm_opp_of_add_table(&genpd->dev); + if (getclk) + ret = dev_pm_opp_of_add_table(&genpd->dev); + else + ret = dev_pm_opp_of_add_table_noclk(&genpd->dev, 0); if (ret) { if (ret != -EPROBE_DEFER) dev_err(&genpd->dev, "Failed to add OPP table: %d\n", @@ -2278,8 +2277,32 @@ int of_genpd_add_provider_simple(struct device_node *np, return 0; } + +/** + * of_genpd_add_provider_simple() - Register a simple PM domain provider + * @np: Device node pointer associated with the PM domain provider. + * @genpd: Pointer to PM domain associated with the PM domain provider. + */ +int of_genpd_add_provider_simple(struct device_node *np, + struct generic_pm_domain *genpd) +{ + return _of_genpd_add_provider_simple(np, genpd, true); +} EXPORT_SYMBOL_GPL(of_genpd_add_provider_simple); +/** + * of_genpd_add_provider_simple_noclk() - Register a simple clockless + * PM domain provider + * @np: Device node pointer associated with the PM domain provider. + * @genpd: Pointer to PM domain associated with the PM domain provider. + */ +int of_genpd_add_provider_simple_noclk(struct device_node *np, + struct generic_pm_domain *genpd) +{ + return _of_genpd_add_provider_simple(np, genpd, false); +} +EXPORT_SYMBOL_GPL(of_genpd_add_provider_simple_noclk); + /** * of_genpd_add_provider_onecell() - Register a onecell PM domain provider * @np: Device node pointer associated with the PM domain provider. diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 67017c9390c8..db3f75612512 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -316,6 +316,8 @@ struct genpd_onecell_data { #ifdef CONFIG_PM_GENERIC_DOMAINS_OF int of_genpd_add_provider_simple(struct device_node *np, struct generic_pm_domain *genpd); +int of_genpd_add_provider_simple_noclk(struct device_node *np, + struct generic_pm_domain *genpd); int of_genpd_add_provider_onecell(struct device_node *np, struct genpd_onecell_data *data); void of_genpd_del_provider(struct device_node *np); @@ -342,6 +344,12 @@ static inline int of_genpd_add_provider_simple(struct device_node *np, return -EOPNOTSUPP; } +static inline int of_genpd_add_provider_simple_noclk(struct device_node *np, + struct generic_pm_domain *genpd) +{ + return -EOPNOTSUPP; +} + static inline int of_genpd_add_provider_onecell(struct device_node *np, struct genpd_onecell_data *data) {