From patchwork Mon Nov 24 13:04:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 5366031 Return-Path: X-Original-To: patchwork-linux-pm@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 6D6C4C11AC for ; Mon, 24 Nov 2014 13:15:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 605DA203EB for ; Mon, 24 Nov 2014 13:15:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69952203E1 for ; Mon, 24 Nov 2014 13:15:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461AbaKXNPg (ORCPT ); Mon, 24 Nov 2014 08:15:36 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:28071 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbaKXNPe (ORCPT ); Mon, 24 Nov 2014 08:15:34 -0500 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NFJ003B6OTWPN00@mailout3.samsung.com>; Mon, 24 Nov 2014 22:15:33 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 04.EF.11124.47F23745; Mon, 24 Nov 2014 22:15:32 +0900 (KST) X-AuditID: cbfee68e-f79b46d000002b74-46-54732f744143 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 33.75.09430.47F23745; Mon, 24 Nov 2014 22:15:32 +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 <0NFJ00EZLOLG6V60@mmp2.samsung.com>; Mon, 24 Nov 2014 22:15:32 +0900 (KST) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: kgene.kim@samsung.com, linux-kernel@vger.kernel.org, s.nawrocki@samsung.com, pankaj.dubey@samsung.com, ulf.hansson@linaro.org, khilman@kernel.org, linux-pm@vger.kernel.org, geert@linux-m68k.org, rjw@rjwysocki.net, devicetree@vger.kernel.org, Amit Daniel Kachhap Subject: [PATCH RFC v2 05/12] soc: samsung: pm_domain: Use unique compatible name for power domain Date: Mon, 24 Nov 2014 18:34:09 +0530 Message-id: <1416834256-11225-5-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1416834256-11225-1-git-send-email-amit.daniel@samsung.com> References: <1416833572-6880-1-git-send-email-amit.daniel@samsung.com> <1416834256-11225-1-git-send-email-amit.daniel@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPLMWRmVeSWpSXmKPExsWyRsSkRrdEvzjEoOmesUXD1RCL+UfOsVo8 u7WXyaJ3wVU2i6ebHzNZbHp8jdXi8q45bBafe48wWsw4v4/JYtHWL+wWZ05fYrU4/Kad1eL4 2nAHXo9NqzrZPO5c28PmcehwB6PH5iX1HluutrN49G1ZxejxeZNcAHsUl01Kak5mWWqRvl0C V8bRzV/ZCq6KVOz+/469gfGTQBcjJ4eEgInE3hn7GCFsMYkL99azdTFycQgJLGWUmPvhMjNM 0ZEzJ9lAbCGB6YwSX0/mQxRNYJLY8+ceC0iCTcBY4ufO/exdjBwcIgLeEsuvKYLUMAusZpLY 2v6BCaRGWCBFYunUi2D1LAKqEisfNDKC1PMKuEssf2YBYkoIKEjMmWQD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VhLhFRMrDhHiTUmsrEotyo8vKs1JLT7EaAp01ERm KdHkfGCiyCuJNzQ2MTc1NrU0sTAxs1QS571xMzdESCA9sSQ1OzW1ILUIpo+Jg1OqgZG1wWNP koDTTzU39ln3tT0u3zRY2bYubNOupWuv7liw8LruhP1HXRxuZaVuf/v3/ILE00pPWVoFnu+6 tf2gdgzn0unXuqwuX807vZA3KeE0f11mnv+W6PMKN06r7apX2/n32vX7aw+3y9Y9DFNi2c50 K2S5I5v5B6urZ3h2zhA7tqA8KOKnz9wsJZbijERDLeai4kQAEoXtDdwCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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. This will be useful to carry out any power domain specific changes in the PD on/off handlers for new SoCs. This change will not affect the existing DT bindings. Cc: Kukjin Kim Signed-off-by: Amit Daniel Kachhap --- .../bindings/arm/exynos/power_domain.txt | 8 ++++++++ drivers/soc/samsung/pm_domains.c | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt index abde1ea..00ebda1 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"; + reg = <0x10044060 0x20>; + #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 69bc8b1..f4f2a6c 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -120,12 +120,20 @@ static int exynos_power_domain_probe(struct platform_device *pdev) struct exynos_pm_domain *pd; int i; bool on; + const char *name; pd = devm_kzalloc(&pdev->dev, sizeof(*pd), GFP_KERNEL); if (!pd) return -ENOMEM; - pd->pd.name = kstrdup(np->name, GFP_KERNEL); + /* + * Check if second compatible name found then use as power + * domain name or else use the DT node name as before. + */ + if (of_property_read_string_index(np, "compatible", 1, &name)) + name = np->name; + + pd->pd.name = kstrdup(name, GFP_KERNEL); pd->name = pd->pd.name; pd->base = of_iomap(np, 0); pd->pd.power_off = exynos_pd_power_off;