Merge branch 'pm-domains'

* pm-domains: (32 commits)
  PM / Domains: Rename cpu_data to cpuidle_data
  PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h
  PM / Domains: Remove legacy API for adding devices through DT
  PM / Domains: Add genpd attach/detach callbacks
  PM / Domains: add debugfs listing of struct generic_pm_domain-s
  ACPI / PM: Convert acpi_dev_pm_detach() into a static function
  ARM: exynos: Move to generic PM domain DT bindings
  amba: Add support for attach/detach of PM domains
  spi: core: Convert to dev_pm_domain_attach|detach()
  mmc: sdio: Convert to dev_pm_domain_attach|detach()
  i2c: core: Convert to dev_pm_domain_attach|detach()
  drivercore / platform: Convert to dev_pm_domain_attach|detach()
  PM / Domains: Add APIs to attach/detach a PM domain for a device
  PM / Domains: Add generic OF-based PM domain look-up
  ACPI / PM: Assign the ->detach() callback when attaching the PM domain
  PM / Domains: Add a detach callback to the struct dev_pm_domain
  PM / domains: Spelling s/domian/domain/
  PM / domains: Keep declaration of dev_power_governors together
  PM / domains: Remove default_stop_ok() API
  drivers: sh: Leave disabling of unused PM domains to genpd
  ...
Cette révision appartient à :
Rafael J. Wysocki
2014-10-07 01:18:12 +02:00
révision 49a09c9ab0
33 fichiers modifiés avec 771 ajouts et 605 suppressions

Voir le fichier

@@ -11,6 +11,8 @@
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/pm_clock.h>
#include <linux/acpi.h>
#include <linux/pm_domain.h>
/**
* dev_pm_get_subsys_data - Create or refcount power.subsys_data for device.
@@ -82,3 +84,53 @@ int dev_pm_put_subsys_data(struct device *dev)
return ret;
}
EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data);
/**
* dev_pm_domain_attach - Attach a device to its PM domain.
* @dev: Device to attach.
* @power_on: Used to indicate whether we should power on the device.
*
* The @dev may only be attached to a single PM domain. By iterating through
* the available alternatives we try to find a valid PM domain for the device.
* As attachment succeeds, the ->detach() callback in the struct dev_pm_domain
* should be assigned by the corresponding attach function.
*
* This function should typically be invoked from subsystem level code during
* the probe phase. Especially for those that holds devices which requires
* power management through PM domains.
*
* Callers must ensure proper synchronization of this function with power
* management callbacks.
*
* Returns 0 on successfully attached PM domain or negative error code.
*/
int dev_pm_domain_attach(struct device *dev, bool power_on)
{
int ret;
ret = acpi_dev_pm_attach(dev, power_on);
if (ret)
ret = genpd_dev_pm_attach(dev);
return ret;
}
EXPORT_SYMBOL_GPL(dev_pm_domain_attach);
/**
* dev_pm_domain_detach - Detach a device from its PM domain.
* @dev: Device to attach.
* @power_off: Used to indicate whether we should power off the device.
*
* This functions will reverse the actions from dev_pm_domain_attach() and thus
* try to detach the @dev from its PM domain. Typically it should be invoked
* from subsystem level code during the remove phase.
*
* Callers must ensure proper synchronization of this function with power
* management callbacks.
*/
void dev_pm_domain_detach(struct device *dev, bool power_off)
{
if (dev->pm_domain && dev->pm_domain->detach)
dev->pm_domain->detach(dev, power_off);
}
EXPORT_SYMBOL_GPL(dev_pm_domain_detach);

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@@ -42,7 +42,7 @@ static int dev_update_qos_constraint(struct device *dev, void *data)
* default_stop_ok - Default PM domain governor routine for stopping devices.
* @dev: Device to check.
*/
bool default_stop_ok(struct device *dev)
static bool default_stop_ok(struct device *dev)
{
struct gpd_timing_data *td = &dev_gpd_data(dev)->td;
unsigned long flags;
@@ -229,10 +229,7 @@ static bool always_on_power_down_ok(struct dev_pm_domain *domain)
#else /* !CONFIG_PM_RUNTIME */
bool default_stop_ok(struct device *dev)
{
return false;
}
static inline bool default_stop_ok(struct device *dev) { return false; }
#define default_power_down_ok NULL
#define always_on_power_down_ok NULL