Lines Matching full:pm

18 #define pr_fmt(fmt) "PM: " fmt
24 #include <linux/pm.h>
26 #include <linux/pm-trace.h>
88 return "(unknown PM event)"; in pm_verb()
109 * device_pm_lock - Lock the list of active devices used by the PM core.
117 * device_pm_unlock - Unlock the list of active devices used by the PM core.
125 * device_pm_add - Add a device to the PM core's list of active devices.
130 /* Skip PM setup/initialization. */ in device_pm_add()
147 * device_pm_remove - Remove a device from the PM core's list of active devices.
168 * device_pm_move_before - Move device in the PM core's list of active devices.
182 * device_pm_move_after - Move device in the PM core's list of active devices.
196 * device_pm_move_last - Move device to end of the PM core's list of devices.
231 * dpm_wait - Wait for a PM operation to complete.
340 * pm_op - Return the PM operation appropriate for given PM event.
341 * @ops: PM operations to choose from.
342 * @state: PM transition of the system being carried out.
371 * pm_late_early_op - Return the PM operation appropriate for given PM event.
372 * @ops: PM operations to choose from.
373 * @state: PM transition of the system being carried out.
375 * Runtime PM is disabled for @dev while this function is being executed.
405 * pm_noirq_op - Return the PM operation appropriate for given PM event.
406 * @ops: PM operations to choose from.
407 * @state: PM transition of the system being carried out.
507 * @t: The timer that PM watchdog depends on.
536 * dpm_watchdog_set - Enable pm watchdog for given device.
633 * @state: PM transition of the system being carried out.
662 * this device later, it needs to appear as "suspended" to PM-runtime, in device_resume_noirq()
665 * Otherwise, the device is going to be resumed, so set its PM-runtime in device_resume_noirq()
667 * which case it is not necessary to update its PM-runtime status. in device_resume_noirq()
677 } else if (dev->type && dev->type->pm) { in device_resume_noirq()
679 callback = pm_noirq_op(dev->type->pm, state); in device_resume_noirq()
680 } else if (dev->class && dev->class->pm) { in device_resume_noirq()
682 callback = pm_noirq_op(dev->class->pm, state); in device_resume_noirq()
683 } else if (dev->bus && dev->bus->pm) { in device_resume_noirq()
685 callback = pm_noirq_op(dev->bus->pm, state); in device_resume_noirq()
693 if (dev->driver && dev->driver->pm) { in device_resume_noirq()
695 callback = pm_noirq_op(dev->driver->pm, state); in device_resume_noirq()
771 * @state: PM transition of the system being carried out.
787 * @state: PM transition of the system being carried out.
790 * Runtime PM is disabled for @dev while this function is being executed.
813 } else if (dev->type && dev->type->pm) { in device_resume_early()
815 callback = pm_late_early_op(dev->type->pm, state); in device_resume_early()
816 } else if (dev->class && dev->class->pm) { in device_resume_early()
818 callback = pm_late_early_op(dev->class->pm, state); in device_resume_early()
819 } else if (dev->bus && dev->bus->pm) { in device_resume_early()
821 callback = pm_late_early_op(dev->bus->pm, state); in device_resume_early()
829 if (dev->driver && dev->driver->pm) { in device_resume_early()
831 callback = pm_late_early_op(dev->driver->pm, state); in device_resume_early()
863 * @state: PM transition of the system being carried out.
913 * @state: PM transition of the system being carried out.
925 * @state: PM transition of the system being carried out.
947 * point if it has no PM callbacks. in device_resume()
975 if (dev->type && dev->type->pm) { in device_resume()
977 callback = pm_op(dev->type->pm, state); in device_resume()
981 if (dev->class && dev->class->pm) { in device_resume()
983 callback = pm_op(dev->class->pm, state); in device_resume()
988 if (dev->bus->pm) { in device_resume()
990 callback = pm_op(dev->bus->pm, state); in device_resume()
999 if (!callback && dev->driver && dev->driver->pm) { in device_resume()
1001 callback = pm_op(dev->driver->pm, state); in device_resume()
1033 * @state: PM transition of the system being carried out.
1088 * device_complete - Complete a PM transition for given device.
1090 * @state: PM transition of the system being carried out.
1105 } else if (dev->type && dev->type->pm) { in device_complete()
1107 callback = dev->type->pm->complete; in device_complete()
1108 } else if (dev->class && dev->class->pm) { in device_complete()
1110 callback = dev->class->pm->complete; in device_complete()
1111 } else if (dev->bus && dev->bus->pm) { in device_complete()
1113 callback = dev->bus->pm->complete; in device_complete()
1116 if (!callback && dev->driver && dev->driver->pm) { in device_complete()
1118 callback = dev->driver->pm->complete; in device_complete()
1129 /* If enabling runtime PM for the device is blocked, unblock it. */ in device_complete()
1135 * dpm_complete - Complete a PM transition for all non-sysdev devices.
1136 * @state: PM transition of the system being carried out.
1138 * Execute the ->complete() callbacks for all devices whose PM status is not
1177 * @state: PM transition of the system being carried out.
1179 * Execute "resume" callbacks for all devices and complete the PM transition of
1194 * @sleep_state: PM message representing a sleep state.
1196 * Return a PM message representing the resume event corresponding to given
1232 * @state: PM transition of the system being carried out.
1258 } else if (dev->type && dev->type->pm) { in device_suspend_noirq()
1260 callback = pm_noirq_op(dev->type->pm, state); in device_suspend_noirq()
1261 } else if (dev->class && dev->class->pm) { in device_suspend_noirq()
1263 callback = pm_noirq_op(dev->class->pm, state); in device_suspend_noirq()
1264 } else if (dev->bus && dev->bus->pm) { in device_suspend_noirq()
1266 callback = pm_noirq_op(dev->bus->pm, state); in device_suspend_noirq()
1274 if (dev->driver && dev->driver->pm) { in device_suspend_noirq()
1276 callback = pm_noirq_op(dev->driver->pm, state); in device_suspend_noirq()
1295 * runtime PM usage counters and child counters) would be suboptimal. in device_suspend_noirq()
1369 * @state: PM transition of the system being carried out.
1406 * @state: PM transition of the system being carried out.
1409 * Runtime PM is disabled for @dev while this function is being executed.
1421 * Disable runtime PM for the device without checking if there is a in device_suspend_late()
1442 } else if (dev->type && dev->type->pm) { in device_suspend_late()
1444 callback = pm_late_early_op(dev->type->pm, state); in device_suspend_late()
1445 } else if (dev->class && dev->class->pm) { in device_suspend_late()
1447 callback = pm_late_early_op(dev->class->pm, state); in device_suspend_late()
1448 } else if (dev->bus && dev->bus->pm) { in device_suspend_late()
1450 callback = pm_late_early_op(dev->bus->pm, state); in device_suspend_late()
1458 if (dev->driver && dev->driver->pm) { in device_suspend_late()
1460 callback = pm_late_early_op(dev->driver->pm, state); in device_suspend_late()
1492 * @state: PM transition of the system being carried out.
1548 * @state: PM transition of the system being carried out.
1572 * @state: PM transition of the system being carried out.
1620 * @state: PM transition of the system being carried out.
1641 * Wait for possible runtime PM transitions of the device in progress in device_suspend()
1647 * of the device, they must disable runtime PM for it or otherwise in device_suspend()
1692 if (dev->type && dev->type->pm) { in device_suspend()
1694 callback = pm_op(dev->type->pm, state); in device_suspend()
1698 if (dev->class && dev->class->pm) { in device_suspend()
1700 callback = pm_op(dev->class->pm, state); in device_suspend()
1705 if (dev->bus->pm) { in device_suspend()
1707 callback = pm_op(dev->bus->pm, state); in device_suspend()
1717 if (!callback && dev->driver && dev->driver->pm) { in device_suspend()
1719 callback = pm_op(dev->driver->pm, state); in device_suspend()
1759 * @state: PM transition of the system being carried out.
1822 * for it and for devices without PM callbacks. in device_prepare_smart_suspend()
1825 * or any of its suppliers that take runtime PM into account, it cannot in device_prepare_smart_suspend()
1857 * @state: PM transition of the system being carried out.
1876 * If runtime PM is disabled for the device at this point and it has in device_prepare()
1895 else if (dev->type && dev->type->pm) in device_prepare()
1896 callback = dev->type->pm->prepare; in device_prepare()
1897 else if (dev->class && dev->class->pm) in device_prepare()
1898 callback = dev->class->pm->prepare; in device_prepare()
1899 else if (dev->bus && dev->bus->pm) in device_prepare()
1900 callback = dev->bus->pm->prepare; in device_prepare()
1902 if (!callback && dev->driver && dev->driver->pm) in device_prepare()
1903 callback = dev->driver->pm->prepare; in device_prepare()
1916 /* Do not enable "smart suspend" for devices with disabled runtime PM. */ in device_prepare()
1940 * dpm_prepare - Prepare all non-sysdev devices for a system PM transition.
1941 * @state: PM transition of the system being carried out.
2003 * dpm_suspend_start - Prepare devices for PM transition and suspend them.
2004 * @state: PM transition of the system being carried out.
2006 * Prepare all non-sysdev devices for system PM transition and execute "suspend"
2087 (!dev->bus || (pm_ops_is_empty(dev->bus->pm) && in device_pm_check_callbacks()
2089 (!dev->class || pm_ops_is_empty(dev->class->pm)) && in device_pm_check_callbacks()
2090 (!dev->type || pm_ops_is_empty(dev->type->pm)) && in device_pm_check_callbacks()
2092 (!dev->driver || (pm_ops_is_empty(dev->driver->pm) && in device_pm_check_callbacks()