xref: /OK3568_Linux_fs/kernel/arch/arm/mach-s3c/wakeup-mask.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Support for wakeup mask interrupts on newer SoCs
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifndef __PLAT_WAKEUP_MASK_H
9*4882a593Smuzhiyun #define __PLAT_WAKEUP_MASK_H __file__
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun /* if no irq yet defined, but still want to mask */
12*4882a593Smuzhiyun #define NO_WAKEUP_IRQ (0x90000000)
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun /**
15*4882a593Smuzhiyun  * struct samsung_wakeup_mask - wakeup mask information
16*4882a593Smuzhiyun  * @irq: The interrupt associated with this wakeup.
17*4882a593Smuzhiyun  * @bit: The bit, as a (1 << bitno) controlling this source.
18*4882a593Smuzhiyun  */
19*4882a593Smuzhiyun struct samsung_wakeup_mask {
20*4882a593Smuzhiyun 	unsigned int	irq;
21*4882a593Smuzhiyun 	u32		bit;
22*4882a593Smuzhiyun };
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun /**
25*4882a593Smuzhiyun  * samsung_sync_wakemask - sync wakeup mask information for pm
26*4882a593Smuzhiyun  * @reg: The register that is used.
27*4882a593Smuzhiyun  * @masks: The list of masks to use.
28*4882a593Smuzhiyun  * @nr_masks: The number of entries pointed to buy @masks.
29*4882a593Smuzhiyun  *
30*4882a593Smuzhiyun  * Synchronise the wakeup mask information at suspend time from the list
31*4882a593Smuzhiyun  * of interrupts and control bits in @masks. We do this at suspend time
32*4882a593Smuzhiyun  * as overriding the relevant irq chips is harder and the register is only
33*4882a593Smuzhiyun  * required to be correct before we enter sleep.
34*4882a593Smuzhiyun  */
35*4882a593Smuzhiyun extern void samsung_sync_wakemask(void __iomem *reg,
36*4882a593Smuzhiyun 				  const struct samsung_wakeup_mask *masks,
37*4882a593Smuzhiyun 				  int nr_masks);
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun #endif /* __PLAT_WAKEUP_MASK_H */
40