All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Kukjin Kim <kgene@kernel.org>, Inki Dae <inki.dae@samsung.com>,
	Tobias Jakobi <Liquid.Acid@gmx.net>,
	Daniel Drake <drake@endlessm.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Pankaj Dubey <pankaj.dubey@samsung.com>,
	Amit Daniel Kachhap <amit.daniel@samsung.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains
Date: Wed, 03 Dec 2014 13:33:44 +0100	[thread overview]
Message-ID: <1417610024-29748-1-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: <1416814256-24288-3-git-send-email-a.hajda@samsung.com>

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 <m.szyprowski@samsung.com>
---
 Documentation/devicetree/bindings/arm/exynos/power_domain.txt |  2 ++
 arch/arm/mach-exynos/pm_domains.c                             | 11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
index abde1ea8a119..b884358ebb1a 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.
+- samsung,power-domain: 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 20f267121b3e..fa9a47ddad81 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,15 @@ 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, "samsung,power-domain", 0);
+		if (!master_np)
+			master_np = of_parse_phandle(np, "power-domains", 0);
+		if (master_np) {
+			pm_genpd_add_subdomain_names(master_np->name, np->name);
+			of_node_put(master_np);
+		}
 	}
 
 	return 0;
-- 
1.9.2


WARNING: multiple messages have this Message-ID (diff)
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains
Date: Wed, 03 Dec 2014 13:33:44 +0100	[thread overview]
Message-ID: <1417610024-29748-1-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: <1416814256-24288-3-git-send-email-a.hajda@samsung.com>

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 <m.szyprowski@samsung.com>
---
 Documentation/devicetree/bindings/arm/exynos/power_domain.txt |  2 ++
 arch/arm/mach-exynos/pm_domains.c                             | 11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
index abde1ea8a119..b884358ebb1a 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.
+- samsung,power-domain: 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 20f267121b3e..fa9a47ddad81 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,15 @@ 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, "samsung,power-domain", 0);
+		if (!master_np)
+			master_np = of_parse_phandle(np, "power-domains", 0);
+		if (master_np) {
+			pm_genpd_add_subdomain_names(master_np->name, np->name);
+			of_node_put(master_np);
+		}
 	}
 
 	return 0;
-- 
1.9.2

  parent reply	other threads:[~2014-12-03 12:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24  7:30 [PATCH RESEND 0/7] Enable HDMI support on Exynos platforms Andrzej Hajda
2014-11-24  7:30 ` [PATCH RESEND 1/7] clk: samsung: exynos4: set parent of sclk_hdmiphy to hdmi Andrzej Hajda
2014-11-24 10:42   ` Sylwester Nawrocki
2014-11-24  7:30 ` [PATCH RESEND 2/7] ARM: Exynos: add support for sub-power domains Andrzej Hajda
2014-11-26 10:30   ` [RESEND,2/7] " Pankaj Dubey
2014-12-03 12:33   ` Marek Szyprowski [this message]
2014-12-03 12:33     ` [PATCH v2 2/7] " Marek Szyprowski
2014-12-03 12:36     ` Geert Uytterhoeven
2014-12-03 12:36       ` Geert Uytterhoeven
2014-12-03 12:36       ` Geert Uytterhoeven
2014-12-03 12:47       ` Marek Szyprowski
2014-12-03 12:47         ` Marek Szyprowski
2014-12-03 12:47         ` Marek Szyprowski
2014-12-03 19:57         ` Kevin Hilman
2014-12-03 19:57           ` Kevin Hilman
2014-12-03 19:57           ` Kevin Hilman
2014-12-04  3:45     ` amit daniel kachhap
2014-12-04  3:45       ` amit daniel kachhap
2014-12-04  3:45       ` amit daniel kachhap
2015-01-02 10:20       ` Marek Szyprowski
2015-01-02 10:20         ` Marek Szyprowski
2015-01-02 10:20         ` Marek Szyprowski
2014-11-24  7:30 ` [PATCH RESEND 3/7] ARM: dts: exynos4: add hdmi related nodes Andrzej Hajda
2014-11-24  7:30 ` [PATCH RESEND 4/7] ARM: dts: exynos4: add dependency between TV and LCD0 power domains Andrzej Hajda
2014-12-03 12:34   ` [PATCH v2 " Marek Szyprowski
2014-12-03 12:34     ` Marek Szyprowski
2014-11-24  7:30 ` [PATCH RESEND 5/7] ARM: dts: exynos4412-odroid: enable hdmi support Andrzej Hajda
2014-11-24  7:36 ` [PATCH RESEND 6/7] ARM: dts: exynos4210-universal_c210: " Andrzej Hajda
2014-11-24  7:36 ` [PATCH RESEND 7/7] ARM: dts: exynos5250: add display power domain Andrzej Hajda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1417610024-29748-1-git-send-email-m.szyprowski@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=Liquid.Acid@gmx.net \
    --cc=a.hajda@samsung.com \
    --cc=amit.daniel@samsung.com \
    --cc=drake@endlessm.com \
    --cc=geert@linux-m68k.org \
    --cc=inki.dae@samsung.com \
    --cc=kgene@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=pankaj.dubey@samsung.com \
    --cc=tomasz.figa@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.