From patchwork Mon Dec 15 03:38:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 5490191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE29A9F326 for ; Mon, 15 Dec 2014 03:48:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCF17209CD for ; Mon, 15 Dec 2014 03:48:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0FD7209B5 for ; Mon, 15 Dec 2014 03:48:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y0McO-0006JG-Oj; Mon, 15 Dec 2014 03:46:44 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y0McK-0006Hv-Sg for linux-arm-kernel@lists.infradead.org; Mon, 15 Dec 2014 03:46:42 +0000 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NGL006SYUH42YA0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 15 Dec 2014 12:46:16 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 93.89.17016.8895E845; Mon, 15 Dec 2014 12:46:16 +0900 (KST) X-AuditID: cbfee68d-f79296d000004278-07-548e5988ecc4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C7.B6.09430.8895E845; Mon, 15 Dec 2014 12:46:16 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NGL002MDUG7GJ10@mmp2.samsung.com>; Mon, 15 Dec 2014 12:46:16 +0900 (KST) From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org Subject: [PATCH v2] PM/ Domains: Export of_genpd_get_from_provider function. Date: Mon, 15 Dec 2014 09:08:59 +0530 Message-id: <1418614739-7989-1-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 2.2.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsWyRsSkRrcjsi/E4N5UOYuGqyEWc2dPYrT4 engFo8WsKXuZLDY9vsZqcXnXHDaLz71HGC3unjrKZnHm9CVWi+Nrwx24PCae1fVYvOclk8ed a3vYPDYvqffYcrWdxaNvyypGjxWrv7N7fN4kF8ARxWWTkpqTWZZapG+XwJWx7u9ttoKXohXb eswbGLcLdTFycEgImEjc7dXsYuQEMsUkLtxbz9bFyMUhJLCUUeLry/2MEAkTic1rjzBCJKYz Sjx69IcFwpnAJHH19SU2kCo2AWOJnzv3s4PYIgIyElOv7GcFKWIWuMsk8XT9Y2aQhLCAj8Sl MyvBGlgEVCXabs8EW8Er4CZx+uBcZoh1chJbbj1iB2mWEFjGLjHj0wlWiAYBiW+TD7FA3C0r sekAVL2kxMEVN1gmMAouYGRYxSiaWpBcUJyUXmSoV5yYW1yal66XnJ+7iREY6qf/PevdwXj7 gPUhRgEORiUeXob/vSFCrIllxZW5hxhNgTZMZJYSTc4HRlReSbyhsZmRhamJqbGRuaWZkjiv otTPYCGB9MSS1OzU1ILU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pXF8z3+5C7dH35diWW4oxEQy3mouJE ALtJKpe7AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141214_194641_080288_146FC769 X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: -5.0 (-----) Cc: Len Brown , Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Amit Daniel Kachhap , Pavel Machek , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function looks up a PM domain form the provider. This will be useful to add parent/child domain relationship from the SoC specific code. The caller of the function must make sure that PM domain provider is already registered. Cc: Rafael J. Wysocki Reviewed-by: Ulf Hansson Signed-off-by: Amit Daniel Kachhap --- Changes from v1: * Added Ulf Hansson Reviewed by. * Cc'd to linux-pm This patch may solve the same purpose which is done by earlier posts 1) https://lkml.org/lkml/2014/11/24/319 - In this there were comments for not using the PM domain name. 2) Ulf Hansson posted a patch http://www.spinics.net/lists/linux-samsung-soc/msg39745.html which also solves similar purpose but I feel this is slightly complex and involves changing the genpd structure. drivers/base/power/domain.c | 3 ++- include/linux/pm_domain.h | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 6a103a3..0d8780c 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2088,7 +2088,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider); * Returns a valid pointer to struct generic_pm_domain on success or ERR_PTR() * on failure. */ -static struct generic_pm_domain *of_genpd_get_from_provider( +struct generic_pm_domain *of_genpd_get_from_provider( struct of_phandle_args *genpdspec) { struct generic_pm_domain *genpd = ERR_PTR(-ENOENT); @@ -2108,6 +2108,7 @@ static struct generic_pm_domain *of_genpd_get_from_provider( return genpd; } +EXPORT_SYMBOL_GPL(of_genpd_get_from_provider); /** * genpd_dev_pm_detach - Detach a device from its PM domain. diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 6cd20d5..a9edab2 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -271,6 +271,8 @@ typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args, int __of_genpd_add_provider(struct device_node *np, genpd_xlate_t xlate, void *data); void of_genpd_del_provider(struct device_node *np); +struct generic_pm_domain *of_genpd_get_from_provider( + struct of_phandle_args *genpdspec); struct generic_pm_domain *__of_genpd_xlate_simple( struct of_phandle_args *genpdspec, @@ -288,6 +290,12 @@ static inline int __of_genpd_add_provider(struct device_node *np, } static inline void of_genpd_del_provider(struct device_node *np) {} +static inline struct generic_pm_domain *of_genpd_get_from_provider( + struct of_phandle_args *genpdspec) +{ + return NULL; +} + #define __of_genpd_xlate_simple NULL #define __of_genpd_xlate_onecell NULL