diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-24 15:34:20 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-24 18:08:36 -0400 |
commit | d472d1a1c82ade81d2854db2ff4c9694ed66612e (patch) | |
tree | 66b00d6d13a73ef4aff17bb35c72926d4cd12940 /arch/arm/plat-samsung/wakeup-mask.c | |
parent | 9bfe99a8f95122f83f3c894b1071b61e2b6d4990 (diff) | |
parent | d01cd639c96cd683a22432afd4c39ea690c87f16 (diff) |
Merge branch 'for-rmk/samsung3' of git://git.fluff.org/bjdooks/linux into devel-stable
Conflicts:
arch/arm/Kconfig
Diffstat (limited to 'arch/arm/plat-samsung/wakeup-mask.c')
-rw-r--r-- | arch/arm/plat-samsung/wakeup-mask.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/wakeup-mask.c b/arch/arm/plat-samsung/wakeup-mask.c new file mode 100644 index 000000000000..2e09b6ad84ca --- /dev/null +++ b/arch/arm/plat-samsung/wakeup-mask.c | |||
@@ -0,0 +1,47 @@ | |||
1 | /* arch/arm/plat-samsung/wakeup-mask.c | ||
2 | * | ||
3 | * Copyright 2010 Ben Dooks <ben-linux@fluff.org> | ||
4 | * | ||
5 | * Support for wakeup mask interrupts on newer SoCs | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <linux/sysdev.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/irq.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | #include <plat/wakeup-mask.h> | ||
20 | #include <plat/pm.h> | ||
21 | |||
22 | void samsung_sync_wakemask(void __iomem *reg, | ||
23 | struct samsung_wakeup_mask *mask, int nr_mask) | ||
24 | { | ||
25 | struct irq_desc *desc; | ||
26 | u32 val; | ||
27 | |||
28 | val = __raw_readl(reg); | ||
29 | |||
30 | for (; nr_mask > 0; nr_mask--, mask++) { | ||
31 | if (mask->irq == NO_WAKEUP_IRQ) { | ||
32 | val |= mask->bit; | ||
33 | continue; | ||
34 | } | ||
35 | |||
36 | desc = irq_to_desc(mask->irq); | ||
37 | |||
38 | /* bit of a liberty to read this directly from irq_desc. */ | ||
39 | if (desc->wake_depth > 0) | ||
40 | val &= ~mask->bit; | ||
41 | else | ||
42 | val |= mask->bit; | ||
43 | } | ||
44 | |||
45 | printk(KERN_INFO "wakemask %08x => %08x\n", __raw_readl(reg), val); | ||
46 | __raw_writel(val, reg); | ||
47 | } | ||