-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 198520 b: refs/heads/master c: 0317e52 h: refs/heads/master v: v3
- Loading branch information
Ben Dooks
committed
May 20, 2010
1 parent
a55eb9a
commit fb321d8
Showing
5 changed files
with
102 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 1f1f584c9a1dd234041573d2d1c42620b3966607 | ||
refs/heads/master: 0317e52e046f815b4ec4ac7876f63e4eb47696bd |
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,44 @@ | ||
/* arch/arm/plat-samsung/include/plat/wakeup-mask.h | ||
* | ||
* Copyright 2010 Ben Dooks <ben-linux@fluff.org> | ||
* | ||
* Support for wakeup mask interrupts on newer SoCs | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
*/ | ||
|
||
#ifndef __PLAT_WAKEUP_MASK_H | ||
#define __PLAT_WAKEUP_MASK_H __file__ | ||
|
||
/* if no irq yet defined, but still want to mask */ | ||
#define NO_WAKEUP_IRQ (0x90000000) | ||
|
||
/** | ||
* struct samsung_wakeup_mask - wakeup mask information | ||
* @irq: The interrupt associated with this wakeup. | ||
* @bit: The bit, as a (1 << bitno) controlling this source. | ||
*/ | ||
struct samsung_wakeup_mask { | ||
unsigned int irq; | ||
u32 bit; | ||
}; | ||
|
||
/** | ||
* samsung_sync_wakemask - sync wakeup mask information for pm | ||
* @reg: The register that is used. | ||
* @masks: The list of masks to use. | ||
* @nr_masks: The number of entries pointed to buy @masks. | ||
* | ||
* Synchronise the wakeup mask information at suspend time from the list | ||
* of interrupts and control bits in @masks. We do this at suspend time | ||
* as overriding the relevant irq chips is harder and the register is only | ||
* required to be correct before we enter sleep. | ||
*/ | ||
extern void samsung_sync_wakemask(void __iomem *reg, | ||
struct samsung_wakeup_mask *masks, | ||
int nr_masks); | ||
|
||
#endif /* __PLAT_WAKEUP_MASK_H */ |
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,47 @@ | ||
/* arch/arm/plat-samsung/wakeup-mask.c | ||
* | ||
* Copyright 2010 Ben Dooks <ben-linux@fluff.org> | ||
* | ||
* Support for wakeup mask interrupts on newer SoCs | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/spinlock.h> | ||
#include <linux/sysdev.h> | ||
#include <linux/types.h> | ||
#include <linux/irq.h> | ||
#include <linux/io.h> | ||
|
||
#include <plat/wakeup-mask.h> | ||
#include <plat/pm.h> | ||
|
||
void samsung_sync_wakemask(void __iomem *reg, | ||
struct samsung_wakeup_mask *mask, int nr_mask) | ||
{ | ||
struct irq_desc *desc; | ||
u32 val; | ||
|
||
val = __raw_readl(reg); | ||
|
||
for (; nr_mask > 0; nr_mask--, mask++) { | ||
if (mask->irq == NO_WAKEUP_IRQ) { | ||
val |= mask->bit; | ||
continue; | ||
} | ||
|
||
desc = irq_to_desc(mask->irq); | ||
|
||
/* bit of a liberty to read this directly from irq_desc. */ | ||
if (desc->wake_depth > 0) | ||
val &= ~mask->bit; | ||
else | ||
val |= mask->bit; | ||
} | ||
|
||
printk(KERN_INFO "wakemask %08x => %08x\n", __raw_readl(reg), val); | ||
__raw_writel(val, reg); | ||
} |