All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <snjw23@gmail.com>
To: Thomas Abraham <thomas.abraham@linaro.org>
Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org,
	rjw@sisk.pl, linux-arm-kernel@lists.infradead.org,
	devicetree-discuss@lists.ozlabs.org, rob.herring@calxeda.com,
	grant.likely@secretlab.ca, kgene.kim@samsung.com,
	broonie@opensource.wolfsonmicro.com, patches@linaro.org
Subject: Re: [PATCH 2/2] ARM: Exynos: Hook up power domains to generic power domain infrastructure
Date: Wed, 28 Dec 2011 19:58:11 +0100	[thread overview]
Message-ID: <4EFB66C3.4040504@gmail.com> (raw)
In-Reply-To: <1323704789-23923-3-git-send-email-thomas.abraham@linaro.org>

Hi Thomas,

On 12/12/2011 04:46 PM, Thomas Abraham wrote:
> The generic power domain infrastructure is used to control the power domains
> available on Exynos4. For non-dt platforms, the power domains are statically
> instantiated. For dt platforms, the power domain nodes found in the device
> tree are instantiated.
> 
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> This patch is mainly derived from Mark Brown's work on generic power domain
> support for s3c64xx platforms. The existing exynos4 power domain implementation
> is not removed in this patch. The devices are not yet registered with the power
> domains for non-dt platforms.
> 
>  arch/arm/mach-exynos/Kconfig |    1 +
>  arch/arm/mach-exynos/pm.c    |  179 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 180 insertions(+), 0 deletions(-)
> 
[...]
> +
> +static struct exynos4_pm_domain exynos4_pd_gps = {
> +	.base = (void __iomem *)S5P_PMU_GPS_CONF,
> +	.name = "pd-gps",
> +	.pd = {
> +		.power_off = exynos4_pd_power_off,
> +		.power_on = exynos4_pd_power_on,
> +	},
> +};
> +
> +static struct exynos4_pm_domain *exynos4_pm_domains[] = {
> +	&exynos4_pd_mfc,
> +	&exynos4_pd_g3d,
> +	&exynos4_pd_lcd0,
> +	&exynos4_pd_lcd1,
> +	&exynos4_pd_tv,
> +	&exynos4_pd_cam,
> +	&exynos4_pd_gps,
> +};
> +
> +static __init void exynos4_pm_init_power_domain(void)
> +{
> +	int idx;
> +	struct device_node *np;
> +
> +#ifdef CONFIG_OF
> +	if (!of_have_populated_dt())
> +		goto no_dt;
> +
> +	for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
> +		struct exynos4_pm_domain *pd;
> +
> +		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> +		if (!pd) {
> +			pr_err("exynos4_pm_init_power_domain: memalloc "
> +					"failed\n");
> +			return;
> +		}
> +
> +		if (of_get_property(np, "samsung,exynos4210-pd-off", NULL))
> +			pd->is_off = true;
> +		pd->name = np->name;
> +		pd->base = of_iomap(np, 0);

Sorry, I haven't reviewed your patch carefully enough. So for dt platforms
pd->base is initialized from "reg" property, directly from each power domain's
DT node. Only the static power domain instantiation for non-dt platforms would
possibly need some code modifications when new SoCs are added.

Would be nice to have a relevant patch for *.dts files in this series too. :)

> +		pd->pd.power_off = exynos4_pd_power_off;
> +		pd->pd.power_on = exynos4_pd_power_on;
> +		pd->pd.of_node = np;
> +		pm_genpd_init(&pd->pd, NULL, false);
> +	}
> +	return;
> +#endif /* CONFIG_OF */
> +
> +no_dt:
> +	for (idx = 0; idx < ARRAY_SIZE(exynos4_pm_domains); idx++)
> +		pm_genpd_init(&exynos4_pm_domains[idx]->pd, NULL,
> +				exynos4_pm_domains[idx]->is_off);
> +}

--
Thanks,
Sylwester

WARNING: multiple messages have this Message-ID (diff)
From: snjw23@gmail.com (Sylwester Nawrocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: Exynos: Hook up power domains to generic power domain infrastructure
Date: Wed, 28 Dec 2011 19:58:11 +0100	[thread overview]
Message-ID: <4EFB66C3.4040504@gmail.com> (raw)
In-Reply-To: <1323704789-23923-3-git-send-email-thomas.abraham@linaro.org>

Hi Thomas,

On 12/12/2011 04:46 PM, Thomas Abraham wrote:
> The generic power domain infrastructure is used to control the power domains
> available on Exynos4. For non-dt platforms, the power domains are statically
> instantiated. For dt platforms, the power domain nodes found in the device
> tree are instantiated.
> 
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> This patch is mainly derived from Mark Brown's work on generic power domain
> support for s3c64xx platforms. The existing exynos4 power domain implementation
> is not removed in this patch. The devices are not yet registered with the power
> domains for non-dt platforms.
> 
>  arch/arm/mach-exynos/Kconfig |    1 +
>  arch/arm/mach-exynos/pm.c    |  179 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 180 insertions(+), 0 deletions(-)
> 
[...]
> +
> +static struct exynos4_pm_domain exynos4_pd_gps = {
> +	.base = (void __iomem *)S5P_PMU_GPS_CONF,
> +	.name = "pd-gps",
> +	.pd = {
> +		.power_off = exynos4_pd_power_off,
> +		.power_on = exynos4_pd_power_on,
> +	},
> +};
> +
> +static struct exynos4_pm_domain *exynos4_pm_domains[] = {
> +	&exynos4_pd_mfc,
> +	&exynos4_pd_g3d,
> +	&exynos4_pd_lcd0,
> +	&exynos4_pd_lcd1,
> +	&exynos4_pd_tv,
> +	&exynos4_pd_cam,
> +	&exynos4_pd_gps,
> +};
> +
> +static __init void exynos4_pm_init_power_domain(void)
> +{
> +	int idx;
> +	struct device_node *np;
> +
> +#ifdef CONFIG_OF
> +	if (!of_have_populated_dt())
> +		goto no_dt;
> +
> +	for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
> +		struct exynos4_pm_domain *pd;
> +
> +		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> +		if (!pd) {
> +			pr_err("exynos4_pm_init_power_domain: memalloc "
> +					"failed\n");
> +			return;
> +		}
> +
> +		if (of_get_property(np, "samsung,exynos4210-pd-off", NULL))
> +			pd->is_off = true;
> +		pd->name = np->name;
> +		pd->base = of_iomap(np, 0);

Sorry, I haven't reviewed your patch carefully enough. So for dt platforms
pd->base is initialized from "reg" property, directly from each power domain's
DT node. Only the static power domain instantiation for non-dt platforms would
possibly need some code modifications when new SoCs are added.

Would be nice to have a relevant patch for *.dts files in this series too. :)

> +		pd->pd.power_off = exynos4_pd_power_off;
> +		pd->pd.power_on = exynos4_pd_power_on;
> +		pd->pd.of_node = np;
> +		pm_genpd_init(&pd->pd, NULL, false);
> +	}
> +	return;
> +#endif /* CONFIG_OF */
> +
> +no_dt:
> +	for (idx = 0; idx < ARRAY_SIZE(exynos4_pm_domains); idx++)
> +		pm_genpd_init(&exynos4_pm_domains[idx]->pd, NULL,
> +				exynos4_pm_domains[idx]->is_off);
> +}

--
Thanks,
Sylwester

  parent reply	other threads:[~2011-12-28 18:58 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 15:46 [PATCH 0/2] ARM: Exynos: Adapt to generic power domain Thomas Abraham
2011-12-12 15:46 ` Thomas Abraham
2011-12-12 15:46 ` [PATCH 1/2] PM / Domains: Add OF support Thomas Abraham
2011-12-12 15:46   ` Thomas Abraham
2011-12-12 15:46   ` [PATCH 2/2] ARM: Exynos: Hook up power domains to generic power domain infrastructure Thomas Abraham
2011-12-12 15:46     ` Thomas Abraham
2011-12-26 19:06     ` Mark Brown
2011-12-26 19:06       ` Mark Brown
2011-12-27 22:16       ` Sylwester Nawrocki
2011-12-27 22:16         ` Sylwester Nawrocki
2011-12-27 23:14     ` Sylwester Nawrocki
2011-12-27 23:14       ` Sylwester Nawrocki
2011-12-28  5:25       ` Thomas Abraham
2011-12-28  5:25         ` Thomas Abraham
2011-12-28 11:09         ` Sylwester Nawrocki
2011-12-28 11:09           ` Sylwester Nawrocki
2011-12-28 18:58     ` Sylwester Nawrocki [this message]
2011-12-28 18:58       ` Sylwester Nawrocki
2012-01-02  2:14       ` Thomas Abraham
2012-01-02  2:14         ` Thomas Abraham
2012-01-02 22:19         ` Sylwester Nawrocki
2012-01-02 22:19           ` Sylwester Nawrocki
     [not found]           ` <4F022D7D.3060802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-03  8:23             ` Thomas Abraham
2012-01-03  8:23               ` Thomas Abraham
2012-01-04  7:00               ` Grant Likely
2012-01-04  7:00                 ` Grant Likely
2012-01-04  7:29                 ` Kukjin Kim
2012-01-04  7:29                   ` Kukjin Kim
2011-12-26 11:29   ` [PATCH 1/2] PM / Domains: Add OF support Mark Brown
2011-12-26 11:29     ` Mark Brown
2011-12-26 19:13   ` Rafael J. Wysocki
2011-12-26 19:13     ` Rafael J. Wysocki
2011-12-26 19:24     ` Mark Brown
2011-12-26 19:24       ` Mark Brown
2011-12-26 20:44       ` Rafael J. Wysocki
2011-12-26 20:44         ` Rafael J. Wysocki
2011-12-28  5:10         ` Thomas Abraham
2011-12-28  5:10           ` Thomas Abraham
2011-12-28 22:17           ` Rafael J. Wysocki
2011-12-28 22:17             ` Rafael J. Wysocki
2012-01-02  3:47             ` Thomas Abraham
2012-01-02  3:47               ` Thomas Abraham
2012-01-03 22:30               ` Rafael J. Wysocki
2012-01-03 22:30                 ` Rafael J. Wysocki
2012-01-05 15:42                 ` Thomas Abraham
2012-01-05 15:42                   ` Thomas Abraham
2012-01-02  6:59     ` Grant Likely
2012-01-02  6:59       ` Grant Likely
2012-01-03 22:28       ` Rafael J. Wysocki
2012-01-03 22:28         ` Rafael J. Wysocki

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=4EFB66C3.4040504@gmail.com \
    --to=snjw23@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rjw@sisk.pl \
    --cc=rob.herring@calxeda.com \
    --cc=thomas.abraham@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.