Merge tag 'v3.10.55' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / include / mach / eint.h
1 #ifndef __EINT_H
2 #define __EINT_H
3
4 /*
5 * Hardware registers and settings.
6 */
7 #define EINT_STA_BASE ((EINT_BASE + 0x000))
8 #define EINT_INTACK_BASE ((EINT_BASE + 0x040))
9 #define EINT_MASK_BASE ((EINT_BASE + 0x080))
10 #define EINT_MASK_SET_BASE ((EINT_BASE + 0x0c0))
11 #define EINT_MASK_CLR_BASE ((EINT_BASE + 0x100))
12 #define EINT_SENS_BASE ((EINT_BASE + 0x140))
13 #define EINT_SENS_SET_BASE ((EINT_BASE + 0x180))
14 #define EINT_SENS_CLR_BASE ((EINT_BASE + 0x1c0))
15 #define EINT_SOFT_BASE ((EINT_BASE + 0x200))
16 #define EINT_SOFT_SET_BASE ((EINT_BASE + 0x240))
17 #define EINT_SOFT_CLR_BASE ((EINT_BASE + 0x280))
18 #define EINT_POL_BASE ((EINT_BASE + 0x300))
19 #define EINT_POL_SET_BASE ((EINT_BASE + 0x340))
20 #define EINT_POL_CLR_BASE ((EINT_BASE + 0x380))
21 #define EINT_D0_EN_BASE ((EINT_BASE + 0x400))
22 #define EINT_D1_EN_BASE ((EINT_BASE + 0x420))
23 #define EINT_D2_EN_BASE ((EINT_BASE + 0x440))
24 #define EINT_DBNC_BASE ((EINT_BASE + 0x500))
25 #define EINT_DBNC_SET_BASE ((EINT_BASE + 0x600))
26 #define EINT_DBNC_CLR_BASE ((EINT_BASE + 0x700))
27 #define DEINT_CON_BASE ((EINT_BASE + 0x800))
28 #define DEINT_SEL_BASE ((EINT_BASE + 0x840))
29 #define DEINT_SEL_SET_BASE ((EINT_BASE + 0x880))
30 #define DEINT_SEL_CLR_BASE ((EINT_BASE + 0x8c0))
31 #define EINT_EEVT_BASE ((EINT_BASE + 0x900))
32 #define EINT_EMUL_BASE ((EINT_BASE + 0xF00))
33 #define EINT_DBNC_SET_DBNC_BITS (4)
34 #define EINT_DBNC_CLR_DBNC_BITS (4)
35 #define EINT_DBNC_SET_EN_BITS (0)
36 #define EINT_DBNC_CLR_EN_BITS (0)
37 #define EINT_DBNC_SET_RST_BITS (1)
38 #define EINT_DBNC_EN_BIT (0x1)
39 #define EINT_DBNC_RST_BIT (0x1)
40 #define EINT_DBNC_0_MS (0x7)
41 #define EINT_DBNC (0x7)
42 #define EINT_DBNC_SET_EN (0x1)
43 #define EINT_DBNC_CLR_EN (0x1)
44 #define EINT_STA_DEFAULT 0x00000000
45 #define EINT_INTACK_DEFAULT 0x00000000
46 #define EINT_EEVT_DEFAULT 0x00000001
47 #define EINT_MASK_DEFAULT 0x00000000
48 #define EINT_MASK_SET_DEFAULT 0x00000000
49 #define EINT_MASK_CLR_DEFAULT 0x00000000
50 #define EINT_SENS_DEFAULT 0x0000FFFF
51 #define EINT_SENS_SET_DEFAULT 0x00000000
52 #define EINT_SENS_CLR_DEFAULT 0x00000000
53 #define EINT_D0EN_DEFAULT 0x00000000
54 #define EINT_D1EN_DEFAULT 0x00000000
55 #define EINT_D2EN_DEFAULT 0x00000000
56 #define EINT_DBNC_DEFAULT(n) 0x00000000
57 #define DEINT_MASK_DEFAULT 0x00000000
58 #define DEINT_MASK_SET_DEFAULT 0x00000000
59 #define DEINT_MASK_CLR_DEFAULT 0x00000000
60
61 /*
62 * Define constants.
63 */
64 #define EINT_AP_MAXNUMBER 169
65 #define EINT_MAX_CHANNEL 169
66 #define DEINT_MAX_CHANNEL 15
67 #define MT_EINT_POL_NEG (0)
68 #define MT_EINT_POL_POS (1)
69 #define MAX_HW_DEBOUNCE_CNT 16
70 #define MAX_DEINT_CNT 8
71 #define EINTF_TRIGGER_RISING 0x00000001
72 #define EINTF_TRIGGER_FALLING 0x00000002
73 #define EINTF_TRIGGER_HIGH 0x00000004
74 #define EINTF_TRIGGER_LOW 0x00000008
75
76 /*
77 * Define function prototypes.
78 */
79 extern void mt_eint_mask(unsigned int eint_num);
80 extern void mt_eint_unmask(unsigned int eint_num);
81 extern void mt_eint_set_hw_debounce(unsigned int eint_num, unsigned int ms);
82 extern void mt_eint_set_polarity(unsigned int eint_num, unsigned int pol);
83 extern unsigned int mt_eint_set_sens(unsigned int eint_num, unsigned int sens);
84 extern void mt_eint_registration(unsigned int eint_num, unsigned int flow, void (EINT_FUNC_PTR)(void), unsigned int is_auto_umask);
85 extern void mt_eint_print_status(void);
86
87 #endif