![]() |
EVE 1.0
|
![]() |
Data Structures | |
struct | clk_lock_t |
Macros | |
#define | CLK_PERSISTENT(x) ((enum clk_level_t) ((x) | 0x80)) |
#define | CLK_LOCK_INIT(l, clk) |
#define | CLK_LOCK(clk) clk_lock(&clk) |
#define | CLK_UNLOCK(clk) clk_unlock(&clk) |
#define | CLK_AUTO_LOCK(l) |
#define | DECLARE_CLK_LOCK(l, clk) static struct clk_lock_t clk = CLK_LOCK_INIT(l, clk) |
Enumerations |
Functions | |
void | clk_init (void) |
void | clk_relax (void) |
void | clk_lock (struct clk_lock_t *clk) |
void | clk_unlock (struct clk_lock_t *clk) |
EVE clock management framework.
#define CLK_PERSISTENT | ( | x | ) | ((enum clk_level_t) ((x) | 0x80)) |
Indicates that the given clock should be kept running when system is in the suspend state.
The modifier can be applied to level field of the clk_lock_t instantiation to indicate that the clock should not be switched off at system suspend.
Usage:
x | The actual clock level, clk_level_t. |
#define CLK_LOCK_INIT | ( | l, | |
clk | |||
) |
Initializes a clock lock structure.
The macro is used to initialize a clock lock structure instance.
l | clock level |
clk | clock lock structure |
Usage:
#define CLK_LOCK | ( | clk | ) | clk_lock(&clk) |
#define CLK_UNLOCK | ( | clk | ) | clk_unlock(&clk) |
Release the clock
The macro is used to release clock at the given clock level.
The clock actually continues to run after the last lock is released until clk_relax() is called explicitly or by pm_relax().
clk | clock lock structure |
Usage:
#define CLK_AUTO_LOCK | ( | l | ) |
Declares an anonymous auto lock, which holds clock request in the auto variable visibility block
l | clock level |
Usage:
Note: taking in mind lazy nature of releasing the clock locks, use of auto clock locks is negligible.
#define DECLARE_CLK_LOCK | ( | l, | |
clk | |||
) | static struct clk_lock_t clk = CLK_LOCK_INIT(l, clk) |
enum clk_level_t |
Clock level.
The system can use one two high frequency clock sources: a 64 MHz internal oscillator (RC) or a 32 MHz crystal oscillator (XO). The crystal oscillator typically gives better stability, but drains more power from battery.
Clock level is an abstraction for the clock source the system is running on.
Enumerator | |
---|---|
CLK_LEVEL_MIN |
Minimal possible clock level. |
CLK_LEVEL_RC |
System uses 64 MHz internal oscillator as a clock source. |
CLK_LEVEL_XO |
System uses 32 MHz crystal oscillator as a clock source. |
CLK_LEVEL__COUNT |
Number of elements in the clk_level_t enum. |
void clk_init | ( | void | ) |
Initializes the clock management framework.
void clk_relax | ( | void | ) |
Switches off released clocks and enters the lowest allowed clock level.
void clk_lock | ( | struct clk_lock_t * | clk | ) |
Requests the clock.
clk | pointer to the clock lock structure |
void clk_unlock | ( | struct clk_lock_t * | clk | ) |
Releases the clock.
clk | pointer to the clock lock structure |