From patchwork Wed Dec 3 12:33:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 5430331 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 A83B3BEEA8 for ; Wed, 3 Dec 2014 12:34:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D72D320265 for ; Wed, 3 Dec 2014 12:34:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 050E72025A for ; Wed, 3 Dec 2014 12:34:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbaLCMeH (ORCPT ); Wed, 3 Dec 2014 07:34:07 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:25792 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379AbaLCMeE (ORCPT ); Wed, 3 Dec 2014 07:34:04 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NG000KE2B1APZ30@mailout4.w1.samsung.com>; Wed, 03 Dec 2014 12:36:46 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-6a-547f033a0f93 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 90.45.26295.A330F745; Wed, 03 Dec 2014 12:34:02 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NG000D7FAWMOF60@eusync3.samsung.com>; Wed, 03 Dec 2014 12:34:02 +0000 (GMT) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Kukjin Kim , Inki Dae , Tobias Jakobi , Daniel Drake , Andrzej Hajda , Tomasz Figa , Pankaj Dubey , Amit Daniel Kachhap , Geert Uytterhoeven , Ulf Hansson Subject: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains Date: Wed, 03 Dec 2014 13:33:44 +0100 Message-id: <1417610024-29748-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1416814256-24288-3-git-send-email-a.hajda@samsung.com> References: <1416814256-24288-3-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBLMWRmVeSWpSXmKPExsVy+t/xq7pWzPUhBgdmGFjcWneO1aLhaojF o/mPmS2e3drLZDHp/gQWi/7Hr5ktNj2+xmpxedccNosZ5/cxWXT9/MlmsfbIXXaLRVu/sFus 2vWH0eL42nAHPo9F37M8ds66y+6xeNN+No9NqzrZPO5c28PmcehwB6PH5iX1Hn1bVjF6fN4k F8AZxWWTkpqTWZZapG+XwJVxf+151oK/ghWnl1c0MP7g62Lk5JAQMJFYP283O4QtJnHh3nq2 LkYuDiGBpYwSEzuvsEI4fUwSt24/ZwWpYhMwlOh628UGYosIZEv8+DaZBaSIWWALs8TcW//A RgkLuEns2PMNzGYRUJVYfnE7cxcjBwevgIfEj70xENvkJP6/XMEEYnMKuEg83fOEBcQWEnCW +LV2H/sERt4FjAyrGEVTS5MLipPSc430ihNzi0vz0vWS83M3MUJC9+sOxqXHrA4xCnAwKvHw OryrCRFiTSwrrsw9xCjBwawkwvvsW12IEG9KYmVValF+fFFpTmrxIUYmDk6pBkYhnjgZlhr5 k85T025nxz+vnqx74vqGoEnrpxzfd3L1DZlF/xYs5Kg5v7Jvq5SbKddz9qBTWZebGJbfyDte 1WJcbiy5NO2A/67zdX+tLnfNCBTPvnGhWjNhxuL3vv5hYZ9ml8xPFtuvufPk7ynmyZFsN+Yv qWFNvSreusByWqVFO0vdOoM17u5KLMUZiYZazEXFiQCuP+nuOwIAAA== 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=-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 making one power domain a sub-domain of other domain. This is useful for modeling power dependences for devices like TV Mixer or Camera ISP, which needs to have more than one power domain enabled to be operational. Signed-off-by: Marek Szyprowski --- Documentation/devicetree/bindings/arm/exynos/power_domain.txt | 2 ++ arch/arm/mach-exynos/pm_domains.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt index abde1ea8a119..b884358ebb1a 100644 --- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt +++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt @@ -22,6 +22,8 @@ Optional Properties: - pclkN, clkN: Pairs of parent of input clock and input clock to the devices in this power domain. Maximum of 4 pairs (N = 0 to 3) are supported currently. +- samsung,power-domain: phandle to a master power domain that the given domain + is a part of Node of a device using power domains must have a samsung,power-domain property defined with a phandle to respective power domain. diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index 20f267121b3e..fa9a47ddad81 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -108,7 +108,7 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain) static __init int exynos4_pm_init_power_domain(void) { struct platform_device *pdev; - struct device_node *np; + struct device_node *np, *master_np; for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { struct exynos_pm_domain *pd; @@ -159,6 +159,15 @@ no_clk: pm_genpd_init(&pd->pd, NULL, !on); of_genpd_add_provider_simple(np, &pd->pd); + + /* make master and slave hierarchy */ + master_np = of_parse_phandle(np, "samsung,power-domain", 0); + if (!master_np) + master_np = of_parse_phandle(np, "power-domains", 0); + if (master_np) { + pm_genpd_add_subdomain_names(master_np->name, np->name); + of_node_put(master_np); + } } return 0;