aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-11-27 07:11:51 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-12-01 15:47:29 -0500
commitd23b9b00cdde5c93b914a172cecd57d5625fcd04 (patch)
tree62be5b5b35697e95ef6f71bfeb28ba658e299266 /include
parentecf00475f229fcf06362412ad2d15a3267e354a1 (diff)
PM / Domains: Rework system suspend callback routines (v2)
The current generic PM domains code attempts to use the generic system suspend operations along with the domains' device stop/start routines, which requires device drivers to assume that their system suspend/resume (and hibernation/restore) callbacks will always be used with generic PM domains. However, in theory, the same hardware may be used in devices that don't belong to any PM domain, in which case it would be necessary to add "fake" PM domains to satisfy the above assumption. Also, the domain the hardware belongs to may not be handled with the help of the generic code. To allow device drivers that may be used along with the generic PM domains code of more flexibility, add new device callbacks, .suspend(), .suspend_late(), .resume_early(), .resume(), .freeze(), .freeze_late(), .thaw_early(), and .thaw(), that can be supplied by the drivers in addition to their "standard" system suspend and hibernation callbacks. These new callbacks, if defined, will be used by the generic PM domains code for the handling of system suspend and hibernation instead of the "standard" ones. This will allow drivers to be designed to work with generic PM domains as well as without them. For backwards compatibility, introduce default implementations of the new callbacks for PM domains that will execute pm_generic_suspend(), pm_generic_suspend_noirq(), pm_generic_resume_noirq(), pm_generic_resume(), pm_generic_freeze(), pm_generic_freeze_noirq(), pm_generic_thaw_noirq(), and pm_generic_thaw(), respectively, for the given device if its driver doesn't define those callbacks. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pm_domain.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 731080dad250..10a197dce07e 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -28,6 +28,14 @@ struct gpd_dev_ops {
28 int (*stop)(struct device *dev); 28 int (*stop)(struct device *dev);
29 int (*save_state)(struct device *dev); 29 int (*save_state)(struct device *dev);
30 int (*restore_state)(struct device *dev); 30 int (*restore_state)(struct device *dev);
31 int (*suspend)(struct device *dev);
32 int (*suspend_late)(struct device *dev);
33 int (*resume_early)(struct device *dev);
34 int (*resume)(struct device *dev);
35 int (*freeze)(struct device *dev);
36 int (*freeze_late)(struct device *dev);
37 int (*thaw_early)(struct device *dev);
38 int (*thaw)(struct device *dev);
31 bool (*active_wakeup)(struct device *dev); 39 bool (*active_wakeup)(struct device *dev);
32}; 40};
33 41