From patchwork Mon Dec 1 11:41:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 5412021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A8B1ABEEA8 for ; Mon, 1 Dec 2014 11:51:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C15F62026C for ; Mon, 1 Dec 2014 11:51:28 +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 AAE8D200CF for ; Mon, 1 Dec 2014 11:51:27 +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 1XvPTV-00076T-DV; Mon, 01 Dec 2014 11:49:05 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XvPTJ-0006iM-Lt for linux-arm-kernel@lists.infradead.org; Mon, 01 Dec 2014 11:48:55 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NFW00LTSJGSO870@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 01 Dec 2014 20:48:28 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 1D.D1.18167.C855C745; Mon, 01 Dec 2014 20:48:28 +0900 (KST) X-AuditID: cbfee690-f79ab6d0000046f7-88-547c558c205d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id BA.BD.20081.C855C745; Mon, 01 Dec 2014 20:48:28 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NFW00LZHJF9QW10@mmp1.samsung.com>; Mon, 01 Dec 2014 20:48:28 +0900 (KST) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] PM/ Domains: Export of_genpd_get_from_provider function. Date: Mon, 01 Dec 2014 17:11:08 +0530 Message-id: <1417434068-7344-1-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: References: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRmVeSWpSXmKPExsWyRsSkVrcntCbE4NkrYYuGqyEWzYvXs1l8 PbyC0WLWlL1MFpseX2O1uLxrDpvFjPP7mCzOnL7EanF8bbgDp8fiPS+ZPO5c28PmsX/uGnaP zUvqPbZcbWfx6NuyitHj8ya5APYoLpuU1JzMstQifbsErowps1pZC86IVDz4toyxgXGdYBcj J4eEgInEua0HWCFsMYkL99azdTFycQgJLGWU2PrwARNM0feNcxkhEosYJf69OMIK4Uxgkug9 9xysnU3AWOLnzv3sILaIgIbElK7H7CBFzAIvGCW2ndzJBpIQFvCU2HrkNdBYDg4WAVWJvhsC IGFeATeJlXcnsoOEJQQUJOZMsgEJcwoES/xfdghspJBAgMSJLy/BRkoI7GOXuPD5BNh1LAIC Et8mH2KB6JWV2HSAGeJoSYmDK26wTGAUXsDIsIpRNLUguaA4Kb3IRK84Mbe4NC9dLzk/dxMj MBJO/3s2YQfjvQPWhxgFOBiVeHgPzKkOEWJNLCuuzD3EaAq0YSKzlGhyPjDe8kriDY3NjCxM TUyNj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 elKNZ4aPkBS78ZrLqjZKfruWm2oHzHSfuiuLq0h3rrnCkYZZYjpr5iqpubo8Zr0ze/nazUv1 DmgdYVJiKc5INNRiLipOBAB6+MFayQIAAA== 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-20141201_034853_941275_7CC0C742 X-CRM114-Status: GOOD ( 12.32 ) X-Spam-Score: -5.0 (-----) Cc: len.brown@intel.com, ulf.hansson@linaro.org, linux-samsung-soc@vger.kernel.org, gregkh@linuxfoundation.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, Amit Daniel Kachhap , khilman@linaro.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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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. Signed-off-by: Amit Daniel Kachhap Reviewed-by: Ulf Hansson --- 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 d822753..5d7a2c1 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2129,7 +2129,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); @@ -2149,6 +2149,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 9690827..4954e24 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -282,6 +282,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, @@ -299,6 +301,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