From patchwork Wed Jan 14 13:44: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: 5631251 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 398F89F9A0 for ; Wed, 14 Jan 2015 13:45:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3FF32039C for ; Wed, 14 Jan 2015 13:45:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B3AC20395 for ; Wed, 14 Jan 2015 13:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753032AbbANNpH (ORCPT ); Wed, 14 Jan 2015 08:45:07 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:16641 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753041AbbANNpE (ORCPT ); Wed, 14 Jan 2015 08:45: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 <0NI600K0N6DP1040@mailout4.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 14 Jan 2015 13:49:01 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-ae-54b672dd40e8 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 50.44.26295.DD276B45; Wed, 14 Jan 2015 13:45:01 +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 <0NI6002M966RL740@eusync3.samsung.com>; Wed, 14 Jan 2015 13:44:59 +0000 (GMT) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org, 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 Subject: [PATCH v3 2/7] ARM: Exynos: add support for sub-power domains Date: Wed, 14 Jan 2015 14:44:46 +0100 Message-id: <1421243091-10778-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1421243091-10778-1-git-send-email-m.szyprowski@samsung.com> References: <1421243091-10778-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkluLIzCtJLcpLzFFi42I5/e/4Vd27RdtCDH5c47K4te4cq8Wj+Y+Z LSbdn8Bi0f/4NbPF2aY37BabHl9jtZhxfh+TRdfPn2wWa4/cZbdYtesPowOXx6LvWR47Z91l 91i8aT+bx6ZVnWwem5fUe/RtWcXo8XmTXAB7FJdNSmpOZllqkb5dAlfGr2VrmQvmiVQ0vTnF 1sD4UqCLkYNDQsBEovGBaBcjJ5ApJnHh3nq2LkYuDiGBpYwSM2b9Y4Jw+pgkZk3/zwJSxSZg KNH1tosNpFlEwFti+TVFkDCzwCImiWtXgkFsYQE3iaPLDoKVswioSmw+eJwFpJxXwEPixsxk iF1yEv9frmACsTkFPCXmbV3JBFIiBFSy+KDbBEbeBYwMqxhFU0uTC4qT0nON9IoTc4tL89L1 kvNzNzFCgu/rDsalx6wOMQpwMCrx8Doc2RoixJpYVlyZe4hRgoNZSYQ3TW5biBBvSmJlVWpR fnxRaU5q8SFGJg5OqQZG51MVFa9uxjkobNjc9LL9c7jntMvX1uzjeu+eu2DxjILlGh5SWw6r MN2OuP7idTzbOUbrHY+DNmsLtu/9t990pYTOY7Mav//K35on6l8o3haleCqN3X2l9lyL/zzs 2wPPCOw0XZTbJ7Zs91pth2DG1e4Xz/y/u8Z4//ofbtKJPHUiATN1TNhfKbEUZyQaajEXFScC AAHVMlUcAgAA 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 f4445e5..1e09703 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 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);