aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power/devices.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/power/devices.txt')
-rw-r--r--Documentation/power/devices.txt37
1 files changed, 21 insertions, 16 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
index 3139fb505dce..20af7def23c8 100644
--- a/Documentation/power/devices.txt
+++ b/Documentation/power/devices.txt
@@ -126,7 +126,9 @@ The core methods to suspend and resume devices reside in struct dev_pm_ops
126pointed to by the ops member of struct dev_pm_domain, or by the pm member of 126pointed to by the ops member of struct dev_pm_domain, or by the pm member of
127struct bus_type, struct device_type and struct class. They are mostly of 127struct bus_type, struct device_type and struct class. They are mostly of
128interest to the people writing infrastructure for platforms and buses, like PCI 128interest to the people writing infrastructure for platforms and buses, like PCI
129or USB, or device type and device class drivers. 129or USB, or device type and device class drivers. They also are relevant to the
130writers of device drivers whose subsystems (PM domains, device types, device
131classes and bus types) don't provide all power management methods.
130 132
131Bus drivers implement these methods as appropriate for the hardware and the 133Bus drivers implement these methods as appropriate for the hardware and the
132drivers using it; PCI works differently from USB, and so on. Not many people 134drivers using it; PCI works differently from USB, and so on. Not many people
@@ -268,32 +270,35 @@ various phases always run after tasks have been frozen and before they are
268unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have 270unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have
269been disabled (except for those marked with the IRQF_NO_SUSPEND flag). 271been disabled (except for those marked with the IRQF_NO_SUSPEND flag).
270 272
271All phases use PM domain, bus, type, or class callbacks (that is, methods 273All phases use PM domain, bus, type, class or driver callbacks (that is, methods
272defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, or dev->class->pm). 274defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, dev->class->pm or
273These callbacks are regarded by the PM core as mutually exclusive. Moreover, 275dev->driver->pm). These callbacks are regarded by the PM core as mutually
274PM domain callbacks always take precedence over bus, type and class callbacks, 276exclusive. Moreover, PM domain callbacks always take precedence over all of the
275while type callbacks take precedence over bus and class callbacks, and class 277other callbacks and, for example, type callbacks take precedence over bus, class
276callbacks take precedence over bus callbacks. To be precise, the following 278and driver callbacks. To be precise, the following rules are used to determine
277rules are used to determine which callback to execute in the given phase: 279which callback to execute in the given phase:
278 280
279 1. If dev->pm_domain is present, the PM core will attempt to execute the 281 1. If dev->pm_domain is present, the PM core will choose the callback
280 callback included in dev->pm_domain->ops. If that callback is not 282 included in dev->pm_domain->ops for execution
281 present, no action will be carried out for the given device.
282 283
283 2. Otherwise, if both dev->type and dev->type->pm are present, the callback 284 2. Otherwise, if both dev->type and dev->type->pm are present, the callback
284 included in dev->type->pm will be executed. 285 included in dev->type->pm will be chosen for execution.
285 286
286 3. Otherwise, if both dev->class and dev->class->pm are present, the 287 3. Otherwise, if both dev->class and dev->class->pm are present, the
287 callback included in dev->class->pm will be executed. 288 callback included in dev->class->pm will be chosen for execution.
288 289
289 4. Otherwise, if both dev->bus and dev->bus->pm are present, the callback 290 4. Otherwise, if both dev->bus and dev->bus->pm are present, the callback
290 included in dev->bus->pm will be executed. 291 included in dev->bus->pm will be chosen for execution.
291 292
292This allows PM domains and device types to override callbacks provided by bus 293This allows PM domains and device types to override callbacks provided by bus
293types or device classes if necessary. 294types or device classes if necessary.
294 295
295These callbacks may in turn invoke device- or driver-specific methods stored in 296The PM domain, type, class and bus callbacks may in turn invoke device- or
296dev->driver->pm, but they don't have to. 297driver-specific methods stored in dev->driver->pm, but they don't have to do
298that.
299
300If the subsystem callback chosen for execution is not present, the PM core will
301execute the corresponding method from dev->driver->pm instead if there is one.
297 302
298 303
299Entering System Suspend 304Entering System Suspend