The current generic PM domains code attempts to use the genericsystem suspend operations along with the domains' device stop/startroutines, which requires device drivers to assume that theirsystem suspend/resume (and hibernation/restore) callbacks will alwaysbe used with generic PM domains. However, in theory, the samehardware 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 tosatisfy the above assumption. Also, the domain the hardware belongsto may not be handled with the help of the generic code.

To allow device drivers that may be used along with the generic PMdomains code of more flexibility, add new device callbacks, .freeze(),.freeze_late(), .thaw_early() and .thaw(), that can be supplied bythe drivers in addition to their "standard" system suspend andhibernation callbacks. These new callbacks, if defined, will be usedby the generic PM domains code for the handling of system suspend andhibernation instead of the "standard" ones. This will allow driversto be designed to work with generic PM domains as well as withoutthem.

For backwards compatibility, introduce default .freeze(), .thaw(),.freeze_late() and .thaw_early() callback routines for PM domains thatwill execute pm_generic_suspend(), pm_generic_resume(),pm_generic_suspend_noirq() and pm_generic_resume_noirq(),respectively, for the given device if its driver doesn't provide itsown implementations of .freeze(), .thaw(), .freeze_late() and.thaw_early() (this works slightly differently from the current code,but its existing users don't care anyway).

/** * pm_genpd_freeze_noirq - Late freeze of a device from an I/O power domain. * @dev: Device to freeze. *- * Carry out a late freeze of a device under the assumption that its+ * Carry out a late "freeze" of a device under the assumption that its * pm_domain field points to the domain member of an object of type * struct generic_pm_domain representing a power domain consisting of I/O * devices.@@ -856,7 +834,7 @@ static int pm_genpd_freeze_noirq(struct if (genpd->suspend_power_off) return 0;

@@ -869,7 +847,7 @@ static int pm_genpd_freeze_noirq(struct * pm_genpd_thaw_noirq - Early thaw of a device from an I/O power domain. * @dev: Device to thaw. *- * Carry out an early thaw of a device under the assumption that its+ * Carry out an early "thaw" of a device under the assumption that its * pm_domain field points to the domain member of an object of type * struct generic_pm_domain representing a power domain consisting of I/O * devices.@@ -889,7 +867,7 @@ static int pm_genpd_thaw_noirq(struct de