Message ID | 1416814256-24288-3-git-send-email-a.hajda@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
+CC: Amit Daniel Kachhap Hi Andrzej, On Monday 24 November 2014 01:00 PM, Andrzej Hajda wrote: > From: Marek Szyprowski <m.szyprowski@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> > Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> > > --- > 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 > If you are trying to make parent, child relationship using this, please have a look to following thread [1] where Amit also trying to make such attempt and some discussion are happening on this thread, so that we can come up with single approach for all such needs. [1]: https://patchwork.kernel.org/patch/5366171/ Thanks, Pankaj Dubey > 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; > -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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;