From patchwork Tue Jan 13 09:39:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 5618781 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C53399F3A0 for ; Tue, 13 Jan 2015 09:40:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC1EE20605 for ; Tue, 13 Jan 2015 09:40:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5F2E2039D for ; Tue, 13 Jan 2015 09:40:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751086AbbAMJkC (ORCPT ); Tue, 13 Jan 2015 04:40:02 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:14699 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750969AbbAMJkA (ORCPT ); Tue, 13 Jan 2015 04:40:00 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) 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 <0NI400FEK0DBUZA0@mailout4.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 13 Jan 2015 09:43:59 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-27-54b4e7eea265 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id AF.AC.07834.EE7E4B45; Tue, 13 Jan 2015 09:39:58 +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 <0NI400IP606GL550@eusync3.samsung.com>; Tue, 13 Jan 2015 09:39:58 +0000 (GMT) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Kukjin Kim , Tobias Jakobi , Daniel Drake , Andrzej Hajda , Inki Dae , Tomasz Figa , kyungmin.park@samsung.com, Pankaj Dubey , Amit Daniel Kachhap , Geert Uytterhoeven , Ulf Hansson Subject: [PATCH v2 1/6] ARM: Exynos: add support for sub-power domains Date: Tue, 13 Jan 2015 10:39:46 +0100 Message-id: <1421141991-15155-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1421141991-15155-1-git-send-email-m.szyprowski@samsung.com> References: <1421141991-15155-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHLMWRmVeSWpSXmKPExsVy+t/xq7rvnm8JMWj7yWlxa905VouGqyEW j+Y/ZrZ4dmsvk8Wk+xNYLPofv2a2ONv0ht1ixvl9TBZdP3+yWaw9cpfdYtHWL+wWq3b9YbQ4 vjbcgddj0fcsj52z7rJ7LN60n81j06pONo871/aweRw63MHo0bdlFaPH501yARxRXDYpqTmZ ZalF+nYJXBmv759gLmgVqVh2WK2B8ZRAFyMHh4SAicTsHyVdjJxAppjEhXvr2boYuTiEBJYy ShyZNgnK6WOSeH7xGztIFZuAoUTX2y42EFtEQFXic9sCdpAiZoGLzBJ/5rxmA5kqLOAmse9E IUgNC1DNx7alYPW8Ah4S2w/+ZoTYJifx/+UKJhCbU8BTYubzHmYQWwio5sG1ZUwTGHkXMDKs YhRNLU0uKE5KzzXUK07MLS7NS9dLzs/dxAgJ0y87GBcfszrEKMDBqMTDuyN7S4gQa2JZcWXu IUYJDmYlEd75t4FCvCmJlVWpRfnxRaU5qcWHGJk4OKUaGFvE9hqv/CvyI/nSTfXz+0wXa1xx Pscc8f9I+sXfZe457joWm3weLlvgxLZJfgqXdMeX3HcBXb3sf+fnr/8n3Xrpzd+kzsT+8tPr VrzLseE5GW493arEy1F3pvw7iW2bv9nYxL9VmPlqK9+yegb7WXGNfUeD9thK8X+1TftfmFif mNTwtLqQUYmlOCPRUIu5qDgRAGW9wEUxAgAA 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 --- .../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 f4445e5..28918a9 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: generic power domain binding pointing to a master power domain + that the given domain is a part of 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 20f2671..37266a8 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);