Merge tag 'v3.10.55' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / include / mach / reg_accdet_mt6323.h
1 #include <mach/mt_reg_base.h>
2 //Register address define
3 //#define PMIC_RESERVE_CON2 0xF0007500
4
5 #define ACCDET_BASE 0x00000000
6 #define TOP_RST_ACCDET ACCDET_BASE + 0x0114
7 #define TOP_RST_ACCDET_SET ACCDET_BASE + 0x0116
8 #define TOP_RST_ACCDET_CLR ACCDET_BASE + 0x0118
9
10 #define INT_CON_ACCDET ACCDET_BASE + 0x0166
11 #define INT_CON_ACCDET_SET ACCDET_BASE + 0x0168 //6320 Design
12 #define INT_CON_ACCDET_CLR ACCDET_BASE + 0x016A
13
14 #define INT_STATUS_ACCDET ACCDET_BASE + 0x0174
15
16 //6320 clock register
17 #define TOP_CKPDN ACCDET_BASE + 0x0108
18 #define TOP_CKPDN_SET ACCDET_BASE + 0x010A
19 #define TOP_CKPDN_CLR ACCDET_BASE + 0x010C
20
21
22 #define ACCDET_RSV ACCDET_BASE + 0x077A
23
24 #define ACCDET_CTRL ACCDET_BASE + 0x077C
25 #define ACCDET_STATE_SWCTRL ACCDET_BASE + 0x077E
26 #define ACCDET_PWM_WIDTH ACCDET_BASE + 0x0780
27 #define ACCDET_PWM_THRESH ACCDET_BASE + 0x0782
28 #define ACCDET_EN_DELAY_NUM ACCDET_BASE + 0x0784
29 #define ACCDET_DEBOUNCE0 ACCDET_BASE + 0x0786
30 #define ACCDET_DEBOUNCE1 ACCDET_BASE + 0x0788
31 #define ACCDET_DEBOUNCE2 ACCDET_BASE + 0x078A
32 #define ACCDET_DEBOUNCE3 ACCDET_BASE + 0x078C
33
34 #define ACCDET_DEFAULT_STATE_RG ACCDET_BASE + 0x078E
35
36
37 #define ACCDET_IRQ_STS ACCDET_BASE + 0x0790
38
39 #define ACCDET_CONTROL_RG ACCDET_BASE + 0x0792
40 #define ACCDET_STATE_RG ACCDET_BASE + 0x0794
41
42 #define ACCDET_CUR_DEB ACCDET_BASE + 0x0796
43 #define ACCDET_RSV_CON0 ACCDET_BASE + 0x0798
44 #define ACCDET_RSV_CON1 ACCDET_BASE + 0x079A
45
46
47 /*
48 #define ACCDET_FSM_STATE ACCDET_BASE + 0x50
49 #define ACCDET_CURR_DEBDS ACCDET_BASE + 0x54
50 #define ACCDET_TV_START_LINE0 ACCDET_BASE + 0x58
51 #define ACCDET_TV_END_LINE0 ACCDET_BASE + 0x5C
52 #define ACCDET_TV_START_LINE1 ACCDET_BASE + 0x60
53 #define ACCDET_TV_END_LINE1 ACCDET_BASE + 0x64
54 #define ACCDET_TV_PRE_LINE ACCDET_BASE + 0x68
55 #define ACCDET_TV_START_PXL ACCDET_BASE + 0x6C
56 #define ACCDET_TV_END_PXL ACCDET_BASE + 0x70
57 #define ACCDET_TV_EN_DELAY_NUM ACCDET_BASE + 0x74
58 #define ACCDET_TV_DIV_RATE ACCDET_BASE + 0x78
59 */
60
61
62
63
64 //Register value define
65
66
67 #define ACCDET_CTRL_EN (1<<0)
68 #define ACCDET_MIC_PWM_IDLE (1<<6)
69 #define ACCDET_VTH_PWM_IDLE (1<<5)
70 #define ACCDET_CMP_PWM_IDLE (1<<4)
71 #define ACCDET_CMP_EN (1<<0)
72 #define ACCDET_VTH_EN (1<<1)
73 #define ACCDET_MICBIA_EN (1<<2)
74
75
76 #define ACCDET_ENABLE (1<<0)
77 #define ACCDET_DISABLE (0<<0)
78
79 #define ACCDET_RESET_SET (1<<4)
80 #define ACCDET_RESET_CLR (1<<4)
81
82 #define IRQ_CLR_BIT 0x100
83 #define IRQ_STATUS_BIT (1<<0)
84
85 #define RG_ACCDET_IRQ_SET (1<<2)
86 #define RG_ACCDET_IRQ_CLR (1<<2)
87 #define RG_ACCDET_IRQ_STATUS_CLR (1<<2)
88
89 //CLOCK
90 #define RG_ACCDET_CLK_SET (1<<9)
91 #define RG_ACCDET_CLK_CLR (1<<9)
92
93
94 #define ACCDET_PWM_EN_SW (1<<15)
95 #define ACCDET_MIC_EN_SW (1<<15)
96 #define ACCDET_VTH_EN_SW (1<<15)
97 #define ACCDET_CMP_EN_SW (1<<15)
98
99 #define ACCDET_SWCTRL_EN 0x07
100
101 #define ACCDET_IN_SW 0x10
102
103 #define ACCDET_PWM_SEL_CMP 0x00
104 #define ACCDET_PWM_SEL_VTH 0x01
105 #define ACCDET_PWM_SEL_MIC 0x10
106 #define ACCDET_PWM_SEL_SW 0x11
107 #define ACCDET_SWCTRL_IDLE_EN (0x07<<4)
108
109
110 #define ACCDET_TEST_MODE5_ACCDET_IN_GPI (1<<5)
111 #define ACCDET_TEST_MODE4_ACCDET_IN_SW (1<<4)
112 #define ACCDET_TEST_MODE3_MIC_SW (1<<3)
113 #define ACCDET_TEST_MODE2_VTH_SW (1<<2)
114 #define ACCDET_TEST_MODE1_CMP_SW (1<<1)
115 #define ACCDET_TEST_MODE0_GPI (1<<0)
116
117 //power mode and auxadc switch on/off
118 #define ACCDET_1V9_MODE_OFF 0x1A10
119 #define ACCDET_2V8_MODE_OFF 0x5A10
120 #define ACCDET_1V9_MODE_ON 0x1E10
121 #define ACCDET_2V8_MODE_ON 0x5A20
122
123
124 //#define ACCDET_DEFVAL_SEL (1<<15)
125
126