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