forked from linux-sunxi/linux-sunxi
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it possible to wake up from standby.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
- Loading branch information
Showing
12 changed files
with
93 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* The standby code is compiled with different calling convention so include another copy for use in kernel. */ | ||
|
||
#include "standby/common.c" | ||
#include "standby/standby_power.c" | ||
#include "standby/standby_twi.c" | ||
#include "standby/standby_int.c" | ||
#include "standby/standby_clock.c" | ||
#include "standby/standby_key.c" | ||
#include "standby/standby_usb.c" | ||
#include "standby/standby_ir.c" | ||
#include "standby/standby_tmr.c" | ||
#include "standby/standby_wakeup.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
void standby_wakeup_init(void); | ||
void standby_wakeup_fini(void); |