Logo Search packages:      
Sourcecode: linux version File versions  Download package

Public Attributes

platform_suspend_ops Struct Reference

#include <suspend.h>

List of all members.

Public Attributes

int(* begin )(suspend_state_t state)
void(* end )(void)
int(* enter )(suspend_state_t state)
void(* finish )(void)
int(* prepare )(void)
int(* prepare_late )(void)
void(* recover )(void)
int(* valid )(suspend_state_t state)
void(* wake )(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 .

: 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 108 of file suspend.h.


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

Generated by  Doxygen 1.6.0   Back to index