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: 5213731 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 E65369F380 for ; Mon, 3 Nov 2014 04:03:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DB0C20253 for ; Mon, 3 Nov 2014 04:03:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 564EA201BB for ; Mon, 3 Nov 2014 04:03:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752606AbaKCEDD (ORCPT ); Sun, 2 Nov 2014 23:03:03 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:31632 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752262AbaKCEDC (ORCPT ); Sun, 2 Nov 2014 23:03:02 -0500 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>; 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 Cc: kgene.kim@samsung.com, pankaj.dubey@samsung.com, Amit Daniel Kachhap 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/vesdwfj7QPWhxgFOBiVeHgLtoeFCLEmlhVX5h5iNAXaMJFZSjQ5 HxgpeSXxhsZmRhamJqbGRuaWZkrivIpSP4OFBNITS1KzU1MLUovii0pzUosPMTJxcEo1MDIa Wgha1SmdOru4LO7Vz5UOFQePNcg+2nas0D+MaYm3d+mTPRX3pf7WSzmn7a1lvnXjilmI+G2n 1MwCb6UF1o4npwgzfnXz9K5bWmGWffrwof3sDEX+JpuNrl3/xFx8jT+yi88xTHPplbMfrxl4 hUy7cv2QPa9pYL7S3JeyCdu4v+4zafJsVWIpzkg01GIuKk4EAOc3KEdcAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRmVeSWpSXmKPExsVy+t9jQd2Sf2EhBk2P+S0aroZY9C64ymax 6fE1VovPvUcYLWac38dksWjrF3YHNo/NS+o9+rasYvT4vEkugDmqgdEmIzUxJbVIITUvOT8l My/dVsk7ON453tTMwFDX0NLCXEkhLzE31VbJxSdA1y0zB2itkkJZYk4pUCggsbhYSd8O04TQ EDddC5jGCF3fkCC4HiMDNJCwhjGj5c1t5oJjIhUvpm5gaWD8I9DFyMkhIWAicW7uDCYIW0zi wr31bCC2kMB0RokZ11W6GLmA7AlMElf2TAUrYhMwlvi5cz87iC0ikC6xZtFusAZmgRSJy9M7 wGqEBaIlZh04xAxiswioSkx6cRbM5hVwl1j+thXI5gBapiAxZ5INSJhTwEPiZN91Voi97hKT 3j1nmsDIu4CRYRWjaGpBckFxUnqukV5xYm5xaV66XnJ+7iZGcIQ8k97BuKrB4hCjAAejEg9v wfawECHWxLLiytxDjBIczEoivJVrgUK8KYmVValF+fFFpTmpxYcYTYGOmsgsJZqcD4zevJJ4 Q2MTc1NjU0sTCxMzSyVx3oOt1oFCAumJJanZqakFqUUwfUwcnFINjPUX77ziE2I/5Hlce69O czfTxjMdrEcOb4xs/u7b2WKce43jnefNyG/xerusjnw9wMgjIFO6jTswZccj44Xlf4KK3jBu /PJasXzSfxvzFTPEXXW1yjnj9mrGxTca8rXeZ4yr8vgUsFepSD/5ksrSklhlqSqBE4FXk3YL nfUountpz5fL0mrPlFiKMxINtZiLihMBC1mDh6YCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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",