1
2
3
4
5
6
7
8
9
10
11
12 #ifndef _WM8741_H
13 #define _WM8741_H
14
15
16
17
18 #define WM8741_DACLLSB_ATTENUATION 0x00
19 #define WM8741_DACLMSB_ATTENUATION 0x01
20 #define WM8741_DACRLSB_ATTENUATION 0x02
21 #define WM8741_DACRMSB_ATTENUATION 0x03
22 #define WM8741_VOLUME_CONTROL 0x04
23 #define WM8741_FORMAT_CONTROL 0x05
24 #define WM8741_FILTER_CONTROL 0x06
25 #define WM8741_MODE_CONTROL_1 0x07
26 #define WM8741_MODE_CONTROL_2 0x08
27 #define WM8741_RESET 0x09
28 #define WM8741_ADDITIONAL_CONTROL_1 0x20
29
30 #define WM8741_REGISTER_COUNT 11
31 #define WM8741_MAX_REGISTER 0x20
32
33
34
35
36
37
38
39
40 #define WM8741_UPDATELL 0x0020
41 #define WM8741_UPDATELL_MASK 0x0020
42 #define WM8741_UPDATELL_SHIFT 5
43 #define WM8741_UPDATELL_WIDTH 1
44 #define WM8741_LAT_4_0_MASK 0x001F
45 #define WM8741_LAT_4_0_SHIFT 0
46 #define WM8741_LAT_4_0_WIDTH 5
47
48
49
50
51 #define WM8741_UPDATELM 0x0020
52 #define WM8741_UPDATELM_MASK 0x0020
53 #define WM8741_UPDATELM_SHIFT 5
54 #define WM8741_UPDATELM_WIDTH 1
55 #define WM8741_LAT_9_5_0_MASK 0x001F
56 #define WM8741_LAT_9_5_0_SHIFT 0
57 #define WM8741_LAT_9_5_0_WIDTH 5
58
59
60
61
62 #define WM8741_UPDATERL 0x0020
63 #define WM8741_UPDATERL_MASK 0x0020
64 #define WM8741_UPDATERL_SHIFT 5
65 #define WM8741_UPDATERL_WIDTH 1
66 #define WM8741_RAT_4_0_MASK 0x001F
67 #define WM8741_RAT_4_0_SHIFT 0
68 #define WM8741_RAT_4_0_WIDTH 5
69
70
71
72
73 #define WM8741_UPDATERM 0x0020
74 #define WM8741_UPDATERM_MASK 0x0020
75 #define WM8741_UPDATERM_SHIFT 5
76 #define WM8741_UPDATERM_WIDTH 1
77 #define WM8741_RAT_9_5_0_MASK 0x001F
78 #define WM8741_RAT_9_5_0_SHIFT 0
79 #define WM8741_RAT_9_5_0_WIDTH 5
80
81
82
83
84 #define WM8741_AMUTE 0x0080
85 #define WM8741_AMUTE_MASK 0x0080
86 #define WM8741_AMUTE_SHIFT 7
87 #define WM8741_AMUTE_WIDTH 1
88 #define WM8741_ZFLAG_MASK 0x0060
89 #define WM8741_ZFLAG_SHIFT 5
90 #define WM8741_ZFLAG_WIDTH 2
91 #define WM8741_IZD 0x0010
92 #define WM8741_IZD_MASK 0x0010
93 #define WM8741_IZD_SHIFT 4
94 #define WM8741_IZD_WIDTH 1
95 #define WM8741_SOFT 0x0008
96 #define WM8741_SOFT_MASK 0x0008
97 #define WM8741_SOFT_SHIFT 3
98 #define WM8741_SOFT_WIDTH 1
99 #define WM8741_ATC 0x0004
100 #define WM8741_ATC_MASK 0x0004
101 #define WM8741_ATC_SHIFT 2
102 #define WM8741_ATC_WIDTH 1
103 #define WM8741_ATT2DB 0x0002
104 #define WM8741_ATT2DB_MASK 0x0002
105 #define WM8741_ATT2DB_SHIFT 1
106 #define WM8741_ATT2DB_WIDTH 1
107 #define WM8741_VOL_RAMP 0x0001
108 #define WM8741_VOL_RAMP_MASK 0x0001
109 #define WM8741_VOL_RAMP_SHIFT 0
110 #define WM8741_VOL_RAMP_WIDTH 1
111
112
113
114
115 #define WM8741_PWDN 0x0080
116 #define WM8741_PWDN_MASK 0x0080
117 #define WM8741_PWDN_SHIFT 7
118 #define WM8741_PWDN_WIDTH 1
119 #define WM8741_REV 0x0040
120 #define WM8741_REV_MASK 0x0040
121 #define WM8741_REV_SHIFT 6
122 #define WM8741_REV_WIDTH 1
123 #define WM8741_BCP 0x0020
124 #define WM8741_BCP_MASK 0x0020
125 #define WM8741_BCP_SHIFT 5
126 #define WM8741_BCP_WIDTH 1
127 #define WM8741_LRP 0x0010
128 #define WM8741_LRP_MASK 0x0010
129 #define WM8741_LRP_SHIFT 4
130 #define WM8741_LRP_WIDTH 1
131 #define WM8741_FMT_MASK 0x000C
132 #define WM8741_FMT_SHIFT 2
133 #define WM8741_FMT_WIDTH 2
134 #define WM8741_IWL_MASK 0x0003
135 #define WM8741_IWL_SHIFT 0
136 #define WM8741_IWL_WIDTH 2
137
138
139
140
141 #define WM8741_ZFLAG_HI 0x0080
142 #define WM8741_ZFLAG_HI_MASK 0x0080
143 #define WM8741_ZFLAG_HI_SHIFT 7
144 #define WM8741_ZFLAG_HI_WIDTH 1
145 #define WM8741_DEEMPH_MASK 0x0060
146 #define WM8741_DEEMPH_SHIFT 5
147 #define WM8741_DEEMPH_WIDTH 2
148 #define WM8741_DSDFILT_MASK 0x0018
149 #define WM8741_DSDFILT_SHIFT 3
150 #define WM8741_DSDFILT_WIDTH 2
151 #define WM8741_FIRSEL_MASK 0x0007
152 #define WM8741_FIRSEL_SHIFT 0
153 #define WM8741_FIRSEL_WIDTH 3
154
155
156
157
158 #define WM8741_MODE8X 0x0080
159 #define WM8741_MODE8X_MASK 0x0080
160 #define WM8741_MODE8X_SHIFT 7
161 #define WM8741_MODE8X_WIDTH 1
162 #define WM8741_OSR_MASK 0x0060
163 #define WM8741_OSR_SHIFT 5
164 #define WM8741_OSR_WIDTH 2
165 #define WM8741_SR_MASK 0x001C
166 #define WM8741_SR_SHIFT 2
167 #define WM8741_SR_WIDTH 3
168 #define WM8741_MODESEL_MASK 0x0003
169 #define WM8741_MODESEL_SHIFT 0
170 #define WM8741_MODESEL_WIDTH 2
171
172
173
174
175 #define WM8741_DSD_GAIN 0x0040
176 #define WM8741_DSD_GAIN_MASK 0x0040
177 #define WM8741_DSD_GAIN_SHIFT 6
178 #define WM8741_DSD_GAIN_WIDTH 1
179 #define WM8741_SDOUT 0x0020
180 #define WM8741_SDOUT_MASK 0x0020
181 #define WM8741_SDOUT_SHIFT 5
182 #define WM8741_SDOUT_WIDTH 1
183 #define WM8741_DOUT 0x0010
184 #define WM8741_DOUT_MASK 0x0010
185 #define WM8741_DOUT_SHIFT 4
186 #define WM8741_DOUT_WIDTH 1
187 #define WM8741_DIFF_MASK 0x000C
188 #define WM8741_DIFF_SHIFT 2
189 #define WM8741_DIFF_WIDTH 2
190 #define WM8741_DITHER_MASK 0x0003
191 #define WM8741_DITHER_SHIFT 0
192 #define WM8741_DITHER_WIDTH 2
193
194
195 #define WM8741_DIFF_MODE_STEREO 0
196 #define WM8741_DIFF_MODE_STEREO_REVERSED 2
197 #define WM8741_DIFF_MODE_MONO_LEFT 1
198 #define WM8741_DIFF_MODE_MONO_RIGHT 3
199
200
201
202
203 #define WM8741_DSD_LEVEL 0x0002
204 #define WM8741_DSD_LEVEL_MASK 0x0002
205 #define WM8741_DSD_LEVEL_SHIFT 1
206 #define WM8741_DSD_LEVEL_WIDTH 1
207 #define WM8741_DSD_NO_NOTCH 0x0001
208 #define WM8741_DSD_NO_NOTCH_MASK 0x0001
209 #define WM8741_DSD_NO_NOTCH_SHIFT 0
210 #define WM8741_DSD_NO_NOTCH_WIDTH 1
211
212 #define WM8741_SYSCLK 0
213
214 struct wm8741_platform_data {
215 u32 diff_mode;
216 };
217
218 #endif