diff options
Diffstat (limited to 'Documentation/power/devices.txt')
-rw-r--r-- | Documentation/power/devices.txt | 37 |
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 | |||
126 | pointed to by the ops member of struct dev_pm_domain, or by the pm member of | 126 | pointed to by the ops member of struct dev_pm_domain, or by the pm member of |
127 | struct bus_type, struct device_type and struct class. They are mostly of | 127 | struct bus_type, struct device_type and struct class. They are mostly of |
128 | interest to the people writing infrastructure for platforms and buses, like PCI | 128 | interest to the people writing infrastructure for platforms and buses, like PCI |
129 | or USB, or device type and device class drivers. | 129 | or USB, or device type and device class drivers. They also are relevant to the |
130 | writers of device drivers whose subsystems (PM domains, device types, device | ||
131 | classes and bus types) don't provide all power management methods. | ||
130 | 132 | ||
131 | Bus drivers implement these methods as appropriate for the hardware and the | 133 | Bus drivers implement these methods as appropriate for the hardware and the |
132 | drivers using it; PCI works differently from USB, and so on. Not many people | 134 | drivers 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 | |||
268 | unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have | 270 | unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have |
269 | been disabled (except for those marked with the IRQF_NO_SUSPEND flag). | 271 | been disabled (except for those marked with the IRQF_NO_SUSPEND flag). |
270 | 272 | ||
271 | All phases use PM domain, bus, type, or class callbacks (that is, methods | 273 | All phases use PM domain, bus, type, class or driver callbacks (that is, methods |
272 | defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, or dev->class->pm). | 274 | defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, dev->class->pm or |
273 | These callbacks are regarded by the PM core as mutually exclusive. Moreover, | 275 | dev->driver->pm). These callbacks are regarded by the PM core as mutually |
274 | PM domain callbacks always take precedence over bus, type and class callbacks, | 276 | exclusive. Moreover, PM domain callbacks always take precedence over all of the |
275 | while type callbacks take precedence over bus and class callbacks, and class | 277 | other callbacks and, for example, type callbacks take precedence over bus, class |
276 | callbacks take precedence over bus callbacks. To be precise, the following | 278 | and driver callbacks. To be precise, the following rules are used to determine |
277 | rules are used to determine which callback to execute in the given phase: | 279 | which 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 | ||
292 | This allows PM domains and device types to override callbacks provided by bus | 293 | This allows PM domains and device types to override callbacks provided by bus |
293 | types or device classes if necessary. | 294 | types or device classes if necessary. |
294 | 295 | ||
295 | These callbacks may in turn invoke device- or driver-specific methods stored in | 296 | The PM domain, type, class and bus callbacks may in turn invoke device- or |
296 | dev->driver->pm, but they don't have to. | 297 | driver-specific methods stored in dev->driver->pm, but they don't have to do |
298 | that. | ||
299 | |||
300 | If the subsystem callback chosen for execution is not present, the PM core will | ||
301 | execute the corresponding method from dev->driver->pm instead if there is one. | ||
297 | 302 | ||
298 | 303 | ||
299 | Entering System Suspend | 304 | Entering System Suspend |