forked from linux-sunxi/linux-sunxi
-
Notifications
You must be signed in to change notification settings - Fork 4
/
standby_wakeup.c
59 lines (57 loc) · 1.53 KB
/
standby_wakeup.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "standby_i.h"
#include "standby_wakeup.h"
void standby_wakeup_init(void)
{
/* initialise standby modules */
standby_clk_init();
standby_int_init();
standby_tmr_init();
standby_power_init();
/* init some system wake source */
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_EXINT){
standby_enable_int(INT_SOURCE_EXTNMI);
}
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_KEY){
standby_key_init();
standby_enable_int(INT_SOURCE_LRADC);
}
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_IR){
standby_ir_init();
standby_enable_int(INT_SOURCE_IR0);
standby_enable_int(INT_SOURCE_IR1);
}
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_ALARM){
//standby_alarm_init();???
standby_enable_int(INT_SOURCE_ALARM);
}
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_USB){
standby_usb_init();
standby_enable_int(INT_SOURCE_USB0);
}
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_TIMEOFF){
/* set timer for power off */
if(pm_info.standby_para.time_off) {
standby_tmr_set(pm_info.standby_para.time_off);
standby_enable_int(INT_SOURCE_TIMER0);
}
}
}
void standby_wakeup_fini(void)
{
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_USB){
standby_usb_exit();
}
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_IR){
standby_ir_exit();
}
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_ALARM){
//standby_alarm_exit();
}
if(pm_info.standby_para.event & SUSPEND_WAKEUP_SRC_KEY){
standby_key_exit();
}
standby_power_exit();
standby_tmr_exit();
standby_int_exit();
standby_clk_exit();
}