* [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains [not found] <1416814256-24288-3-git-send-email-a.hajda@samsung.com> @ 2014-12-03 12:33 ` Marek Szyprowski 2014-12-03 12:36 ` Geert Uytterhoeven 2014-12-04 3:45 ` amit daniel kachhap 0 siblings, 2 replies; 6+ messages in thread From: Marek Szyprowski @ 2014-12-03 12:33 UTC (permalink / raw) To: linux-kernel, linux-arm-kernel, linux-samsung-soc Cc: Marek Szyprowski, Kukjin Kim, Inki Dae, Tobias Jakobi, Daniel Drake, Andrzej Hajda, Tomasz Figa, Pankaj Dubey, Amit Daniel Kachhap, Geert Uytterhoeven, Ulf Hansson 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains 2014-12-03 12:33 ` [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains Marek Szyprowski @ 2014-12-03 12:36 ` Geert Uytterhoeven 2014-12-03 12:47 ` Marek Szyprowski 2014-12-04 3:45 ` amit daniel kachhap 1 sibling, 1 reply; 6+ messages in thread From: Geert Uytterhoeven @ 2014-12-03 12:36 UTC (permalink / raw) To: Marek Szyprowski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kukjin Kim, Inki Dae, Tobias Jakobi, Daniel Drake, Andrzej Hajda, Tomasz Figa, Pankaj Dubey, Amit Daniel Kachhap, Ulf Hansson Hi Marek, On Wed, Dec 3, 2014 at 1:33 PM, Marek Szyprowski <m.szyprowski@samsung.com> wrote: > 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 For new DTSes I'd recommend using the generic "power-domains" only. Or do you already have a DTS where tv-power-domain@10023C20 uses "samsung,power-domain" in the wild? > 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); > + } -- Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains 2014-12-03 12:36 ` Geert Uytterhoeven @ 2014-12-03 12:47 ` Marek Szyprowski 2014-12-03 19:57 ` Kevin Hilman 0 siblings, 1 reply; 6+ messages in thread From: Marek Szyprowski @ 2014-12-03 12:47 UTC (permalink / raw) To: Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kukjin Kim, Inki Dae, Tobias Jakobi, Daniel Drake, Andrzej Hajda, Tomasz Figa, Pankaj Dubey, Amit Daniel Kachhap, Ulf Hansson Hello, On 2014-12-03 13:36, Geert Uytterhoeven wrote: > Hi Marek, > > On Wed, Dec 3, 2014 at 1:33 PM, Marek Szyprowski > <m.szyprowski@samsung.com> wrote: >> 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 > For new DTSes I'd recommend using the generic "power-domains" only. I think that some consistency in dts style will be really an added value. In my opinion for all existing DTSes we should keep using 'samsung,power-domain' (even for defining a parent power domains) and for all new DTSes, the generic 'power-domains' binding should be used. > Or do you already have a DTS where tv-power-domain@10023C20 uses > "samsung,power-domain" in the wild? Not yet. We only used in private repositories, which can be changed. > >> 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); >> + } >> Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains 2014-12-03 12:47 ` Marek Szyprowski @ 2014-12-03 19:57 ` Kevin Hilman 0 siblings, 0 replies; 6+ messages in thread From: Kevin Hilman @ 2014-12-03 19:57 UTC (permalink / raw) To: Marek Szyprowski Cc: Geert Uytterhoeven, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kukjin Kim, Inki Dae, Tobias Jakobi, Daniel Drake, Andrzej Hajda, Tomasz Figa, Pankaj Dubey, Amit Daniel Kachhap, Ulf Hansson Marek Szyprowski <m.szyprowski@samsung.com> writes: > Hello, > > On 2014-12-03 13:36, Geert Uytterhoeven wrote: >> Hi Marek, >> >> On Wed, Dec 3, 2014 at 1:33 PM, Marek Szyprowski >> <m.szyprowski@samsung.com> wrote: >>> 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 >> For new DTSes I'd recommend using the generic "power-domains" only. > > I think that some consistency in dts style will be really an added > value. In my opinion for > all existing DTSes we should keep using 'samsung,power-domain' (even > for defining a parent > power domains) and for all new DTSes, the generic 'power-domains' > binding should be used. Or even better, convert the existing DTSs to use generic power-domain first, and then use generic ones going forward also. Kevin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains 2014-12-03 12:33 ` [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains Marek Szyprowski 2014-12-03 12:36 ` Geert Uytterhoeven @ 2014-12-04 3:45 ` amit daniel kachhap 2015-01-02 10:20 ` Marek Szyprowski 1 sibling, 1 reply; 6+ messages in thread From: amit daniel kachhap @ 2014-12-04 3:45 UTC (permalink / raw) To: Marek Szyprowski, Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, LAK, linux-samsung-soc@vger.kernel.org, Kukjin Kim, Inki Dae, Tobias Jakobi, Daniel Drake, Andrzej Hajda, Tomasz Figa, Pankaj Dubey, Ulf Hansson On Wed, Dec 3, 2014 at 6:03 PM, Marek Szyprowski <m.szyprowski@samsung.com> wrote: > 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); > + } > } Hi Marek, In the my patch series posted earlier i added this feature in a slightly different way. (https://lkml.org/lkml/2014/11/24/320) Parent PD's are not added in the same loop but in the second loop. This will make sure that the parents PD are registered before the child PD's and we can get away from the assumption of child/parent PD's position in the Device Tree. This is a still a work in progress. Also posted a patch earlier regarding this, http://www.spinics.net/lists/linux-samsung-soc/msg39836.html. Regards, Amit > > return 0; > -- > 1.9.2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains 2014-12-04 3:45 ` amit daniel kachhap @ 2015-01-02 10:20 ` Marek Szyprowski 0 siblings, 0 replies; 6+ messages in thread From: Marek Szyprowski @ 2015-01-02 10:20 UTC (permalink / raw) To: amit daniel kachhap, Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, LAK, linux-samsung-soc@vger.kernel.org, Kukjin Kim, Inki Dae, Tobias Jakobi, Daniel Drake, Andrzej Hajda, Tomasz Figa, Pankaj Dubey, Ulf Hansson Hello, On 2014-12-04 04:45, amit daniel kachhap wrote: > On Wed, Dec 3, 2014 at 6:03 PM, Marek Szyprowski > <m.szyprowski@samsung.com> wrote: >> 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); >> + } >> } > Hi Marek, > > In the my patch series posted earlier i added this feature in a > slightly different way. (https://lkml.org/lkml/2014/11/24/320) > Parent PD's are not added in the same loop but in the second loop. > This will make sure that the parents PD are registered before the > child PD's and we can get away from the assumption of child/parent > PD's position in the Device Tree. This is a still a work in progress. > Also posted a patch earlier regarding this, > http://www.spinics.net/lists/linux-samsung-soc/msg39836.html. Right, your approach seems to be more error prone. Do you plan to resend your patch with the parent domain phandle renamed to generic 'power-domains' property, like Geert suggested? I would like to send Exynos4 HDMI patches based on top of your work and have them finally merged (they are waiting since v3.17...) Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-01-02 10:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1416814256-24288-3-git-send-email-a.hajda@samsung.com>
2014-12-03 12:33 ` [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains Marek Szyprowski
2014-12-03 12:36 ` Geert Uytterhoeven
2014-12-03 12:47 ` Marek Szyprowski
2014-12-03 19:57 ` Kevin Hilman
2014-12-04 3:45 ` amit daniel kachhap
2015-01-02 10:20 ` Marek Szyprowski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox