Linux Kernel
3.7.1
|
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/capability.h>
#include <linux/export.h>
#include <linux/suspend.h>
#include <linux/seq_file.h>
#include <linux/debugfs.h>
#include <trace/events/power.h>
#include "power.h"
Go to the source code of this file.
Macros | |
#define | IN_PROGRESS_BITS (sizeof(int) * 4) |
#define | MAX_IN_PROGRESS ((1 << IN_PROGRESS_BITS) - 1) |
Functions | |
string won't be freed when @ws is still in | |
use. | |
void | wakeup_source_prepare (struct wakeup_source *ws, const char *name) |
EXPORT_SYMBOL_GPL (wakeup_source_prepare) | |
: Name of the new wakeup source. | |
wakeup_source_create - Create a struct wakeup_source object. | |
struct wakeup_source * | wakeup_source_create (const char *name) |
EXPORT_SYMBOL_GPL (wakeup_source_create) | |
void | wakeup_source_drop (struct wakeup_source *ws) |
EXPORT_SYMBOL_GPL (wakeup_source_drop) | |
void | wakeup_source_destroy (struct wakeup_source *ws) |
EXPORT_SYMBOL_GPL (wakeup_source_destroy) | |
void | wakeup_source_add (struct wakeup_source *ws) |
EXPORT_SYMBOL_GPL (wakeup_source_add) | |
void | wakeup_source_remove (struct wakeup_source *ws) |
EXPORT_SYMBOL_GPL (wakeup_source_remove) | |
Variables | |
bool events_check_enabled | __read_mostly |
#define MAX_IN_PROGRESS ((1 << IN_PROGRESS_BITS) - 1) |
void __pm_relax | ( | struct wakeup_source * | ws | ) |
__pm_relax - Notify the PM core that processing of a wakeup event has ended. : Wakeup source object associated with the source of the event.
Call this function for wakeup events whose processing started with calling __pm_stay_awake().
It is safe to call it from interrupt context.
void __pm_stay_awake | ( | struct wakeup_source * | ws | ) |
void __pm_wakeup_event | ( | struct wakeup_source * | ws, |
unsigned int | msec | ||
) |
__pm_wakeup_event - Notify the PM core of a wakeup event. : Wakeup source object associated with the event source. : Anticipated event processing time (in milliseconds).
Notify the PM core of a wakeup event whose source is that will take approximately milliseconds to be processed by the kernel. If is not active, activate it. If is nonzero, set up the ' timer to execute pm_wakeup_timer_fn() in future.
It is safe to call this function from interrupt context.
device_init_wakeup - Device wakeup initialization. : Device to handle. : Whether or not to enable as a wakeup device.
By default, most devices should leave wakeup disabled. The exceptions are devices that everyone expects to be wakeup sources: keyboards, power buttons, possibly network interfaces, etc. Also, devices that don't generate their own wakeup requests but merely forward requests from one bus to another (like PCI bridges) should have wakeup enabled by default.
device_set_wakeup_capable - Set/reset device wakeup capability flag. : Device to handle. : Whether or not is capable of waking up the system from sleep.
If is set, set the 's power.can_wakeup flag and add its wakeup-related attributes to sysfs. Otherwise, unset the 's power.can_wakeup flag and remove its wakeup-related attributes from sysfs.
This function may sleep and it can't be called from any context where sleeping is not allowed.
EXPORT_SYMBOL_GPL | ( | wakeup_source_prepare | ) |
EXPORT_SYMBOL_GPL | ( | wakeup_source_create | ) |
EXPORT_SYMBOL_GPL | ( | wakeup_source_drop | ) |
EXPORT_SYMBOL_GPL | ( | wakeup_source_destroy | ) |
EXPORT_SYMBOL_GPL | ( | wakeup_source_add | ) |
EXPORT_SYMBOL_GPL | ( | wakeup_source_remove | ) |
EXPORT_SYMBOL_GPL | ( | wakeup_source_register | ) |
EXPORT_SYMBOL_GPL | ( | wakeup_source_unregister | ) |
EXPORT_SYMBOL_GPL | ( | device_wakeup_enable | ) |
EXPORT_SYMBOL_GPL | ( | device_wakeup_disable | ) |
EXPORT_SYMBOL_GPL | ( | device_set_wakeup_capable | ) |
EXPORT_SYMBOL_GPL | ( | device_init_wakeup | ) |
EXPORT_SYMBOL_GPL | ( | device_set_wakeup_enable | ) |
EXPORT_SYMBOL_GPL | ( | __pm_stay_awake | ) |
EXPORT_SYMBOL_GPL | ( | pm_stay_awake | ) |
EXPORT_SYMBOL_GPL | ( | __pm_relax | ) |
EXPORT_SYMBOL_GPL | ( | pm_relax | ) |
EXPORT_SYMBOL_GPL | ( | __pm_wakeup_event | ) |
EXPORT_SYMBOL_GPL | ( | pm_wakeup_event | ) |
pm_get_wakeup_count - Read the number of registered wakeup events. : Address to store the value at. : Whether or not to block.
Store the number of registered wakeup events at the address in . If is set, block until the current number of wakeup events being processed is zero.
Return 'false' if the current number of wakeup events being processed is nonzero. Otherwise return 'true'.
pm_save_wakeup_count - Save the current number of registered wakeup events. : Value to compare with the current number of registered wakeup events.
If is equal to the current number of registered wakeup events and the current number of wakeup events being processed is zero, store as the old number of registered wakeup events for pm_check_wakeup_events(), enable wakeup events detection and return 'true'. Otherwise disable wakeup events detection and return 'false'.
pm_stay_awake - Notify the PM core that a wakeup event is being processed. : Device the wakeup event is related to.
Notify the PM core of a wakeup event (signaled by ) by calling __pm_stay_awake for the 's wakeup source object.
Call this function after detecting of a wakeup event if pm_relax() is going to be called directly after processing the event (and possibly passing it to user space for further processing).
pm_wakeup_pending - Check if power transition in progress should be aborted.
Compare the current number of registered wakeup events with its preserved value from the past and return true if new wakeup events have been registered since the old value was stored. Also return true if the current number of wakeup events being processed is different from zero.
postcore_initcall | ( | wakeup_sources_debugfs_init | ) |
void wakeup_source_add | ( | struct wakeup_source * | ws | ) |
|
read |
void wakeup_source_destroy | ( | struct wakeup_source * | ws | ) |
wakeup_source_destroy - Destroy a struct wakeup_source object. : Wakeup source to destroy.
Use only for wakeup source objects created with wakeup_source_create().
void wakeup_source_drop | ( | struct wakeup_source * | ws | ) |
wakeup_source_drop - Prepare a struct wakeup_source object for destruction. : Wakeup source to prepare for destruction.
Callers must ensure that __pm_stay_awake() or __pm_wakeup_event() will never be run in parallel with this function for the same wakeup source object.
void wakeup_source_prepare | ( | struct wakeup_source * | ws, |
const char * | name | ||
) |
|
read |
void wakeup_source_remove | ( | struct wakeup_source * | ws | ) |
void wakeup_source_unregister | ( | struct wakeup_source * | ws | ) |