1
2
3
4
5
6
7
8
9
10 #ifndef __MFD_WM8994_PDATA_H__
11 #define __MFD_WM8994_PDATA_H__
12
13
14 #define WM8904_GPIO_NO_CONFIG 0x8000
15
16
17
18
19 #define WM8904_MICDET_THR_MASK 0x0070
20 #define WM8904_MICDET_THR_SHIFT 4
21 #define WM8904_MICDET_THR_WIDTH 3
22 #define WM8904_MICSHORT_THR_MASK 0x000C
23 #define WM8904_MICSHORT_THR_SHIFT 2
24 #define WM8904_MICSHORT_THR_WIDTH 2
25 #define WM8904_MICDET_ENA 0x0002
26 #define WM8904_MICDET_ENA_MASK 0x0002
27 #define WM8904_MICDET_ENA_SHIFT 1
28 #define WM8904_MICDET_ENA_WIDTH 1
29 #define WM8904_MICBIAS_ENA 0x0001
30 #define WM8904_MICBIAS_ENA_MASK 0x0001
31 #define WM8904_MICBIAS_ENA_SHIFT 0
32 #define WM8904_MICBIAS_ENA_WIDTH 1
33
34
35
36
37 #define WM8904_MIC_DET_FILTER_ENA 0x8000
38 #define WM8904_MIC_DET_FILTER_ENA_MASK 0x8000
39 #define WM8904_MIC_DET_FILTER_ENA_SHIFT 15
40 #define WM8904_MIC_DET_FILTER_ENA_WIDTH 1
41 #define WM8904_MIC_SHORT_FILTER_ENA 0x4000
42 #define WM8904_MIC_SHORT_FILTER_ENA_MASK 0x4000
43 #define WM8904_MIC_SHORT_FILTER_ENA_SHIFT 14
44 #define WM8904_MIC_SHORT_FILTER_ENA_WIDTH 1
45 #define WM8904_MICBIAS_SEL_MASK 0x0007
46 #define WM8904_MICBIAS_SEL_SHIFT 0
47 #define WM8904_MICBIAS_SEL_WIDTH 3
48
49
50
51
52
53 #define WM8904_GPIO1_PU 0x0020
54 #define WM8904_GPIO1_PU_MASK 0x0020
55 #define WM8904_GPIO1_PU_SHIFT 5
56 #define WM8904_GPIO1_PU_WIDTH 1
57 #define WM8904_GPIO1_PD 0x0010
58 #define WM8904_GPIO1_PD_MASK 0x0010
59 #define WM8904_GPIO1_PD_SHIFT 4
60 #define WM8904_GPIO1_PD_WIDTH 1
61 #define WM8904_GPIO1_SEL_MASK 0x000F
62 #define WM8904_GPIO1_SEL_SHIFT 0
63 #define WM8904_GPIO1_SEL_WIDTH 4
64
65
66
67
68 #define WM8904_GPIO2_PU 0x0020
69 #define WM8904_GPIO2_PU_MASK 0x0020
70 #define WM8904_GPIO2_PU_SHIFT 5
71 #define WM8904_GPIO2_PU_WIDTH 1
72 #define WM8904_GPIO2_PD 0x0010
73 #define WM8904_GPIO2_PD_MASK 0x0010
74 #define WM8904_GPIO2_PD_SHIFT 4
75 #define WM8904_GPIO2_PD_WIDTH 1
76 #define WM8904_GPIO2_SEL_MASK 0x000F
77 #define WM8904_GPIO2_SEL_SHIFT 0
78 #define WM8904_GPIO2_SEL_WIDTH 4
79
80
81
82
83 #define WM8904_GPIO3_PU 0x0020
84 #define WM8904_GPIO3_PU_MASK 0x0020
85 #define WM8904_GPIO3_PU_SHIFT 5
86 #define WM8904_GPIO3_PU_WIDTH 1
87 #define WM8904_GPIO3_PD 0x0010
88 #define WM8904_GPIO3_PD_MASK 0x0010
89 #define WM8904_GPIO3_PD_SHIFT 4
90 #define WM8904_GPIO3_PD_WIDTH 1
91 #define WM8904_GPIO3_SEL_MASK 0x000F
92 #define WM8904_GPIO3_SEL_SHIFT 0
93 #define WM8904_GPIO3_SEL_WIDTH 4
94
95
96
97
98 #define WM8904_GPI7_ENA 0x0200
99 #define WM8904_GPI7_ENA_MASK 0x0200
100 #define WM8904_GPI7_ENA_SHIFT 9
101 #define WM8904_GPI7_ENA_WIDTH 1
102 #define WM8904_GPI8_ENA 0x0100
103 #define WM8904_GPI8_ENA_MASK 0x0100
104 #define WM8904_GPI8_ENA_SHIFT 8
105 #define WM8904_GPI8_ENA_WIDTH 1
106 #define WM8904_GPIO_BCLK_MODE_ENA 0x0080
107 #define WM8904_GPIO_BCLK_MODE_ENA_MASK 0x0080
108 #define WM8904_GPIO_BCLK_MODE_ENA_SHIFT 7
109 #define WM8904_GPIO_BCLK_MODE_ENA_WIDTH 1
110 #define WM8904_GPIO_BCLK_SEL_MASK 0x000F
111 #define WM8904_GPIO_BCLK_SEL_SHIFT 0
112 #define WM8904_GPIO_BCLK_SEL_WIDTH 4
113
114 #define WM8904_MIC_REGS 2
115 #define WM8904_GPIO_REGS 4
116 #define WM8904_DRC_REGS 4
117 #define WM8904_EQ_REGS 24
118
119
120
121
122
123
124
125
126
127
128
129 struct wm8904_drc_cfg {
130 const char *name;
131 u16 regs[WM8904_DRC_REGS];
132 };
133
134
135
136
137
138
139
140
141 struct wm8904_retune_mobile_cfg {
142 const char *name;
143 unsigned int rate;
144 u16 regs[WM8904_EQ_REGS];
145 };
146
147 struct wm8904_pdata {
148 int num_drc_cfgs;
149 struct wm8904_drc_cfg *drc_cfgs;
150
151 int num_retune_mobile_cfgs;
152 struct wm8904_retune_mobile_cfg *retune_mobile_cfgs;
153
154 u32 gpio_cfg[WM8904_GPIO_REGS];
155 u32 mic_cfg[WM8904_MIC_REGS];
156 };
157
158 #endif