aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/kernel/cpu
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2009-10-29 10:51:48 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-10-30 11:54:59 +0900
commit49f42644fd01bc7bd9b6b0a080fee1a89dc66665 (patch)
tree570a5cc04f260ecdb81eb4af5ab3000c8518aa7d /arch/sh/kernel/cpu
parenteb3118f652ea7751ecf6a7e467bb637895e3be3b (diff)
sh: Add notifiers chains for cpu/board code
This patch adds atomic notifier chains for pre/post sleep events. Useful for cpu code and boards that need to save and restore register state before and after entering a sleep mode. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu')
-rw-r--r--arch/sh/kernel/cpu/shmobile/pm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c
index ee3c2aaf66f..7ebf8cf8924 100644
--- a/arch/sh/kernel/cpu/shmobile/pm.c
+++ b/arch/sh/kernel/cpu/shmobile/pm.c
@@ -17,6 +17,12 @@
#include <asm/uaccess.h>
/*
+ * Notifier lists for pre/post sleep notification
+ */
+ATOMIC_NOTIFIER_HEAD(sh_mobile_pre_sleep_notifier_list);
+ATOMIC_NOTIFIER_HEAD(sh_mobile_post_sleep_notifier_list);
+
+/*
* Sleep modes available on SuperH Mobile:
*
* Sleep mode is just plain "sleep" instruction
@@ -44,8 +50,14 @@ void sh_mobile_call_standby(unsigned long mode)
void *onchip_mem = (void *)ILRAM_BASE;
void (*standby_onchip_mem)(unsigned long, unsigned long) = onchip_mem;
+ atomic_notifier_call_chain(&sh_mobile_pre_sleep_notifier_list,
+ mode, NULL);
+
/* Let assembly snippet in on-chip memory handle the rest */
standby_onchip_mem(mode, ILRAM_BASE);
+
+ atomic_notifier_call_chain(&sh_mobile_post_sleep_notifier_list,
+ mode, NULL);
}
static int sh_pm_enter(suspend_state_t state)