devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Thomas Abraham <thomas.abraham@linaro.org>
Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org,
	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, kyungmin.park@samsung.com,
	s.nawrocki@samsung.com, patches@linaro.org
Subject: Re: [PATCH v2 1/2] PM / Domains: Add OF support
Date: Sun, 8 Jan 2012 22:23:18 +0100	[thread overview]
Message-ID: <201201082223.18603.rjw@sisk.pl> (raw)
In-Reply-To: <1325931055-14486-2-git-send-email-thomas.abraham@linaro.org>

On Saturday, January 07, 2012, Thomas Abraham wrote:
> A device node pointer is added to generic pm domain structure to associate
> the domain with a node in the device tree. The platform code parses the
> device tree to find available nodes representing the generic power domain,
> instantiates the available domains and initializes them by calling
> pm_genpd_init().
> 
> Nodes representing the devices include a phandle of the power domain to
> which it belongs. As these devices get instantiated, the driver code
> checkes for availability of a power domain phandle, converts the phandle
> to a device node and uses the new pm_genpd_of_add_device() api to
> associate the device with a power domain.
> 
> pm_genpd_of_add_device() runs through its list of registered power domains
> and matches the OF node of the domain with the one specified as the
> parameter. If a match is found, the device is associated with the matched
> domain.
> 
> Cc: Rafael J. Wysocki <rjw@sisk.pl>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>

I can take this patch for 3.4, but your [2/2] depends on it, so I'm not
sure how to handle that.  If you want me to take the other patch too,
it'll need ACKs from the Exynos maintaniers.

Thanks,
Rafael


> ---
>  drivers/base/power/domain.c |   32 ++++++++++++++++++++++++++++++++
>  include/linux/pm_domain.h   |   12 ++++++++++++
>  2 files changed, 44 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 92e6a90..9ee1f7b 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1171,6 +1171,38 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
>  }
>  
>  /**
> + * __pm_genpd_of_add_device - Add a device to an I/O PM domain.
> + * @genpd_node: Device tree node pointer representing a PM domain to which the
> + *   the device is added to.
> + * @dev: Device to be added.
> + * @td: Set of PM QoS timing parameters to attach to the device.
> + */
> +int __pm_genpd_of_add_device(struct device_node *genpd_node, struct device *dev,
> +			     struct gpd_timing_data *td)
> +{
> +	struct generic_pm_domain *genpd = NULL, *gpd;
> +
> +	dev_dbg(dev, "%s()\n", __func__);
> +
> +	if (IS_ERR_OR_NULL(genpd_node) || IS_ERR_OR_NULL(dev))
> +		return -EINVAL;
> +
> +	mutex_lock(&gpd_list_lock);
> +	list_for_each_entry(gpd, &gpd_list, gpd_list_node) {
> +		if (gpd->of_node == genpd_node) {
> +			genpd = gpd;
> +			break;
> +		}
> +	}
> +	mutex_unlock(&gpd_list_lock);
> +
> +	if (!genpd)
> +		return -EINVAL;
> +
> +	return __pm_genpd_add_device(genpd, dev, td);
> +}
> +
> +/**
>   * pm_genpd_remove_device - Remove a device from an I/O PM domain.
>   * @genpd: PM domain to remove the device from.
>   * @dev: Device to be removed.
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index a03a0ad..e3ff875 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -11,6 +11,7 @@
>  
>  #include <linux/device.h>
>  #include <linux/err.h>
> +#include <linux/of.h>
>  
>  enum gpd_status {
>  	GPD_STATE_ACTIVE = 0,	/* PM domain is active */
> @@ -70,6 +71,7 @@ struct generic_pm_domain {
>  	s64 break_even_ns;	/* Power break even for the entire domain. */
>  	s64 max_off_time_ns;	/* Maximum allowed "suspended" time. */
>  	ktime_t power_off_time;
> +	struct device_node *of_node; /* Node in device tree */
>  };
>  
>  static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
> @@ -117,12 +119,22 @@ extern int __pm_genpd_add_device(struct generic_pm_domain *genpd,
>  				 struct device *dev,
>  				 struct gpd_timing_data *td);
>  
> +extern int __pm_genpd_of_add_device(struct device_node *genpd_node,
> +				    struct device *dev,
> +				    struct gpd_timing_data *td);
> +
>  static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
>  				      struct device *dev)
>  {
>  	return __pm_genpd_add_device(genpd, dev, NULL);
>  }
>  
> +static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
> +					 struct device *dev)
> +{
> +	return __pm_genpd_of_add_device(genpd_node, dev, NULL);
> +}
> +
>  extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
>  				  struct device *dev);
>  extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
> 

  reply	other threads:[~2012-01-08 21:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-07 10:10 [PATCH v2 0/2] ARM: Exynos: Adapt to generic power domain Thomas Abraham
2012-01-07 10:10 ` [PATCH v2 1/2] PM / Domains: Add OF support Thomas Abraham
2012-01-08 21:23   ` Rafael J. Wysocki [this message]
2012-01-09 13:11     ` Thomas Abraham
2012-01-17  7:22     ` Kukjin Kim
2012-01-17 20:45       ` Rafael J. Wysocki
2012-01-31  5:53         ` Kukjin Kim
2012-02-01 21:32           ` Rafael J. Wysocki
2012-01-07 10:10 ` [PATCH v2 2/2] ARM: Exynos: Hook up power domains to generic power domain infrastructure Thomas Abraham
2012-01-07 14:44   ` Sylwester Nawrocki
2012-01-09 13:19     ` Thomas Abraham
2012-01-09  0:27   ` Kyungmin Park
2012-01-09 13:23     ` Thomas Abraham

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=201201082223.18603.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@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=rob.herring@calxeda.com \
    --cc=s.nawrocki@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).