From patchwork Mon Nov 24 07:30:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 5363711 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 CA8D8C11AC for ; Mon, 24 Nov 2014 07:31:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C0A9200CA for ; Mon, 24 Nov 2014 07:31:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9227E2021B for ; Mon, 24 Nov 2014 07:31:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752532AbaKXHbp (ORCPT ); Mon, 24 Nov 2014 02:31:45 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:10840 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752652AbaKXHbo (ORCPT ); Mon, 24 Nov 2014 02:31:44 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NFJ00KXC91NV970@mailout1.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Mon, 24 Nov 2014 07:34:35 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-9d-5472deddd325 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 56.AA.07834.DDED2745; Mon, 24 Nov 2014 07:31:41 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NFJ0029Y8VPQA20@eusync1.samsung.com>; Mon, 24 Nov 2014 07:31:41 +0000 (GMT) From: Andrzej Hajda To: linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Kukjin Kim , Inki Dae , Tomasz Figa , Tobias Jakobi , Daniel Drake , Sylwester Nawrocki , Andrzej Hajda Subject: [PATCH RESEND 2/7] ARM: Exynos: add support for sub-power domains Date: Mon, 24 Nov 2014 08:30:51 +0100 Message-id: <1416814256-24288-3-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1416814256-24288-1-git-send-email-a.hajda@samsung.com> References: <1416814256-24288-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplluLIzCtJLcpLzFFi42I5/e/4Zd2794pCDNYukrO4te4cq8Wj+Y+Z LSbdn8Bi0f/4NbPFjPP7mCy6fv5ks1h75C67xeE37awWq3b9YXTg9Fj0Pctj56y77B6LN+1n 89i0qpPNo2/LKkaPz5vkAtiiuGxSUnMyy1KL9O0SuDKuLjzPVvBXsOLp2VlsDYy/+boYOTkk BEwkvs1cxgRhi0lcuLeerYuRi0NIYCmjxNwN+5kgnD4mib2T/7KDVLEJaEr83XyTDcQWEVCV +Ny2gB2kiFlgG5PEjTWfWUASwgJeEgfabzOC2CxARRNvPAZbwSvgLHH8xn4WiHVyEiePTWYF sTkFXCSuPT7EDGILAdXM3P+GaQIj7wJGhlWMoqmlyQXFSem5hnrFibnFpXnpesn5uZsYIUH3 ZQfj4mNWhxgFOBiVeHh/9BSGCLEmlhVX5h5ilOBgVhLhPfsPKMSbklhZlVqUH19UmpNafIiR iYNTqoGx3YNDMyxXymAe3yyd49+uhKXVu3Hf6mD+OPXHgh0W5y4s2nXo/onNv5aLPgxQX2wc HcU9w7F0kkXUrRf+PAdTHYulH1oL3ZHNXKATOe3F7CsrPGc7Cx18y6jj1ZFbUuLIfa2mPOnW 5jX+LrXVzbd+abcfdP300cotdPcMfTGPm0crBc025EcqsRRnJBpqMRcVJwIAPtL7qhgCAAA= 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 From: Marek Szyprowski 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 Signed-off-by: Andrzej Hajda --- Documentation/devicetree/bindings/arm/exynos/power_domain.txt | 2 ++ arch/arm/mach-exynos/pm_domains.c | 9 ++++++++- 2 files changed, 10 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..cad9476 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. +- power-domain-master: 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 20f2671..373ac62 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,13 @@ 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, "power-domain-master", 0); + if (master_np) { + pm_genpd_add_subdomain_names(master_np->name, np->name); + of_node_put(master_np); + } } return 0;