From patchwork Mon Nov 3 03:53:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 5213901 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 BBFDCC11AC for ; Mon, 3 Nov 2014 04:05:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4B64201E4 for ; Mon, 3 Nov 2014 04:05:38 +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 DD167201BB for ; Mon, 3 Nov 2014 04:05:37 +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 1Xl8rW-0008Uf-0l; Mon, 03 Nov 2014 04:03:26 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xl8rT-00089H-9c for linux-arm-kernel@lists.infradead.org; Mon, 03 Nov 2014 04:03:23 +0000 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEG00FSS390PE20@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 03 Nov 2014 13:03:00 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 4E.9B.17016.47EF6545; Mon, 03 Nov 2014 13:03:00 +0900 (KST) X-AuditID: cbfee68d-f79296d000004278-64-5456fe745ab4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 66.E9.09430.47EF6545; Mon, 03 Nov 2014 13:03:00 +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 <0NEG00BUJ320LR40@mmp2.samsung.com>; Mon, 03 Nov 2014 13:03:00 +0900 (KST) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 07/12] soc: samsung: pm_domain: Use compatible name for power domain name Date: Mon, 03 Nov 2014 09:23:05 +0530 Message-id: <1414986790-11940-8-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1414986790-11940-1-git-send-email-amit.daniel@samsung.com> References: <1414986790-11940-1-git-send-email-amit.daniel@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsWyRsSkVrfkX1iIwc8mCYuGqyEWvQuuslls enyN1eJz7xFGixnn9zFZLNr6hd2BzWPzknqPvi2rGD0+b5ILYI7isklJzcksSy3St0vgymh5 c5u54JhIxYupG1gaGP8IdDFyckgImEjcWbyACcIWk7hwbz1bFyMXh5DAUkaJnz+es8EUnZs7 A6xISGA6o8SM6yoQRROYJK7smQqWYBMwlvi5cz87iC0ikC6xZtFusGZmgRSJy9M7wGqEBaIl Zh04xAxiswioSkx6cRbM5hVwl1j+thXI5gBapiAxZ5INSJhTwEPiZN91Voi97hKT3j1nAtkr IfCbTWLmhBssEHMEJL5NPsQC0SsrsekAM8TNkhIHV9xgmcAovICRYRWjaGpBckFxUnqRoV5x Ym5xaV66XnJ+7iZGYAif/vesdwfj7QPWhxgFOBiVeHgLtoeFCLEmlhVX5h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FXk3YL nfUountpz5fL0mrPlFiKMxINtZiLihMBC1mDh6YCAAA= 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-20141102_200323_473385_CE52B5E4 X-CRM114-Status: GOOD ( 12.21 ) X-Spam-Score: -5.6 (-----) Cc: pankaj.dubey@samsung.com, Amit Daniel Kachhap , kgene.kim@samsung.com 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 patch adds support for second optional compatible complate name. If this compatible name is present then this name will be used to create the Power Domain and not the DT node name. The benefit of this approach is to hook the notifier to the correct Power Domain. Cc: Kukjin Kim Reviewed-by: Pankaj Dubey Signed-off-by: Amit Daniel Kachhap --- .../bindings/arm/exynos/power_domain.txt | 8 ++++++++ drivers/soc/samsung/pm_domains.c | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt index 5599017..7250a5c 100644 --- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt +++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt @@ -12,6 +12,8 @@ Required Properties: must be 0. Optional Properties: +- compatible: This is a second compatible name and gives the complete Power Domain + name like "samsung,exynos7-pd-mfc" - clocks: List of clock handles. The parent clocks of the input clocks to the devices in this power domain are set to oscclk before power gating and restored back after powering on a domain. This is required for @@ -43,5 +45,11 @@ Example: #power-domain-cells = <0>; }; + mfc_pd: power-domain@10044060 { + compatible = "samsung,exynos4210-pd", "samsung,exynos7-pd-mfc"; + pd-offset = <0x4060>; + #power-domain-cells = <0>; + }; + See Documentation/devicetree/bindings/power/power_domain.txt for description of consumer-side bindings. diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c index 923eb57..e63d129 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -124,12 +124,17 @@ static int exynos_power_domain_probe(struct platform_device *pdev) for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { struct exynos_pm_domain *pd; int on, i; + const char *name; pd = devm_kzalloc(&pdev->dev, sizeof(*pd), GFP_KERNEL); if (!pd) return -ENOMEM; - pd->pd.name = kstrdup(np->name, GFP_KERNEL); + if (of_property_read_string_index(np, "compatible", 1, &name)) { + /* Second entry not found, use the node name*/ + name = np->name; + } + pd->pd.name = kstrdup(name, GFP_KERNEL); pd->name = pd->pd.name; if (of_property_read_u32(np, "pd-offset", &offset)) { pr_err("%s: failed to find offset for power domain\n",