Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba1389d7 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-domains' into for-linus

* pm-domains: (33 commits)
  ARM / shmobile: Return -EBUSY from A4LC power off if A3RV is active
  PM / Domains: Take .power_off() error code into account
  ARM / shmobile: Use genpd_queue_power_off_work()
  ARM / shmobile: Use pm_genpd_poweroff_unused()
  PM / Domains: Introduce function to power off all unused PM domains
  PM / Domains: Queue up power off work only if it is not pending
  PM / Domains: Improve handling of wakeup devices during system suspend
  PM / Domains: Do not restore all devices on power off error
  PM / Domains: Allow callbacks to execute all runtime PM helpers
  PM / Domains: Do not execute device callbacks under locks
  PM / Domains: Make failing pm_genpd_prepare() clean up properly
  PM / Domains: Set device state to "active" during system resume
  ARM: mach-shmobile: sh7372 A3RV requires A4LC
  PM / Domains: Export pm_genpd_poweron() in header
  ARM: mach-shmobile: sh7372 late pm domain off
  ARM: mach-shmobile: Runtime PM late init callback
  ARM: mach-shmobile: sh7372 D4 support
  ARM: mach-shmobile: sh7372 A4MP support
  ARM: mach-shmobile: sh7372: make sure that fsi is peripheral of spu2
  ARM: mach-shmobile: sh7372 A3SG support
  ...
parents f0c077a8 5ca80817
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -506,8 +506,8 @@ routines. Nevertheless, different callback pointers are used in case there is a
situation where it actually matters.
situation where it actually matters.




Device Power Domains
Device Power Management Domains
--------------------
-------------------------------
Sometimes devices share reference clocks or other power resources.  In those
Sometimes devices share reference clocks or other power resources.  In those
cases it generally is not possible to put devices into low-power states
cases it generally is not possible to put devices into low-power states
individually.  Instead, a set of devices sharing a power resource can be put
individually.  Instead, a set of devices sharing a power resource can be put
@@ -516,8 +516,8 @@ power resource. Of course, they also need to be put into the full-power state
together, by turning the shared power resource on.  A set of devices with this
together, by turning the shared power resource on.  A set of devices with this
property is often referred to as a power domain.
property is often referred to as a power domain.


Support for power domains is provided through the pwr_domain field of struct
Support for power domains is provided through the pm_domain field of struct
device.  This field is a pointer to an object of type struct dev_power_domain,
device.  This field is a pointer to an object of type struct dev_pm_domain,
defined in include/linux/pm.h, providing a set of power management callbacks
defined in include/linux/pm.h, providing a set of power management callbacks
analogous to the subsystem-level and device driver callbacks that are executed
analogous to the subsystem-level and device driver callbacks that are executed
for the given device during all power transitions, instead of the respective
for the given device during all power transitions, instead of the respective
+30 −2
Original line number Original line Diff line number Diff line
@@ -606,32 +606,60 @@ driver/base/power/generic_ops.c:
      callback provided by its driver and return its result, or return 0 if not
      callback provided by its driver and return its result, or return 0 if not
      defined
      defined


  int pm_generic_suspend_noirq(struct device *dev);
    - if pm_runtime_suspended(dev) returns "false", invoke the ->suspend_noirq()
      callback provided by the device's driver and return its result, or return
      0 if not defined

  int pm_generic_resume(struct device *dev);
  int pm_generic_resume(struct device *dev);
    - invoke the ->resume() callback provided by the driver of this device and,
    - invoke the ->resume() callback provided by the driver of this device and,
      if successful, change the device's runtime PM status to 'active'
      if successful, change the device's runtime PM status to 'active'


  int pm_generic_resume_noirq(struct device *dev);
    - invoke the ->resume_noirq() callback provided by the driver of this device

  int pm_generic_freeze(struct device *dev);
  int pm_generic_freeze(struct device *dev);
    - if the device has not been suspended at run time, invoke the ->freeze()
    - if the device has not been suspended at run time, invoke the ->freeze()
      callback provided by its driver and return its result, or return 0 if not
      callback provided by its driver and return its result, or return 0 if not
      defined
      defined


  int pm_generic_freeze_noirq(struct device *dev);
    - if pm_runtime_suspended(dev) returns "false", invoke the ->freeze_noirq()
      callback provided by the device's driver and return its result, or return
      0 if not defined

  int pm_generic_thaw(struct device *dev);
  int pm_generic_thaw(struct device *dev);
    - if the device has not been suspended at run time, invoke the ->thaw()
    - if the device has not been suspended at run time, invoke the ->thaw()
      callback provided by its driver and return its result, or return 0 if not
      callback provided by its driver and return its result, or return 0 if not
      defined
      defined


  int pm_generic_thaw_noirq(struct device *dev);
    - if pm_runtime_suspended(dev) returns "false", invoke the ->thaw_noirq()
      callback provided by the device's driver and return its result, or return
      0 if not defined

  int pm_generic_poweroff(struct device *dev);
  int pm_generic_poweroff(struct device *dev);
    - if the device has not been suspended at run time, invoke the ->poweroff()
    - if the device has not been suspended at run time, invoke the ->poweroff()
      callback provided by its driver and return its result, or return 0 if not
      callback provided by its driver and return its result, or return 0 if not
      defined
      defined


  int pm_generic_poweroff_noirq(struct device *dev);
    - if pm_runtime_suspended(dev) returns "false", run the ->poweroff_noirq()
      callback provided by the device's driver and return its result, or return
      0 if not defined

  int pm_generic_restore(struct device *dev);
  int pm_generic_restore(struct device *dev);
    - invoke the ->restore() callback provided by the driver of this device and,
    - invoke the ->restore() callback provided by the driver of this device and,
      if successful, change the device's runtime PM status to 'active'
      if successful, change the device's runtime PM status to 'active'


  int pm_generic_restore_noirq(struct device *dev);
    - invoke the ->restore_noirq() callback provided by the device's driver

These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(),
These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(),
->runtime_resume(), ->suspend(), ->resume(), ->freeze(), ->thaw(), ->poweroff(),
->runtime_resume(), ->suspend(), ->suspend_noirq(), ->resume(),
or ->restore() callback pointers in the subsystem-level dev_pm_ops structures.
->resume_noirq(), ->freeze(), ->freeze_noirq(), ->thaw(), ->thaw_noirq(),
->poweroff(), ->poweroff_noirq(), ->restore(), ->restore_noirq() callback
pointers in the subsystem-level dev_pm_ops structures.


If a subsystem wishes to use all of them at the same time, it can simply assign
If a subsystem wishes to use all of them at the same time, it can simply assign
the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its
the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its
+1 −0
Original line number Original line Diff line number Diff line
@@ -642,6 +642,7 @@ config ARCH_SHMOBILE
	select NO_IOPORT
	select NO_IOPORT
	select SPARSE_IRQ
	select SPARSE_IRQ
	select MULTI_IRQ_HANDLER
	select MULTI_IRQ_HANDLER
	select PM_GENERIC_DOMAINS if PM
	help
	help
	  Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
	  Support for Renesas's SH-Mobile and R-Mobile ARM platforms.


+7 −7
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@ static int omap1_pm_runtime_suspend(struct device *dev)
	if (ret)
	if (ret)
		return ret;
		return ret;


	ret = pm_runtime_clk_suspend(dev);
	ret = pm_clk_suspend(dev);
	if (ret) {
	if (ret) {
		pm_generic_runtime_resume(dev);
		pm_generic_runtime_resume(dev);
		return ret;
		return ret;
@@ -45,24 +45,24 @@ static int omap1_pm_runtime_resume(struct device *dev)
{
{
	dev_dbg(dev, "%s\n", __func__);
	dev_dbg(dev, "%s\n", __func__);


	pm_runtime_clk_resume(dev);
	pm_clk_resume(dev);
	return pm_generic_runtime_resume(dev);
	return pm_generic_runtime_resume(dev);
}
}


static struct dev_power_domain default_power_domain = {
static struct dev_pm_domain default_pm_domain = {
	.ops = {
	.ops = {
		.runtime_suspend = omap1_pm_runtime_suspend,
		.runtime_suspend = omap1_pm_runtime_suspend,
		.runtime_resume = omap1_pm_runtime_resume,
		.runtime_resume = omap1_pm_runtime_resume,
		USE_PLATFORM_PM_SLEEP_OPS
		USE_PLATFORM_PM_SLEEP_OPS
	},
	},
};
};
#define OMAP1_PWR_DOMAIN (&default_power_domain)
#define OMAP1_PM_DOMAIN (&default_pm_domain)
#else
#else
#define OMAP1_PWR_DOMAIN NULL
#define OMAP1_PM_DOMAIN NULL
#endif /* CONFIG_PM_RUNTIME */
#endif /* CONFIG_PM_RUNTIME */


static struct pm_clk_notifier_block platform_bus_notifier = {
static struct pm_clk_notifier_block platform_bus_notifier = {
	.pwr_domain = OMAP1_PWR_DOMAIN,
	.pm_domain = OMAP1_PM_DOMAIN,
	.con_ids = { "ick", "fck", NULL, },
	.con_ids = { "ick", "fck", NULL, },
};
};


@@ -71,7 +71,7 @@ static int __init omap1_pm_runtime_init(void)
	if (!cpu_class_is_omap1())
	if (!cpu_class_is_omap1())
		return -ENODEV;
		return -ENODEV;


	pm_runtime_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);


	return 0;
	return 0;
}
}
+5 −0
Original line number Original line Diff line number Diff line
@@ -1408,9 +1408,14 @@ static void __init ap4evb_init(void)


	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));


	sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc1_device);
	sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device);
	sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device);

	hdmi_init_pm_clock();
	hdmi_init_pm_clock();
	fsi_init_pm_clock();
	fsi_init_pm_clock();
	sh7372_pm_init();
	sh7372_pm_init();
	pm_clk_add(&fsi_device.dev, "spu2");
}
}


static void __init ap4evb_timer_init(void)
static void __init ap4evb_timer_init(void)
Loading