From patchwork Thu Nov 13 16:23:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 40781 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B728924493 for ; Thu, 13 Nov 2014 16:24:03 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gq15sf9297316lab.10 for ; Thu, 13 Nov 2014 08:24:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ZOy864qU4lYWyyIaOa+uCgkpCOApnW65Jl9UEdR/mMs=; b=PZxwMF0H0ICLdzelHykvOJXPtrZRnuAn3y2u4poBO2k9rrl8hNUGNBXMRDMKc2bFs6 JjFHRgCVgk/nhhfo8FH1KKhmEMVuiPpLfOhjdD8jvgRmyhcrYtOqwFtYHtwskOrFISZA eJmRQnhHqskKGsBLxzKORbq/5MPaE9naNSDC9FPh7AL3y9bi6LLcWTYTgQBkAe2MqNFl AuE9lnpwwcHfRQ6oPgCcklbRKMR1uu4ojKGmBV/QjBrTPBhJe03RSb/geBKaQYEdu8FG d0/ARFjJDYwY+eJwMCQi8AgDVvbFM0aha65vA1ptHvoCPlWCBUn40bl28VKK7+cg8kVp k1+w== X-Gm-Message-State: ALoCoQnpdWChAAp35pTo8xZ5tBEQDU4jtFvN8wxwMcuH4bCIHSXOZuM5bNwYXHLW9VIol/UfU7K2 X-Received: by 10.112.50.243 with SMTP id f19mr5932202lbo.1.1415895842791; Thu, 13 Nov 2014 08:24:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.146 with SMTP id ay18ls451255lab.51.gmail; Thu, 13 Nov 2014 08:24:02 -0800 (PST) X-Received: by 10.153.11.5 with SMTP id ee5mr3294635lad.55.1415895842114; Thu, 13 Nov 2014 08:24:02 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id x6si38949510lbo.81.2014.11.13.08.24.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 08:24:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so12425166lbj.23 for ; Thu, 13 Nov 2014 08:24:02 -0800 (PST) X-Received: by 10.112.12.35 with SMTP id v3mr3336635lbb.80.1415895842037; Thu, 13 Nov 2014 08:24:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp616667lbc; Thu, 13 Nov 2014 08:24:00 -0800 (PST) X-Received: by 10.70.93.104 with SMTP id ct8mr3853536pdb.72.1415895839963; Thu, 13 Nov 2014 08:23:59 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10si3459270pdp.168.2014.11.13.08.23.59 for ; Thu, 13 Nov 2014 08:23:59 -0800 (PST) Received-SPF: none (google.com: linux-samsung-soc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933481AbaKMQX5 (ORCPT + 4 others); Thu, 13 Nov 2014 11:23:57 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:17814 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933311AbaKMQXz (ORCPT ); Thu, 13 Nov 2014 11:23:55 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) 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 <0NEZ005PMKCH8R80@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 13 Nov 2014 16:26:41 +0000 (GMT) X-AuditID: cbfec7f5-b7f956d000005ed7-64-5464db1aa771 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 5A.62.24279.A1BD4645; Thu, 13 Nov 2014 16:23:54 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NEZ005DIK6TSE20@eusync3.samsung.com>; Thu, 13 Nov 2014 16:23:54 +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 Subject: [PATCH 2/7] ARM: Exynos: add support for sub-power domains Date: Thu, 13 Nov 2014 17:23:00 +0100 Message-id: <1415895785-26892-3-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415895785-26892-1-git-send-email-a.hajda@samsung.com> References: <1415895785-26892-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMJMWRmVeSWpSXmKPExsVy+t/xq7pSt1NCDJbcZrJ4NP8xs8Wk+xNY LHoXXGWzmHF+H5NF18+fbBZrj9xlt1i16w+jA7vHou9ZHjtn3WX3WLxpP5tH35ZVjB6fN8kF sEZx2aSk5mSWpRbp2yVwZUzYMJ2p4KRgxYL9T9kaGM/wdTFyckgImEgsvHGODcIWk7hwbz2Q zcUhJLCUUaKppZkRJCEk0MckMbU1CcRmE9CU+Lv5JliDiICqxOe2BewgDcwCzxkltn5dzgSS EBZwlji1aRoziM0CVDT96gx2EJsXKP7rzE9GiG1yEiePTWbtYuTg4BRwkdhxWR/EFAIq+fBZ dwIj7wJGhlWMoqmlyQXFSem5RnrFibnFpXnpesn5uZsYIQH1dQfj0mNWhxgFOBiVeHg/cKeE CLEmlhVX5h5ilOBgVhLh9T4MFOJNSaysSi3Kjy8qzUktPsTIxMEp1cC42nNiH6f07BvTXELF M+vFTudpS+roR+zmjTiqeKYyo6vDdjOznPIx6ZBvK5LVVpjcY9uxn+uG9K26kw+K0xesOfZh zaotAUoy4osLy777K5/+ujxL1UguL6Kw/JTB0cp9nPGxngeue3VU6Jku/nuvNC+4hlecbWV1 n9eePTwVj0xDmvQl6pVYijMSDbWYi4oTAWxtkjwGAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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;