From patchwork Mon Feb 2 13:20:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 5762161 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 10FC2BF440 for ; Mon, 2 Feb 2015 13:20:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EE3A203C1 for ; Mon, 2 Feb 2015 13:20:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B216203DF for ; Mon, 2 Feb 2015 13:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754325AbbBBNUq (ORCPT ); Mon, 2 Feb 2015 08:20:46 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54521 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755206AbbBBNUp (ORCPT ); Mon, 2 Feb 2015 08:20:45 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NJ500CBZBXA1P30@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Mon, 02 Feb 2015 13:24:46 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-16-54cf791a63d5 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 97.D2.07834.A197FC45; Mon, 02 Feb 2015 13:18:18 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NJ5004YCBQ4PP60@eusync4.samsung.com>; Mon, 02 Feb 2015 13:20:42 +0000 (GMT) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, Marek Szyprowski , Kukjin Kim , Tobias Jakobi , Daniel Drake , Andrzej Hajda , Inki Dae , Tomasz Figa , Javier Martinez Canillas , jy0922.shim@samsung.com, kyungmin.park@samsung.com Subject: [PATCH v5 2/9] ARM: Exynos: add support for sub-power domains Date: Mon, 02 Feb 2015 14:20:21 +0100 Message-id: <1422883228-10690-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1422883228-10690-1-git-send-email-m.szyprowski@samsung.com> References: <1422883228-10690-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKLMWRmVeSWpSXmKPExsVy+t/xa7pSledDDC4+ZbG4te4cq8Wj+Y+Z La58fc9mMen+BBaLo78LLF7cu8hi0f/4NbPF2aY37BabHl9jtZhxfh+TRdfPn2wWa4/cZbdY tesPowOvx9/n11k8Fn3P8tg56y67x+JN+9k8Nq3qZPO4332cyWPzknqPvi2rGD0+b5IL4Izi sklJzcksSy3St0vgyjiyfStjwVORit1XljI1MK4W7GLk5JAQMJG4cqOHDcIWk7hwbz2QzcUh JLCUUeLr1H4op49J4vjSvSwgVWwChhJdb7uAEhwcIgLeEsuvKYLUMAvMY5ZofXEObJKwgJvE oyk9zCA2i4CqxPeef2C9vAIeEqenTWKC2CYn8f/lCjCbU8BT4uPqp+wgthBQzbktR1knMPIu YGRYxSiaWppcUJyUnmuoV5yYW1yal66XnJ+7iREStF92MC4+ZnWIUYCDUYmH9wH3uRAh1sSy 4srcQ4wSHMxKIrwaFudDhHhTEiurUovy44tKc1KLDzEycXBKNTBOXWT24eXmo5lPTQRrP3W9 v/Q/LX1J4a23p/I+xJe4VZj1Bj/e/+Zif1fP90CldObzxWcvrRDqMvbb8yZfbVr831fzJln9 Sl14h5l/zpWC5X/fSucm8W3aUK/9mOHOrliF3t/JK8XXmwpwv4mMXvJw0sGD13V3Z/3oe9zM cllAJXT6WZaFe1fYKbEUZyQaajEXFScCALzwYsE4AgAA 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. Based on previous work by Amit Daniel Kachhap . Signed-off-by: Marek Szyprowski Reviewed-by: Ulf Hansson --- .../bindings/arm/exynos/power_domain.txt | 2 ++ arch/arm/mach-exynos/pm_domains.c | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt index f4445e5a2bbb..1e097037349c 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-domains: phandle pointing to the parent power domain, for more details + see Documentation/devicetree/bindings/power/power_domain.txt Node of a device using power domains must have a power-domains 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..37266a826437 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -161,6 +161,34 @@ no_clk: of_genpd_add_provider_simple(np, &pd->pd); } + /* Assign the child power domains to their parents */ + for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { + struct generic_pm_domain *child_domain, *parent_domain; + struct of_phandle_args args; + + args.np = np; + args.args_count = 0; + child_domain = of_genpd_get_from_provider(&args); + if (!child_domain) + continue; + + if (of_parse_phandle_with_args(np, "power-domains", + "#power-domain-cells", 0, &args) != 0) + continue; + + parent_domain = of_genpd_get_from_provider(&args); + if (!parent_domain) + continue; + + if (pm_genpd_add_subdomain(parent_domain, child_domain)) + pr_warn("%s failed to add subdomain: %s\n", + parent_domain->name, child_domain->name); + else + pr_info("%s has as child subdomain: %s.\n", + parent_domain->name, child_domain->name); + of_node_put(np); + } + return 0; } arch_initcall(exynos4_pm_init_power_domain);