mb/ocp/tiogapass: Fix GPIOs
[coreboot2.git] / src / mainboard / system76 / oryp5 / tas5825m.c
blob384548d623d40f319bbdbddffc2646c19568aaac
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <delay.h>
4 #include <drivers/i2c/tas5825m/tas5825m.h>
6 static int program_dsp_ram(struct device *dev)
8 int res;
10 res = tas5825m_set_book(dev, 0x64);
11 if (res < 0)
12 return res;
14 res = tas5825m_set_page(dev, 0x01);
15 if (res < 0)
16 return res;
19 const uint8_t values[] = {
20 0x00, 0xFE, 0x00, 0x40, 0x00, 0xFC, 0x00, 0x00,
21 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
22 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
23 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
24 0x00, 0xFC, 0x50, 0x00, 0x00, 0xFC, 0x00, 0x00,
25 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
26 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
27 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
28 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
29 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
30 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
31 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
32 0x00, 0x82, 0x00, 0x93, 0x00, 0xFC, 0x00, 0x00,
33 0x84, 0xC1, 0x02, 0x9F, 0x08, 0x18, 0x10, 0x00,
34 0x02, 0x28, 0x00, 0x03, 0x8F, 0x00, 0xFF, 0xF8,
36 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
37 if (res < 0)
38 return res;
41 res = tas5825m_set_page(dev, 0x02);
42 if (res < 0)
43 return res;
46 const uint8_t values[] = {
47 0x02, 0x60, 0x00, 0x01, 0x84, 0xA0, 0x02, 0x00,
48 0x84, 0x02, 0x04, 0x03, 0x00, 0x26, 0x20, 0x96,
49 0x84, 0xA2, 0x04, 0x02, 0x84, 0xC1, 0x02, 0xBC,
50 0x84, 0x49, 0x03, 0x64, 0x08, 0xFC, 0x0C, 0x99,
51 0x02, 0x70, 0x00, 0x04, 0x84, 0xC1, 0x02, 0xBD,
52 0xE0, 0x10, 0x31, 0xAD, 0x84, 0xCA, 0x20, 0xE0,
53 0xF0, 0x1C, 0x31, 0xAE, 0xF0, 0x1C, 0x31, 0xAF,
54 0x02, 0x68, 0x00, 0x03, 0xF0, 0x1C, 0x31, 0xB0,
55 0xF0, 0x1D, 0x31, 0xB1, 0x02, 0x78, 0x00, 0x02,
56 0x84, 0x41, 0x03, 0x78, 0x80, 0x27, 0x80, 0xF9,
57 0x08, 0xFC, 0x0C, 0x98, 0x84, 0x83, 0x03, 0x6A,
58 0xE0, 0x10, 0x11, 0xAD, 0x84, 0xC2, 0x00, 0xE0,
59 0xF0, 0x1C, 0x11, 0xAE, 0xF0, 0x1C, 0x11, 0xAF,
60 0xF0, 0x1C, 0x11, 0xB0, 0xF0, 0x1D, 0x11, 0xB1,
61 0x84, 0x59, 0x03, 0x65, 0x80, 0x27, 0x80, 0xF8,
63 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
64 if (res < 0)
65 return res;
68 res = tas5825m_set_page(dev, 0x03);
69 if (res < 0)
70 return res;
73 const uint8_t values[] = {
74 0x84, 0x83, 0x03, 0x6B, 0xE2, 0x57, 0x91, 0xB2,
75 0x84, 0xC1, 0x02, 0xBD, 0x84, 0x82, 0x60, 0xE0,
76 0xF0, 0x1C, 0x71, 0xB3, 0xF0, 0x1C, 0x71, 0xB4,
77 0xF0, 0x1C, 0x71, 0xB5, 0xF0, 0x1D, 0x71, 0xB6,
78 0x84, 0x51, 0x03, 0x79, 0x80, 0x27, 0x80, 0xFB,
79 0x84, 0x83, 0x03, 0x6C, 0xE0, 0x10, 0x11, 0xB2,
80 0x84, 0xC2, 0x40, 0xE0, 0xF0, 0x1C, 0x51, 0xB3,
81 0xF0, 0x1C, 0x51, 0xB4, 0xF0, 0x1C, 0x51, 0xB5,
82 0xF0, 0x1D, 0x51, 0xB6, 0x84, 0x4B, 0x03, 0x64,
83 0x84, 0x49, 0x03, 0x77, 0x86, 0xA1, 0x01, 0xB7,
84 0x84, 0x43, 0x03, 0x78, 0x02, 0x11, 0xFF, 0xFC,
85 0x84, 0x41, 0x03, 0x7E, 0x80, 0x27, 0x80, 0xFA,
86 0x84, 0x83, 0x03, 0x6D, 0xE2, 0x57, 0x80, 0x00,
87 0x84, 0xC1, 0x02, 0xBD, 0x84, 0x82, 0x20, 0xE0,
88 0xF0, 0x1C, 0x31, 0xB8, 0xF0, 0x1C, 0x31, 0xB9,
90 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
91 if (res < 0)
92 return res;
95 res = tas5825m_set_page(dev, 0x04);
96 if (res < 0)
97 return res;
100 const uint8_t values[] = {
101 0xF0, 0x1C, 0x31, 0xBA, 0xF0, 0x1D, 0x31, 0xBB,
102 0x86, 0xA1, 0x01, 0xB7, 0x80, 0x27, 0x80, 0xF9,
103 0x84, 0x83, 0x03, 0x6E, 0xE0, 0x10, 0x00, 0x00,
104 0x84, 0xC2, 0x00, 0xE0, 0xF0, 0x1C, 0x11, 0xB8,
105 0xF0, 0x1C, 0x11, 0xB9, 0xF0, 0x1C, 0x11, 0xBA,
106 0xF0, 0x1D, 0x11, 0xBB, 0x86, 0xA1, 0x01, 0x9D,
107 0x80, 0x27, 0x80, 0xF8, 0x84, 0x83, 0x03, 0x6F,
108 0x84, 0x5B, 0x03, 0x65, 0x66, 0x6D, 0x60, 0x00,
109 0xEE, 0x64, 0x80, 0x00, 0x02, 0xC3, 0x00, 0x10,
110 0x62, 0x6D, 0x40, 0x00, 0xEA, 0x64, 0x60, 0x00,
111 0x02, 0xD3, 0x00, 0x10, 0x88, 0x47, 0x00, 0x81,
112 0x09, 0x07, 0x08, 0x88, 0x08, 0xFC, 0x28, 0x53,
113 0x0D, 0x00, 0x10, 0x18, 0x84, 0xC3, 0x03, 0x24,
114 0x08, 0x60, 0x28, 0x50, 0x84, 0x80, 0x04, 0x02,
115 0xE4, 0x00, 0x00, 0x80, 0x86, 0xC1, 0x01, 0x9F,
117 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
118 if (res < 0)
119 return res;
122 res = tas5825m_set_page(dev, 0x05);
123 if (res < 0)
124 return res;
127 const uint8_t values[] = {
128 0x88, 0x47, 0x20, 0x81, 0x0D, 0x00, 0x10, 0x20,
129 0x84, 0x53, 0x03, 0x79, 0x84, 0x4B, 0x03, 0x77,
130 0x84, 0x43, 0x03, 0x7E, 0x00, 0x42, 0x20, 0x85,
131 0x84, 0xDB, 0x03, 0x23, 0x08, 0xFC, 0x38, 0x10,
132 0x02, 0x48, 0x02, 0xBC, 0x02, 0x40, 0x02, 0xBD,
133 0xE4, 0x10, 0x11, 0x9E, 0x00, 0xFE, 0x20, 0x88,
134 0x88, 0x6C, 0x00, 0x00, 0x02, 0x48, 0x02, 0xBC,
135 0x02, 0x40, 0x02, 0xBD, 0x02, 0x80, 0x00, 0x00,
136 0x84, 0xA1, 0x03, 0x6F, 0xE4, 0x00, 0x00, 0x00,
137 0x84, 0xA1, 0x03, 0x6E, 0x84, 0xD1, 0x03, 0x6C,
138 0xE0, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x82,
139 0x84, 0xC9, 0x03, 0x6D, 0x88, 0x07, 0x00, 0x80,
140 0xEC, 0x00, 0x00, 0x81, 0x10, 0x00, 0x18, 0x01,
141 0x88, 0x47, 0x00, 0x80, 0x02, 0x50, 0x02, 0xBC,
142 0x00, 0xFE, 0x20, 0x99, 0x0C, 0x20, 0x08, 0x20,
144 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
145 if (res < 0)
146 return res;
149 res = tas5825m_set_page(dev, 0x06);
150 if (res < 0)
151 return res;
154 const uint8_t values[] = {
155 0x02, 0x78, 0x00, 0x02, 0x02, 0x50, 0x02, 0xBC,
156 0x02, 0x40, 0x02, 0xBD, 0x02, 0x70, 0x00, 0x06,
157 0x84, 0x59, 0x03, 0x4F, 0xE2, 0x57, 0x91, 0xBC,
158 0x02, 0xC3, 0x00, 0x10, 0x84, 0xC9, 0x02, 0xBD,
159 0x84, 0xC2, 0x60, 0xE0, 0xF0, 0x1C, 0x71, 0xBD,
160 0xF0, 0x1C, 0x71, 0xBE, 0x02, 0x68, 0x00, 0x05,
161 0xF0, 0x1C, 0x71, 0xBF, 0xF0, 0x1D, 0x71, 0xC0,
162 0xE4, 0x00, 0x11, 0xC3, 0x80, 0x27, 0x80, 0xE3,
163 0xF4, 0x00, 0x11, 0xC1, 0xF4, 0x1F, 0x71, 0xC2,
164 0xF4, 0x1C, 0x71, 0xC4, 0xF4, 0x1D, 0x71, 0xC5,
165 0x84, 0x49, 0x03, 0x57, 0x80, 0x67, 0x80, 0xFB,
166 0x02, 0xD3, 0x00, 0x10, 0xE0, 0x10, 0x31, 0xBC,
167 0x84, 0xCA, 0x20, 0xE0, 0xF0, 0x1C, 0x31, 0xBD,
168 0xF0, 0x1C, 0x31, 0xBE, 0xF0, 0x1C, 0x31, 0xBF,
169 0xF0, 0x1D, 0x31, 0xC0, 0xE4, 0x00, 0x11, 0xC3,
171 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
172 if (res < 0)
173 return res;
176 res = tas5825m_set_page(dev, 0x07);
177 if (res < 0)
178 return res;
181 const uint8_t values[] = {
182 0x80, 0x27, 0x80, 0xE1, 0xF4, 0x00, 0x11, 0xC1,
183 0xF4, 0x1F, 0x31, 0xC2, 0xF4, 0x1C, 0x31, 0xC4,
184 0xF4, 0x1D, 0x31, 0xC5, 0x84, 0xC2, 0x04, 0x05,
185 0x08, 0xFC, 0x58, 0x10, 0x80, 0x67, 0x80, 0xF9,
186 0x02, 0xD3, 0x00, 0x10, 0x84, 0xCA, 0x04, 0x04,
187 0x08, 0xFC, 0x58, 0x31, 0x84, 0xCA, 0x04, 0x06,
188 0x08, 0x00, 0x0A, 0x21, 0x84, 0xC2, 0x04, 0x07,
189 0x08, 0x00, 0x0A, 0x00, 0xE4, 0x10, 0x31, 0xA3,
190 0xE0, 0x10, 0x00, 0x00, 0xEA, 0x65, 0x60, 0x00,
191 0x02, 0xC3, 0x00, 0x10, 0xEE, 0x65, 0x80, 0x00,
192 0x02, 0xCB, 0x00, 0x10, 0x88, 0x47, 0x00, 0x82,
193 0x09, 0x07, 0x09, 0x31, 0x08, 0xFC, 0x48, 0x13,
194 0x0D, 0x00, 0x10, 0x38, 0x84, 0xCB, 0x03, 0x2C,
195 0x08, 0x60, 0x48, 0x11, 0x84, 0x80, 0x04, 0x02,
196 0xE4, 0x00, 0x00, 0x81, 0x02, 0x28, 0x00, 0x02,
198 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
199 if (res < 0)
200 return res;
203 res = tas5825m_set_page(dev, 0x08);
204 if (res < 0)
205 return res;
208 const uint8_t values[] = {
209 0x88, 0x67, 0x20, 0x00, 0xE4, 0x00, 0x02, 0x00,
210 0x84, 0xDB, 0x03, 0x2B, 0x80, 0x48, 0x00, 0x81,
211 0x86, 0xD9, 0x01, 0xA9, 0x86, 0xC1, 0x01, 0xAA,
212 0x0D, 0x00, 0x10, 0x38, 0x08, 0xFC, 0x3C, 0x12,
213 0x84, 0x5B, 0x03, 0x4F, 0x84, 0x4B, 0x03, 0x57,
214 0x84, 0xD2, 0x04, 0x02, 0x00, 0x62, 0x20, 0xE4,
215 0x86, 0xD1, 0x01, 0xAC, 0x0D, 0x00, 0x10, 0x20,
216 0x86, 0xC9, 0x01, 0xA8, 0x86, 0xC1, 0x01, 0xA7,
217 0x00, 0xFE, 0x20, 0xE8, 0x08, 0x44, 0x26, 0x30,
218 0x08, 0xFC, 0x3C, 0x71, 0x86, 0xC1, 0x01, 0xA6,
219 0x84, 0xCA, 0x04, 0x02, 0x86, 0xD1, 0x01, 0xAB,
220 0x84, 0x80, 0x04, 0x02, 0xE4, 0x00, 0x00, 0x80,
221 0x88, 0x40, 0x00, 0x80, 0x08, 0xFC, 0x08, 0x50,
222 0x02, 0x28, 0x00, 0x01, 0x02, 0xA3, 0x00, 0x18,
223 0xE4, 0x40, 0x00, 0x00, 0x88, 0xC8, 0x00, 0x82,
225 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
226 if (res < 0)
227 return res;
230 res = tas5825m_set_page(dev, 0x09);
231 if (res < 0)
232 return res;
235 const uint8_t values[] = {
236 0x84, 0xC9, 0x03, 0x2D, 0x86, 0xC1, 0x01, 0xA5,
237 0x86, 0xD9, 0x01, 0xA4, 0x0D, 0x00, 0x10, 0x48,
238 0x08, 0x44, 0x06, 0x13, 0x86, 0xC1, 0x01, 0xEF,
239 0x84, 0x49, 0x03, 0x37, 0x00, 0xFC, 0x00, 0x00,
240 0xE4, 0x10, 0x40, 0x83, 0xEC, 0x10, 0x20, 0x00,
241 0x88, 0x47, 0x00, 0x82, 0x04, 0x80, 0xA8, 0xB3,
242 0x84, 0x80, 0x04, 0x07, 0xE4, 0x00, 0x00, 0x83,
243 0x84, 0xDB, 0x03, 0x2D, 0x88, 0x40, 0x00, 0x83,
244 0x10, 0x00, 0x1A, 0x22, 0xE4, 0x80, 0xC0, 0x00,
245 0x88, 0x40, 0x00, 0x81, 0x84, 0xD8, 0x04, 0x04,
246 0x0C, 0x20, 0x08, 0x39, 0x86, 0xD1, 0x01, 0xF0,
247 0x84, 0x81, 0x02, 0xBC, 0x86, 0xC9, 0x01, 0xF1,
248 0xE0, 0x00, 0x11, 0xC7, 0x84, 0x82, 0x20, 0xE0,
249 0x84, 0x82, 0x04, 0x02, 0xF0, 0x1C, 0x31, 0xC8,
250 0xF0, 0x1C, 0x31, 0xC9, 0xF0, 0x1C, 0x31, 0xCA,
252 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
253 if (res < 0)
254 return res;
257 res = tas5825m_set_page(dev, 0x0A);
258 if (res < 0)
259 return res;
262 const uint8_t values[] = {
263 0xF0, 0x1D, 0x31, 0xCB, 0xE4, 0x00, 0x11, 0xCE,
264 0x80, 0x27, 0x80, 0xE1, 0xF4, 0x00, 0x11, 0xCC,
265 0xF4, 0x1F, 0x31, 0xCD, 0xF4, 0x1C, 0x31, 0xCF,
266 0xF4, 0x1D, 0x31, 0xD0, 0x84, 0x41, 0x03, 0x2F,
267 0x80, 0x67, 0x80, 0xF9, 0x02, 0xDB, 0x00, 0x10,
268 0x8F, 0x30, 0x00, 0x00, 0x0C, 0x1C, 0x11, 0x74,
269 0x08, 0x64, 0x66, 0x72, 0x0D, 0x00, 0x10, 0x40,
270 0x08, 0x44, 0x06, 0x12, 0x84, 0xD2, 0x41, 0x00,
271 0xE0, 0x10, 0x51, 0xD1, 0xF0, 0x1C, 0x11, 0xD2,
272 0xF0, 0x1C, 0x11, 0xD3, 0xF0, 0x1C, 0x11, 0xD4,
273 0xF0, 0x1D, 0x11, 0xD5, 0xE4, 0x00, 0x11, 0xD8,
274 0x80, 0x27, 0x80, 0xE0, 0xF4, 0x00, 0x11, 0xD6,
275 0xF4, 0x20, 0x11, 0xD7, 0x84, 0x84, 0x00, 0xF8,
276 0xF4, 0x1C, 0x11, 0xD9, 0x84, 0x4B, 0x03, 0x37,
277 0xF4, 0x1D, 0x11, 0xDA, 0x84, 0x49, 0x03, 0x5F,
279 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
280 if (res < 0)
281 return res;
284 res = tas5825m_set_page(dev, 0x0B);
285 if (res < 0)
286 return res;
289 const uint8_t values[] = {
290 0x80, 0x67, 0x80, 0xF8, 0xE0, 0x00, 0x11, 0xDB,
291 0x84, 0x82, 0x21, 0x00, 0x84, 0x82, 0x20, 0xE0,
292 0xF0, 0x1C, 0x31, 0xDC, 0xF0, 0x1C, 0x31, 0xDD,
293 0xF0, 0x1C, 0x31, 0xDE, 0xF0, 0x1D, 0x31, 0xDF,
294 0xE4, 0x00, 0x11, 0xE2, 0x80, 0x27, 0x80, 0xE1,
295 0xF4, 0x00, 0x11, 0xE0, 0xF4, 0x1F, 0x31, 0xE1,
296 0xF4, 0x1C, 0x31, 0xE3, 0xF4, 0x1D, 0x31, 0xE4,
297 0x84, 0x51, 0x03, 0x60, 0x80, 0x67, 0x80, 0xF9,
298 0xE4, 0x00, 0x00, 0x81, 0xE0, 0x80, 0x51, 0xE5,
299 0x84, 0x82, 0x40, 0xE0, 0xF0, 0x1C, 0x51, 0xE6,
300 0xF0, 0x1C, 0x51, 0xE7, 0xF0, 0x1C, 0x51, 0xE8,
301 0x88, 0x47, 0x00, 0x80, 0xF0, 0x1D, 0x51, 0xE9,
302 0xE4, 0x00, 0x11, 0xEC, 0x80, 0x27, 0x80, 0xE2,
303 0xF4, 0x00, 0x11, 0xEA, 0xF4, 0x1F, 0x51, 0xEB,
304 0xF4, 0x1C, 0x51, 0xED, 0xF4, 0x1D, 0x51, 0xEE,
306 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
307 if (res < 0)
308 return res;
311 res = tas5825m_set_page(dev, 0x0C);
312 if (res < 0)
313 return res;
316 const uint8_t values[] = {
317 0x02, 0x58, 0x02, 0xBC, 0x08, 0xFC, 0x0D, 0x18,
318 0x80, 0x67, 0x80, 0xFA, 0x02, 0xD3, 0x00, 0x10,
319 0x10, 0x00, 0x18, 0x03, 0x84, 0x43, 0x03, 0x2F,
320 0x84, 0x4B, 0x03, 0x5F, 0x84, 0x53, 0x03, 0x60,
321 0x84, 0x41, 0x03, 0x47, 0x84, 0x51, 0x03, 0x3F,
322 0x84, 0xC1, 0x02, 0xBD, 0x00, 0xFC, 0x00, 0x00,
323 0x02, 0x48, 0x02, 0xBD, 0x02, 0x11, 0xFF, 0xF8,
324 0x86, 0xD1, 0x01, 0xEF, 0x86, 0xC9, 0x01, 0xF0,
325 0x86, 0x1D, 0x01, 0xF1, 0xE0, 0x10, 0x11, 0xC7,
326 0x86, 0xA1, 0x01, 0xC8, 0x84, 0xC2, 0x00, 0xE0,
327 0xF0, 0x1C, 0x00, 0x00, 0xF0, 0x1C, 0x11, 0xC9,
328 0xF0, 0x1C, 0x11, 0xCA, 0xF0, 0x1D, 0x11, 0xCB,
329 0xE4, 0x00, 0x11, 0xCE, 0x80, 0x27, 0x80, 0xE0,
330 0x84, 0x1E, 0x04, 0x02, 0x02, 0x78, 0x00, 0x02,
331 0xF4, 0x00, 0x11, 0xCC, 0xF4, 0x1F, 0x11, 0xCD,
333 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
334 if (res < 0)
335 return res;
338 res = tas5825m_set_page(dev, 0x0D);
339 if (res < 0)
340 return res;
343 const uint8_t values[] = {
344 0xF4, 0x1C, 0x11, 0xCF, 0xF4, 0x1D, 0x11, 0xD0,
345 0x86, 0xA1, 0x01, 0xD1, 0x80, 0x67, 0x80, 0xF8,
346 0x84, 0x43, 0x03, 0x47, 0x84, 0x59, 0x03, 0x62,
347 0x8F, 0xA0, 0x00, 0x00, 0x02, 0xDB, 0x00, 0x10,
348 0x0C, 0x1C, 0x51, 0x6C, 0x08, 0x64, 0x66, 0x71,
349 0x0D, 0x00, 0x10, 0x30, 0x08, 0x44, 0x46, 0x51,
350 0x84, 0xCA, 0x01, 0x00, 0xE0, 0x10, 0x20, 0x00,
351 0xF0, 0x1C, 0x51, 0xD2, 0xF0, 0x1C, 0x51, 0xD3,
352 0xF0, 0x1C, 0x51, 0xD4, 0xF0, 0x1D, 0x51, 0xD5,
353 0xE4, 0x00, 0x11, 0xD8, 0x80, 0x27, 0x80, 0xE2,
354 0xF4, 0x00, 0x11, 0xD6, 0xF4, 0x1F, 0x51, 0xD7,
355 0xF4, 0x1C, 0x51, 0xD9, 0xF4, 0x1D, 0x51, 0xDA,
356 0x84, 0x41, 0x03, 0x61, 0x80, 0x67, 0x80, 0xFA,
357 0xE0, 0x00, 0x11, 0xDB, 0x84, 0x82, 0x01, 0x00,
358 0x84, 0x82, 0x00, 0xE0, 0xF0, 0x1C, 0x11, 0xDC,
360 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
361 if (res < 0)
362 return res;
365 res = tas5825m_set_page(dev, 0x0E);
366 if (res < 0)
367 return res;
370 const uint8_t values[] = {
371 0xF0, 0x1C, 0x11, 0xDD, 0xF0, 0x1C, 0x11, 0xDE,
372 0xF0, 0x1D, 0x11, 0xDF, 0xE4, 0x00, 0x11, 0xE2,
373 0x80, 0x27, 0x80, 0xE0, 0xF4, 0x00, 0x11, 0xE0,
374 0xF4, 0x1F, 0x11, 0xE1, 0xF4, 0x1C, 0x11, 0xE3,
375 0x02, 0x83, 0x00, 0x18, 0x84, 0xC2, 0x60, 0xE0,
376 0x86, 0xC1, 0x01, 0xE4, 0xE0, 0x00, 0x11, 0xE5,
377 0xF4, 0x1D, 0x00, 0x80, 0x84, 0xA0, 0x04, 0x02,
378 0x80, 0x67, 0x80, 0xF8, 0xE4, 0x00, 0x00, 0x00,
379 0xF0, 0x1C, 0x71, 0xE6, 0xF0, 0x1C, 0x71, 0xE7,
380 0xF0, 0x1C, 0x71, 0xE8, 0xF0, 0x1D, 0x71, 0xE9,
381 0x86, 0xA1, 0x01, 0xEC, 0x88, 0x47, 0x00, 0x80,
382 0xE4, 0x00, 0x00, 0x00, 0x80, 0x27, 0x80, 0xE3,
383 0xF4, 0x00, 0x11, 0xEA, 0xF4, 0x1F, 0x71, 0xEB,
384 0xF4, 0x1C, 0x71, 0xED, 0xF4, 0x1D, 0x71, 0xEE,
385 0x86, 0xC9, 0x01, 0xA1, 0x80, 0x67, 0x80, 0xFB,
387 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
388 if (res < 0)
389 return res;
392 res = tas5825m_set_page(dev, 0x0F);
393 if (res < 0)
394 return res;
397 const uint8_t values[] = {
398 0x84, 0x5B, 0x03, 0x62, 0x08, 0x00, 0x10, 0x20,
399 0x02, 0xD3, 0x00, 0x10, 0x84, 0x53, 0x03, 0x3F,
400 0x84, 0x43, 0x03, 0x61, 0x08, 0xFC, 0x0D, 0x18,
401 0x02, 0x50, 0x02, 0xBD, 0x00, 0x26, 0x21, 0xB7,
402 0x10, 0x00, 0x18, 0x01, 0x86, 0xC1, 0x01, 0xC6,
403 0x84, 0xC3, 0x03, 0x63, 0x02, 0xC0, 0x03, 0x63,
404 0x84, 0x52, 0x04, 0x00, 0x02, 0x48, 0x02, 0xBC,
405 0x84, 0xC2, 0x04, 0x01, 0x00, 0xFF, 0x10, 0xB0,
406 0x8C, 0xFF, 0x02, 0xBC, 0x00, 0xFE, 0x21, 0xDA,
407 0x00, 0xFC, 0x00, 0x00, 0x86, 0xC9, 0x01, 0xA0,
408 0x84, 0x81, 0x02, 0xBC, 0x02, 0xA3, 0x00, 0x10,
409 0xE4, 0x00, 0x00, 0x00, 0x84, 0x81, 0x02, 0xBD,
410 0x88, 0x47, 0x13, 0x25, 0x02, 0xA3, 0x00, 0x10,
411 0xE4, 0x00, 0x00, 0x00, 0x88, 0x47, 0x13, 0x26,
412 0x02, 0x40, 0x03, 0x28, 0x84, 0xC1, 0x03, 0x25,
414 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
415 if (res < 0)
416 return res;
419 res = tas5825m_set_page(dev, 0x10);
420 if (res < 0)
421 return res;
424 const uint8_t values[] = {
425 0x00, 0xFF, 0x11, 0x4E, 0x00, 0xFC, 0x00, 0x00,
426 0x02, 0x40, 0x03, 0x29, 0x86, 0xC9, 0x01, 0xA0,
427 0x84, 0xC1, 0x03, 0x26, 0x00, 0xFF, 0x11, 0x4E,
428 0x00, 0xFC, 0x00, 0x00, 0x86, 0xC1, 0x01, 0xA2,
429 0x84, 0xC3, 0x03, 0x2A, 0x02, 0xC0, 0x03, 0x29,
430 0x02, 0xC8, 0x03, 0x26, 0x02, 0x40, 0x03, 0x28,
431 0x02, 0x48, 0x03, 0x25, 0x02, 0x50, 0x03, 0x2A,
432 0x84, 0xC2, 0x04, 0x00, 0x84, 0xCA, 0x04, 0x01,
433 0x00, 0xFF, 0x21, 0xDF, 0x00, 0xFC, 0x00, 0x00,
434 0x84, 0xA1, 0x02, 0xBC, 0xE6, 0x64, 0xA0, 0x00,
435 0x88, 0x47, 0x12, 0xBC, 0x84, 0xA1, 0x03, 0x26,
436 0xE6, 0x57, 0xA0, 0x00, 0x88, 0x47, 0x12, 0xBD,
437 0x84, 0x00, 0x04, 0x03, 0x00, 0xFC, 0x00, 0x00,
438 0x02, 0xC0, 0x00, 0x00, 0x00, 0xFC, 0x50, 0x00,
439 0x8F, 0x00, 0x00, 0x08, 0x8F, 0x00, 0xFF, 0xFF,
441 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
442 if (res < 0)
443 return res;
446 res = tas5825m_set_page(dev, 0x11);
447 if (res < 0)
448 return res;
451 const uint8_t values[] = {
452 0x84, 0x58, 0x04, 0x01, 0x84, 0xA1, 0x03, 0x68,
453 0x84, 0xC1, 0x03, 0x67, 0xE0, 0xE0, 0x00, 0x00,
454 0x02, 0xCA, 0x60, 0x00, 0x40, 0x40, 0xA0, 0x00,
455 0x80, 0x00, 0xC0, 0x82, 0x08, 0xFC, 0x48, 0x3A,
456 0x08, 0xFC, 0x38, 0x52, 0x84, 0x58, 0x04, 0x02,
457 0xE0, 0x10, 0x40, 0x00, 0x84, 0xA0, 0x41, 0x00,
458 0x40, 0x47, 0x20, 0x00, 0x02, 0xD3, 0x00, 0x10,
459 0x84, 0xA2, 0x04, 0x00, 0x84, 0xA1, 0x03, 0x66,
460 0xE4, 0x20, 0x00, 0x00, 0x08, 0x00, 0x28, 0x42,
461 0x45, 0x40, 0xA0, 0x00, 0x80, 0x40, 0xC0, 0x83,
462 0x08, 0xFC, 0x68, 0x3B, 0x08, 0xFC, 0x38, 0x71,
463 0x84, 0xD3, 0x03, 0x68, 0xE4, 0x10, 0x20, 0x00,
464 0x84, 0xA0, 0x04, 0x00, 0x45, 0x47, 0x20, 0x00,
465 0x02, 0xD3, 0x00, 0x10, 0x80, 0x40, 0xC0, 0x81,
466 0x0D, 0x00, 0x10, 0x20, 0x08, 0x00, 0x28, 0x42,
468 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
469 if (res < 0)
470 return res;
473 res = tas5825m_set_page(dev, 0x12);
474 if (res < 0)
475 return res;
478 const uint8_t values[] = {
479 0x84, 0xD3, 0x03, 0x66, 0x86, 0xD1, 0x01, 0x9C,
480 0x86, 0xD9, 0x01, 0x9B, 0x08, 0xFC, 0x3C, 0x11,
481 0x08, 0x44, 0x46, 0x53, 0x00, 0xFC, 0x00, 0x00,
482 0x02, 0x83, 0x00, 0x19, 0x02, 0xA3, 0x00, 0x1B,
483 0x80, 0x00, 0xC0, 0x83, 0x84, 0xC9, 0x03, 0x69,
484 0x0D, 0x00, 0x10, 0x68, 0x08, 0xFC, 0x7C, 0x33,
485 0xE0, 0x00, 0x00, 0x00, 0x02, 0x83, 0x00, 0x1B,
486 0x86, 0xD9, 0x01, 0x9B, 0x08, 0x44, 0x46, 0x53,
487 0x80, 0x07, 0x00, 0x82, 0xE0, 0x00, 0x00, 0x83,
488 0x80, 0x07, 0x00, 0x83, 0x0C, 0x60, 0x0C, 0x10,
489 0x0C, 0xE0, 0x0C, 0x39, 0x84, 0xC3, 0x03, 0x67,
490 0x84, 0xCB, 0x03, 0x69, 0x00, 0xFC, 0x50, 0x00,
491 0x8F, 0x00, 0x00, 0x01,
493 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
494 if (res < 0)
495 return res;
498 return 0;
501 static int program_biquad_filters(struct device *dev)
503 int res;
505 res = tas5825m_set_book(dev, 0xAA);
506 if (res < 0)
507 return res;
509 res = tas5825m_set_page(dev, 0x01);
510 if (res < 0)
511 return res;
514 const uint8_t values[] = {
515 0x07, 0xED, 0x50, 0x78, 0xF0, 0xBB, 0x11, 0x75,
516 0x07, 0x5C, 0xFB, 0x5D, 0x0F, 0x44, 0xEE, 0x8B,
517 0xF8, 0xB5, 0xB4, 0x2B, 0x07, 0xE4, 0x94, 0x67,
518 0xF1, 0x16, 0x72, 0x2F, 0x07, 0x10, 0xC7, 0x66,
519 0x0E, 0xE9, 0x8D, 0xD1, 0xF9, 0x0A, 0xA4, 0x33,
520 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
521 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
522 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
523 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
524 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
526 res = tas5825m_write_block_at(dev, 0x30, values, ARRAY_SIZE(values));
527 if (res < 0)
528 return res;
531 res = tas5825m_set_page(dev, 0x02);
532 if (res < 0)
533 return res;
536 const uint8_t values[] = {
537 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
538 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
539 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
540 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
541 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
542 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
543 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
544 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
545 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
546 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
547 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
548 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
549 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
550 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
551 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
553 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
554 if (res < 0)
555 return res;
558 res = tas5825m_set_page(dev, 0x03);
559 if (res < 0)
560 return res;
563 const uint8_t values[] = {
564 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
565 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
566 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
567 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
568 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
569 0x07, 0xB9, 0x96, 0x60, 0xF0, 0x8C, 0xD3, 0x40,
570 0x07, 0xB9, 0x96, 0x60, 0x0F, 0x71, 0xF1, 0x6F,
571 0xF8, 0x8B, 0x97, 0xF0, 0x07, 0xDB, 0xDE, 0xC0,
572 0xF0, 0x48, 0x42, 0x80, 0x07, 0xDB, 0xDE, 0xC0,
573 0x0F, 0xB6, 0x7C, 0xB8, 0xF8, 0x47, 0x01, 0xB8,
574 0x07, 0xBA, 0x69, 0x7A, 0xF0, 0xCA, 0x2B, 0x37,
575 0x07, 0x84, 0xF0, 0x5E, 0x0F, 0x35, 0xD4, 0xC9,
576 0xF8, 0xC0, 0xA6, 0x28, 0x08, 0x00, 0x00, 0x00,
577 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
578 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
580 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
581 if (res < 0)
582 return res;
585 res = tas5825m_set_page(dev, 0x04);
586 if (res < 0)
587 return res;
590 const uint8_t values[] = {
591 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
592 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
593 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
594 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
595 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
596 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
597 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
598 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
599 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
600 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
601 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
602 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
603 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
604 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
605 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
607 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
608 if (res < 0)
609 return res;
612 res = tas5825m_set_page(dev, 0x05);
613 if (res < 0)
614 return res;
617 const uint8_t values[] = {
618 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
619 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
620 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
621 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
622 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
623 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
624 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
625 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
626 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
627 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
628 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
629 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
630 0x00, 0x00, 0x00, 0x00, 0x07, 0xB9, 0x96, 0x60,
631 0xF0, 0x8C, 0xD3, 0x40, 0x07, 0xB9, 0x96, 0x60,
632 0x0F, 0x71, 0xF1, 0x6F, 0xF8, 0x8B, 0x97, 0xF0,
634 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
635 if (res < 0)
636 return res;
639 res = tas5825m_set_page(dev, 0x06);
640 if (res < 0)
641 return res;
644 const uint8_t values[] = {
645 0x07, 0xDB, 0xDE, 0xC0, 0xF0, 0x48, 0x42, 0x80,
646 0x07, 0xDB, 0xDE, 0xC0, 0x0F, 0xB6, 0x7C, 0xB8,
647 0xF8, 0x47, 0x01, 0xB8, 0x07, 0xBA, 0x69, 0x7A,
648 0xF0, 0xCA, 0x2B, 0x37, 0x07, 0x84, 0xF0, 0x5E,
649 0x0F, 0x35, 0xD4, 0xC9, 0xF8, 0xC0, 0xA6, 0x28,
651 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
652 if (res < 0)
653 return res;
656 res = tas5825m_set_page(dev, 0x0F);
657 if (res < 0)
658 return res;
661 const uint8_t values[] = {
662 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
663 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
664 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
665 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
666 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
667 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
668 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
669 0x00, 0x00, 0x00, 0x00, 0x08, 0x41, 0xBE, 0x3C,
670 0xF0, 0x4D, 0x2C, 0x26, 0x07, 0x7A, 0xE8, 0xE9,
671 0x0F, 0xB6, 0x7C, 0xB8, 0xF8, 0x47, 0x01, 0xB8,
672 0x08, 0x00, 0x00, 0x00
674 res = tas5825m_write_block_at(dev, 0x2C, values, ARRAY_SIZE(values));
675 if (res < 0)
676 return res;
679 res = tas5825m_set_page(dev, 0x10);
680 if (res < 0)
681 return res;
684 const uint8_t values[] = {
685 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
686 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
688 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
689 if (res < 0)
690 return res;
693 const uint8_t values[] = {
694 0x00, 0x99, 0x82, 0x0D, 0xFF, 0x08, 0xB1, 0xE4,
695 0x00, 0x67, 0xA6, 0xD7, 0x0F, 0xBE, 0xCA, 0x9D,
696 0xF8, 0x37, 0x5A, 0x9B, 0x08, 0x00, 0x00, 0x00,
697 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
698 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
699 0x35, 0x5D, 0x83, 0xC3, 0x96, 0xF7, 0xF4, 0x67,
700 0x33, 0xEC, 0x44, 0x70, 0x0C, 0xE3, 0x60, 0xA2,
701 0xFA, 0x99, 0x26, 0x28, 0x08, 0x00, 0x00, 0x00,
702 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
703 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
704 0x00, 0x03, 0xF6, 0x87, 0x00, 0x07, 0xED, 0x0F,
705 0x00, 0x03, 0xF6, 0x87, 0x0E, 0xF9, 0x62, 0x4A,
706 0xF8, 0xF6, 0xC3, 0x98
708 res = tas5825m_write_block_at(dev, 0x1C, values, ARRAY_SIZE(values));
709 if (res < 0)
710 return res;
713 res = tas5825m_set_page(dev, 0x11);
714 if (res < 0)
715 return res;
718 const uint8_t values[] = {
719 0x00, 0x03, 0xF6, 0x87, 0x00, 0x07, 0xED, 0x0F,
720 0x00, 0x03, 0xF6, 0x87, 0x0E, 0xF9, 0x62, 0x4A,
721 0xF8, 0xF6, 0xC3, 0x98, 0x07, 0x80, 0xA7, 0xAC,
722 0xF0, 0xFE, 0xB0, 0xA7, 0x07, 0x80, 0xA7, 0xAC,
723 0x0E, 0xF9, 0x62, 0x4A, 0xF8, 0xF6, 0xC3, 0x98,
724 0x07, 0x80, 0xA7, 0xAC, 0xF0, 0xFE, 0xB0, 0xA7,
725 0x07, 0x80, 0xA7, 0xAC, 0x0E, 0xF9, 0x62, 0x4A,
726 0xF8, 0xF6, 0xC3, 0x98
728 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
729 if (res < 0)
730 return res;
733 return 0;
737 int tas5825m_setup(struct device *dev, int id)
739 int res = 0;
741 res = tas5825m_set_book(dev, 0x00);
742 if (res < 0)
743 return res;
745 // Set to HiZ state and enable DSP
746 res = tas5825m_write_at(dev, 0x03, 0x02);
747 if (res < 0)
748 return res;
750 // Digital core and registers reset
751 res = tas5825m_write_at(dev, 0x01, 0x11);
752 if (res < 0)
753 return res;
755 // DSP reset
756 res = tas5825m_write_at(dev, 0x03, 0x12);
757 if (res < 0)
758 return res;
760 res = tas5825m_write_at(dev, 0x48, 0x0C);
761 if (res < 0)
762 return res;
764 res = program_dsp_ram(dev);
765 if (res < 0)
766 return res;
768 res = tas5825m_set_book(dev, 0x78);
769 if (res < 0)
770 return res;
772 res = tas5825m_set_page(dev, 0x18);
773 if (res < 0)
774 return res;
777 const uint8_t values[] = {
778 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
779 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
780 0x00, 0x00, 0x00, 0x00
782 res = tas5825m_write_block_at(dev, 0x30, values, ARRAY_SIZE(values));
783 if (res < 0)
784 return res;
787 res = tas5825m_set_page(dev, 0x1C);
788 if (res < 0)
789 return res;
792 const uint8_t values[] = {
793 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
794 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
795 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00,
796 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
797 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
798 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
799 0x00, 0x00, 0x03, 0x38, 0x00, 0x00, 0x00, 0x00,
800 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
801 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
802 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
803 0x00, 0x00, 0x03, 0x40, 0x00, 0x00, 0x00, 0x00,
804 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
805 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
806 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
807 0x00, 0x00, 0x03, 0x48
809 res = tas5825m_write_block_at(dev, 0x0C, values, ARRAY_SIZE(values));
810 if (res < 0)
811 return res;
814 res = tas5825m_set_page(dev, 0x1D);
815 if (res < 0)
816 return res;
819 const uint8_t values[] = {
820 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
821 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
822 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
823 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x50,
824 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
825 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
826 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
827 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58,
828 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
829 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
830 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
831 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x70,
832 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x03, 0x88,
833 0x00, 0x00, 0x03, 0x90, 0x00, 0x00, 0x00, 0x00,
834 0x00, 0x00, 0x03, 0x98, 0x00, 0x00, 0x03, 0xA0,
836 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
837 if (res < 0)
838 return res;
841 res = tas5825m_set_page(dev, 0x1E);
842 if (res < 0)
843 return res;
846 const uint8_t values[] = {
847 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
848 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
849 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
850 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
851 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
852 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
853 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
854 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
855 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xA8,
856 0x00, 0x00, 0x03, 0xB0, 0x00, 0x00, 0x03, 0xB8,
857 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
858 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
859 0x00, 0x00, 0x03, 0xC0
861 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
862 if (res < 0)
863 return res;
866 // XOR checksums
867 res = tas5825m_set_book(dev, 0x8C);
868 if (res < 0)
869 return res;
871 res = tas5825m_set_page(dev, 0x0E);
872 if (res < 0)
873 return res;
876 const uint8_t values[] = {
877 0x00, 0x20, 0xC4, 0x9C, 0x00, 0x20, 0xC4, 0x9C,
878 0x02, 0xDE, 0xAD, 0x00, 0x74, 0x01, 0x39, 0x01,
879 0x00, 0x20, 0xC4, 0x9B, 0x00, 0xA7, 0x26, 0x4A,
880 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF,
881 0x7F, 0xFF, 0xFF, 0xFF
883 res = tas5825m_write_block_at(dev, 0x5C, values, ARRAY_SIZE(values));
884 if (res < 0)
885 return res;
888 res = tas5825m_set_page(dev, 0x0F);
889 if (res < 0)
890 return res;
893 const uint8_t values[] = {
894 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF,
895 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
896 0x00, 0x00, 0x00, 0x00, 0xE7, 0x00, 0x00, 0x00,
897 0xFE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
898 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
899 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
900 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
901 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
902 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
903 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
904 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
905 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
906 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
907 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
908 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
910 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
911 if (res < 0)
912 return res;
915 res = tas5825m_set_page(dev, 0x10);
916 if (res < 0)
917 return res;
920 const uint8_t values[] = {
921 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
922 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
923 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x62, 0x48, 0x8E,
924 0xFF, 0x83, 0xE9, 0x30, 0x00, 0x2E, 0x18, 0x72,
925 0x0F, 0x40, 0xAE, 0x1F, 0xF8, 0x9A, 0x41, 0xD5,
926 0x07, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
927 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
928 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF,
929 0xF0, 0xBF, 0x51, 0xE1, 0x07, 0x65, 0xBE, 0x2B,
930 0x0A, 0x19, 0xBB, 0x39, 0xFC, 0x3F, 0x79, 0xE8,
931 0x07, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
932 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
933 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x79, 0x55,
934 0x00, 0xB8, 0xF2, 0xAB, 0x00, 0x5C, 0x79, 0x55,
935 0x0D, 0x98, 0xCC, 0x51, 0xFA, 0x16, 0x2B, 0x95,
937 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
938 if (res < 0)
939 return res;
942 res = tas5825m_set_page(dev, 0x11);
943 if (res < 0)
944 return res;
947 const uint8_t values[] = {
948 0x00, 0x5C, 0x79, 0x55, 0x00, 0xB8, 0xF2, 0xAB,
949 0x00, 0x5C, 0x79, 0x55, 0x0D, 0x98, 0xCC, 0x51,
950 0xFA, 0x16, 0x2B, 0x95, 0x06, 0xE0, 0xA8, 0x2F,
951 0xF2, 0x3E, 0xAF, 0xA2, 0x06, 0xE0, 0xA8, 0x2F,
952 0x0D, 0x98, 0xCC, 0x51, 0xFA, 0x16, 0x2B, 0x95,
953 0x06, 0xE0, 0xA8, 0x2F, 0xF2, 0x3E, 0xAF, 0xA2,
954 0x06, 0xE0, 0xA8, 0x2F, 0x0D, 0x98, 0xCC, 0x51,
955 0xFA, 0x16, 0x2B, 0x95, 0x02, 0x4D, 0x99, 0x99,
956 0xFD, 0xB2, 0x66, 0x67, 0x00, 0x80, 0x00, 0x00,
958 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
959 if (res < 0)
960 return res;
963 res = tas5825m_set_book(dev, 0x00);
964 if (res < 0)
965 return res;
967 res = tas5825m_write_at(dev, 0x40, 0x00);
968 if (res < 0)
969 return res;
970 res = tas5825m_write_at(dev, 0x7D, 0x11);
971 if (res < 0)
972 return res;
973 res = tas5825m_write_at(dev, 0x7E, 0xFF);
974 if (res < 0)
975 return res;
977 res = tas5825m_set_page(dev, 0x01);
978 if (res < 0)
979 return res;
981 res = tas5825m_write_at(dev, 0x51, 0x05);
982 if (res < 0)
983 return res;
985 res = tas5825m_set_page(dev, 0x02);
986 if (res < 0)
987 return res;
989 res = tas5825m_write_at(dev, 0x19, 0xDF);
990 if (res < 0)
991 return res;
993 res = tas5825m_set_page(dev, 0x00);
994 if (res < 0)
995 return res;
997 res = tas5825m_write_at(dev, 0x46, 0x11);
998 if (res < 0)
999 return res;
1000 res = tas5825m_write_at(dev, 0x02, 0x00);
1001 if (res < 0)
1002 return res;
1003 res = tas5825m_write_at(dev, 0x53, 0x00);
1004 if (res < 0)
1005 return res;
1006 res = tas5825m_write_at(dev, 0x54, 0x00);
1007 if (res < 0)
1008 return res;
1010 // Set to HiZ state and enable DSP
1011 res = tas5825m_write_at(dev, 0x03, 0x02);
1012 if (res < 0)
1013 return res;
1015 // Wait for device to settle
1016 mdelay(5);
1018 // XOR checksums
1019 res = tas5825m_set_book(dev, 0x8C);
1020 if (res < 0)
1021 return res;
1023 res = tas5825m_set_page(dev, 0x0B);
1024 if (res < 0)
1025 return res;
1028 const uint8_t values[] = {
1029 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
1031 res = tas5825m_write_block_at(dev, 0x28, values, ARRAY_SIZE(values));
1032 if (res < 0)
1033 return res;
1036 const uint8_t values[] = {
1037 0x00, 0x20, 0xC4, 0x9C
1039 res = tas5825m_write_block_at(dev, 0x50, values, ARRAY_SIZE(values));
1040 if (res < 0)
1041 return res;
1044 const uint8_t values[] = {
1045 0x7F, 0xFF, 0xFF, 0xFF
1047 res = tas5825m_write_block_at(dev, 0x5C, values, ARRAY_SIZE(values));
1048 if (res < 0)
1049 return res;
1052 res = tas5825m_set_page(dev, 0x01);
1053 if (res < 0)
1054 return res;
1057 const uint8_t values[] = {
1058 0xC0, 0x00, 0x00, 0x00, 0x00, 0x71, 0x94, 0x9A,
1060 res = tas5825m_write_block_at(dev, 0x28, values, ARRAY_SIZE(values));
1061 if (res < 0)
1062 return res;
1065 res = tas5825m_set_page(dev, 0x0A);
1066 if (res < 0)
1067 return res;
1070 const uint8_t values[] = {
1071 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1072 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
1073 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1074 0x00, 0x00, 0x00, 0x00
1076 res = tas5825m_write_block_at(dev, 0x64, values, ARRAY_SIZE(values));
1077 if (res < 0)
1078 return res;
1081 res = tas5825m_set_page(dev, 0x0B);
1082 if (res < 0)
1083 return res;
1086 const uint8_t values[] = {
1087 0x00, 0x80, 0x00, 0x00, 0x00, 0x2D, 0x6A, 0x86,
1088 0x00, 0x2D, 0x6A, 0x86, 0x00, 0x80, 0x00, 0x00,
1089 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1090 0x00, 0x80, 0x00, 0x00
1092 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
1093 if (res < 0)
1094 return res;
1097 const uint8_t values[] = {
1098 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
1099 0x00, 0x00, 0x57, 0x62, 0x00, 0x00, 0x00, 0x00,
1101 res = tas5825m_write_block_at(dev, 0x28, values, ARRAY_SIZE(values));
1102 if (res < 0)
1103 return res;
1106 const uint8_t values[] = {
1107 0x02, 0x66, 0xC4, 0x1B, 0x00, 0x89, 0x37, 0x4C,
1109 res = tas5825m_write_block_at(dev, 0x48, values, ARRAY_SIZE(values));
1110 if (res < 0)
1111 return res;
1114 const uint8_t values[] = {
1115 0x7D, 0x99, 0x3B, 0xE5, 0x00, 0x00, 0x57, 0x62,
1117 res = tas5825m_write_block_at(dev, 0x54, values, ARRAY_SIZE(values));
1118 if (res < 0)
1119 return res;
1122 res = tas5825m_set_page(dev, 0x0E);
1123 if (res < 0)
1124 return res;
1127 const uint8_t values[] = {
1128 0x00, 0x22, 0x1D, 0x95, 0x00, 0x03, 0x69, 0xC5,
1129 0x00, 0x03, 0x69, 0xC5, 0x1C, 0x1B, 0xF0, 0x41,
1130 0x04, 0x0C, 0x37, 0x14, 0x00, 0x03, 0x69, 0xC5,
1131 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x30, 0xE8,
1132 0x01, 0x2E, 0x4F, 0x40
1134 res = tas5825m_write_block_at(dev, 0x5C, values, ARRAY_SIZE(values));
1135 if (res < 0)
1136 return res;
1139 res = tas5825m_set_page(dev, 0x0F);
1140 if (res < 0)
1141 return res;
1144 const uint8_t values[] = {
1145 0x00, 0xC9, 0xD9, 0xD4, 0x00, 0x43, 0x6C, 0x19,
1146 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1147 0xFF, 0xA0, 0x00, 0x00, 0xF7, 0x5C, 0x28, 0xF6,
1148 0xFB, 0x44, 0x29, 0x20, 0x00, 0x00, 0x00, 0x00,
1149 0x00, 0x00, 0x00, 0x00
1151 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
1152 if (res < 0)
1153 return res;
1156 res = tas5825m_set_page(dev, 0x10);
1157 if (res < 0)
1158 return res;
1161 const uint8_t values[] = {
1162 0x08, 0x13, 0x85, 0x62
1164 res = tas5825m_write_block_at(dev, 0x18, values, ARRAY_SIZE(values));
1165 if (res < 0)
1166 return res;
1169 res = tas5825m_set_page(dev, 0x11);
1170 if (res < 0)
1171 return res;
1174 const uint8_t values[] = {
1175 0x02, 0x9E, 0x15, 0x7E, 0xFD, 0x61, 0xEA, 0x82,
1176 0x01, 0x00, 0x00, 0x00
1178 res = tas5825m_write_block_at(dev, 0x44, values, ARRAY_SIZE(values));
1179 if (res < 0)
1180 return res;
1183 res = tas5825m_set_page(dev, 0x07);
1184 if (res < 0)
1185 return res;
1188 const uint8_t values[] = {
1189 0x00, 0x80, 0x00, 0x00
1191 res = tas5825m_write_block_at(dev, 0x64, values, ARRAY_SIZE(values));
1192 if (res < 0)
1193 return res;
1196 const uint8_t values[] = {
1197 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
1199 res = tas5825m_write_block_at(dev, 0x6C, values, ARRAY_SIZE(values));
1200 if (res < 0)
1201 return res;
1204 res = program_biquad_filters(dev);
1205 if (res < 0)
1206 return res;
1208 res = tas5825m_set_book(dev, 0x00);
1209 if (res < 0)
1210 return res;
1212 // Register tuning
1213 res = tas5825m_write_at(dev, 0x30, 0x00);
1214 if (res < 0)
1215 return res;
1216 res = tas5825m_write_at(dev, 0x60, 0x02);
1217 if (res < 0)
1218 return res;
1219 res = tas5825m_write_at(dev, 0x62, 0x09);
1220 if (res < 0)
1221 return res;
1222 res = tas5825m_write_at(dev, 0x4C, 0x30);
1223 if (res < 0)
1224 return res;
1226 // Set to PLAY state
1227 res = tas5825m_write_at(dev, 0x03, 0x03);
1228 if (res < 0)
1229 return res;
1231 // Clear analog fault
1232 res = tas5825m_write_at(dev, 0x78, 0x80);
1233 if (res < 0)
1234 return res;
1236 res = tas5825m_write_at(dev, 0x60, 0x00);
1237 if (res < 0)
1238 return res;
1239 res = tas5825m_write_at(dev, 0x64, 0x02);
1240 if (res < 0)
1241 return res;
1243 return 0;