aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/pm.c
diff options
context:
space:
mode:
authorcodeworkx <codeworkx@cyanogenmod.com>2012-09-22 09:48:20 +0200
committercodeworkx <codeworkx@cyanogenmod.com>2012-09-22 14:02:16 +0200
commit2489007e7d740ccbc3e0a202914e243ad5178787 (patch)
treeb8e6380ea7b1da63474ad68a5dba997e01146043 /arch/arm/plat-samsung/pm.c
parent5f67568eb31e3a813c7c52461dcf66ade15fc2e7 (diff)
downloadkernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.zip
kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.tar.gz
kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.tar.bz2
merge opensource jb u5
Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2
Diffstat (limited to 'arch/arm/plat-samsung/pm.c')
-rw-r--r--arch/arm/plat-samsung/pm.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index e46ecce..12b1bad 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -247,6 +247,7 @@ void (*pm_cpu_sleep)(void);
void (*pm_cpu_restore)(void);
int (*pm_prepare)(void);
void (*pm_finish)(void);
+unsigned int (*pm_check_eint_pend)(void);
#define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
@@ -254,7 +255,9 @@ void (*pm_finish)(void);
*
* central control for sleep/resume process
*/
-
+#ifdef CONFIG_FAST_BOOT
+extern bool fake_shut_down;
+#endif
static int s3c_pm_enter(suspend_state_t state)
{
/* ensure the debug is initialised (if enabled) */
@@ -280,6 +283,15 @@ static int s3c_pm_enter(suspend_state_t state)
return -EINVAL;
}
+ if (pm_check_eint_pend) {
+ u32 pending_eint = pm_check_eint_pend();
+ if (pending_eint) {
+ pr_warn("%s: Aborting sleep, EINT PENDING(0x%08x)\n",
+ __func__, pending_eint);
+ return -EBUSY;
+ }
+ }
+
/* save all necessary core registers not covered by the drivers */
s3c_pm_save_gpios();
@@ -306,6 +318,16 @@ static int s3c_pm_enter(suspend_state_t state)
s3c_pm_check_store();
+#ifdef CONFIG_FAST_BOOT
+ if (fake_shut_down) {
+ /* Masking external wake up source
+ * only enable power key, FUEL ALERT, AP/IF PMIC IRQ */
+ __raw_writel(0xff77df7f, S5P_EINT_WAKEUP_MASK);
+ /* disable all system int */
+ __raw_writel(0xffffffff, S5P_WAKEUP_MASK);
+ }
+#endif
+
/* send the cpu to sleep... */
s3c_pm_arch_stop_clocks();
@@ -359,7 +381,11 @@ static int s3c_pm_enter(suspend_state_t state)
static int s3c_pm_prepare(void)
{
/* prepare check area if configured */
-
+#if defined(CONFIG_MACH_P8LTE) \
+ || defined(CONFIG_MACH_U1_NA_SPR) \
+ || defined(CONFIG_MACH_U1_NA_USCC)
+ disable_hlt();
+#endif
s3c_pm_check_prepare();
if (pm_prepare)
@@ -374,6 +400,11 @@ static void s3c_pm_finish(void)
pm_finish();
s3c_pm_check_cleanup();
+#if defined(CONFIG_MACH_P8LTE) \
+ || defined(CONFIG_MACH_U1_NA_SPR) \
+ || defined(CONFIG_MACH_U1_NA_USCC)
+ enable_hlt();
+#endif
}
#if defined(CONFIG_CHARGER_MANAGER)