Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
platform_suspend_ops Struct Reference

#include <suspend.h>

Data Fields

int(* valid )(suspend_state_t state)
 
int(* begin )(suspend_state_t state)
 
int(* prepare )(void)
 
int(* prepare_late )(void)
 
int(* enter )(suspend_state_t state)
 
void(* wake )(void)
 
void(* finish )(void)
 
bool(* suspend_again )(void)
 
void(* end )(void)
 
void(* recover )(void)
 

Detailed Description

struct platform_suspend_ops - Callbacks for managing platform dependent system sleep states.

: Callback to determine if given system sleep state is supported by the platform. Valid (ie. supported) states are advertised in /sys/power/state. Note that it still may be impossible to enter given system sleep state if the conditions aren't right. There is the suspend_valid_only_mem function available that can be assigned to this if the platform only supports mem sleep.

: Initialise a transition to given system sleep state. () is executed right prior to suspending devices. The information conveyed to the platform code by () should be disregarded by it as soon as () is executed. If () fails (ie. returns nonzero), (), () and () will not be called by the PM core. This callback is optional. However, if it is implemented, the argument passed to () is redundant and should be ignored.

: Prepare the platform for entering the system sleep state indicated by (). () is called right after devices have been suspended (ie. the appropriate .suspend() method has been executed for each device) and before device drivers' late suspend callbacks are executed. It returns 0 on success or a negative error code otherwise, in which case the system cannot enter the desired sleep state ((), (), and () will not be called in that case).

: Finish preparing the platform for entering the system sleep state indicated by (). is called before disabling nonboot CPUs and after device drivers' late suspend callbacks have been executed. It returns 0 on success or a negative error code otherwise, in which case the system cannot enter the desired sleep state (() will not be executed).

: Enter the system sleep state indicated by () or represented by the argument if () is not implemented. This callback is mandatory. It returns 0 on success or a negative error code otherwise, in which case the system cannot enter the desired sleep state.

: Called when the system has just left a sleep state, right after the nonboot CPUs have been enabled and before device drivers' early resume callbacks are executed. This callback is optional, but should be implemented by the platforms that implement (). If implemented, it is always called after and (), even if one of them fails.

: Finish wake-up of the platform. is called right prior to calling device drivers' regular suspend callbacks. This callback is optional, but should be implemented by the platforms that implement (). If implemented, it is always called after () and (), even if any of them fails. It is executed after a failing .

: Returns whether the system should suspend again (true) or not (false). If the platform wants to poll sensors or execute some code during suspended without invoking userspace and most of devices, suspend_again callback is the place assuming that periodic-wakeup or alarm-wakeup is already setup. This allows to execute some codes while being kept suspended in the view of userland and devices.

: Called by the PM core right after resuming devices, to indicate to the platform that the system has returned to the working state or the transition to the sleep state has been aborted. This callback is optional, but should be implemented by the platforms that implement (). Accordingly, platforms implementing () should also provide a () which cleans up transitions aborted before ().

: Recover the platform from a suspend failure. Called by the PM core if the suspending of devices fails. This callback is optional and should only be implemented by platforms which require special recovery actions in that situation.

Definition at line 175 of file suspend.h.

Field Documentation

Definition at line 177 of file suspend.h.

void(* end)(void)

Definition at line 184 of file suspend.h.

Definition at line 180 of file suspend.h.

void(* finish)(void)

Definition at line 182 of file suspend.h.

int(* prepare)(void)

Definition at line 178 of file suspend.h.

int(* prepare_late)(void)

Definition at line 179 of file suspend.h.

void(* recover)(void)

Definition at line 185 of file suspend.h.

bool(* suspend_again)(void)

Definition at line 183 of file suspend.h.

Definition at line 176 of file suspend.h.

void(* wake)(void)

Definition at line 181 of file suspend.h.


The documentation for this struct was generated from the following file: