From patchwork Tue Jan 20 12:16:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 5668531 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 8059B9F9B1 for ; Tue, 20 Jan 2015 12:17:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F6C820396 for ; Tue, 20 Jan 2015 12:17:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8A192037D for ; Tue, 20 Jan 2015 12:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbbATMRK (ORCPT ); Tue, 20 Jan 2015 07:17:10 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:41666 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753491AbbATMRJ (ORCPT ); Tue, 20 Jan 2015 07:17:09 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) 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 <0NIH00A116BEY570@mailout1.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 20 Jan 2015 12:21:14 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-79-54be47446dc0 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 9E.D1.26295.4474EB45; Tue, 20 Jan 2015 12:17:08 +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 <0NIH00J4064B2380@eusync3.samsung.com>; Tue, 20 Jan 2015 12:17:06 +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, Pankaj Dubey , Amit Daniel Kachhap , Geert Uytterhoeven , Ulf Hansson Subject: [PATCH v4 2/9] ARM: Exynos: add support for sub-power domains Date: Tue, 20 Jan 2015 13:16:52 +0100 Message-id: <1421756219-21037-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1421756219-21037-1-git-send-email-m.szyprowski@samsung.com> References: <1421756219-21037-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsVy+t/xq7ou7vtCDE7/k7W4te4cq0XD1RCL R/MfM1tc+fqezeLZrb1MFpPuT2CxOPq7wOLFvYssFv2PXzNbnG16w26x6fE1VosZ5/cxWXT9 /MlmsfbIXXaLRVu/sFus2vWH0eL42nAHQY+/z6+zeCz6nuWxc9Zddo/Fm/azeWxa1cnmcefa HjaPQ4c7GD3udx9n8ti8pN6jb8sqRo/Pm+QCuKO4bFJSczLLUov07RK4Mo5s38pY8FSkYveV pUwNjKsFuxg5OSQETCT6d79kg7DFJC7cWw9kc3EICSxllJg/9wdYQkigj0ni2Q+wBjYBQ4mu t11AcQ4OEQFvieXXFEHqmQXOskgs7J7HDBIXFnCTWDDBHqScRUBV4sL8NYwgNq+Ah8SF/a1M ELvkJP6/XAFmcwp4SjT/mwG1ykPi1IMutgmMvAsYGVYxiqaWJhcUJ6XnGukVJ+YWl+al6yXn 525ihAT61x2MS49ZHWIU4GBU4uE94bw3RIg1say4MvcQowQHs5II71nzfSFCvCmJlVWpRfnx RaU5qcWHGJk4OKUaGPU/O348IF3ltfhOq9iV8Bzxnbq+vBtFEvgsnmW/DEw5NmcXx8TmU15S uv8z5nzX5jx00zCg+nqLCBd3x6Z3PUYeV289nhHJJffs2tWlf4+LdLGF+13c9tXvnkNI7C7r ky8m8Z1U+8pw6P519qm/+61Up+7cxMWx41GFu6HGiYCFFzYpzDM8X6TEUpyRaKjFXFScCADV rzLrUgIAAA== 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);