mb/google/brya: Create rull variant
[coreboot2.git] / src / mainboard / system76 / oryp6 / tas5825m.c
blobd2f829f39695bf7d00458118a3eeb4c43c5cdce3
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
25 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
26 if (res < 0)
27 return res;
31 const uint8_t values[] = {
32 0x00, 0x00, 0xFC, 0x50, 0x00, 0x00, 0xFC, 0x00,
33 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00,
34 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x00,
35 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC
37 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
38 if (res < 0)
39 return res;
43 const uint8_t values[] = {
44 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC,
45 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC,
46 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC,
47 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00
49 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
50 if (res < 0)
51 return res;
55 const uint8_t values[] = {
56 0xFC, 0x00, 0x00, 0x00, 0x82, 0x00, 0x93, 0x00,
57 0xFC, 0x00, 0x00, 0x8F, 0x00, 0xFF, 0xEF, 0x84,
58 0x49, 0x03, 0x27, 0x84, 0x02, 0x04, 0x06, 0x02,
59 0x60, 0x00, 0x01
61 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
62 if (res < 0)
63 return res;
66 res = tas5825m_set_page(dev, 0x02);
67 if (res < 0)
68 return res;
71 const uint8_t values[] = {
72 0x02, 0x70, 0x00, 0x06, 0x02, 0x78, 0x00, 0x05,
73 0x02, 0x68, 0x00, 0x02, 0x02, 0x28, 0x03, 0x4D,
74 0x84, 0x2A, 0x04, 0x00, 0xE2, 0x57, 0x91, 0x9F,
75 0x84, 0x82, 0x20, 0xE0, 0x84, 0x82, 0x04
77 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
78 if (res < 0)
79 return res;
83 const uint8_t values[] = {
84 0x01, 0xF0, 0x1C, 0x31, 0xA0, 0xF0, 0x1C, 0x31,
85 0xA1, 0xF0, 0x1C, 0x31, 0xA2, 0xF0, 0x1F, 0x31,
86 0xA3, 0xE4, 0x00, 0x11, 0xA6, 0x80, 0x27, 0x80,
87 0xE1, 0xF4, 0x00, 0x11, 0xA4, 0xF4, 0x1D
89 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
90 if (res < 0)
91 return res;
95 const uint8_t values[] = {
96 0x31, 0xA5, 0xF4, 0x1C, 0x31, 0xA7, 0xF4, 0x1F,
97 0x31, 0xA8, 0x02, 0x78, 0x00, 0x03, 0xE2, 0x68,
98 0xF1, 0xC3, 0x80, 0x67, 0x80, 0xE9, 0x84, 0x4B,
99 0x03, 0x27, 0x02, 0x70, 0x00, 0x04, 0x84
101 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
102 if (res < 0)
103 return res;
107 const uint8_t values[] = {
108 0x41, 0x03, 0x37, 0x80, 0x07, 0x00, 0x80, 0xE0,
109 0x00, 0x11, 0xA9, 0x84, 0x82, 0x00, 0xE0, 0x8E,
110 0xFC, 0x04, 0x10, 0xF0, 0x1C, 0x11, 0xAA, 0xF0,
111 0x1C, 0x11, 0xAB
113 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
114 if (res < 0)
115 return res;
118 res = tas5825m_set_page(dev, 0x03);
119 if (res < 0)
120 return res;
123 const uint8_t values[] = {
124 0xF0, 0x1C, 0x11, 0xAC, 0xF0, 0x1F, 0x11, 0xAD,
125 0x86, 0xA1, 0x01, 0xC2, 0x80, 0x27, 0x80, 0xE8,
126 0x60, 0x00, 0x00, 0x00, 0x84, 0x43, 0x03, 0x37,
127 0x80, 0x00, 0x00, 0x81, 0x0D, 0x00, 0x10
129 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
130 if (res < 0)
131 return res;
135 const uint8_t values[] = {
136 0x20, 0x84, 0x51, 0x03, 0x3E, 0x08, 0x44, 0x26,
137 0x30, 0x84, 0xC3, 0x03, 0x47, 0x84, 0xC2, 0x40,
138 0xE0, 0x8C, 0xFF, 0x03, 0x23, 0xE0, 0x10, 0x11,
139 0xB3, 0xF0, 0x1C, 0x51, 0xB4, 0xF0, 0x1C
141 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
142 if (res < 0)
143 return res;
147 const uint8_t values[] = {
148 0x51, 0xB5, 0xF0, 0x1C, 0x51, 0xB6, 0xF0, 0x1F,
149 0x51, 0xB7, 0x86, 0xA1, 0x01, 0xC6, 0x80, 0x27,
150 0x80, 0xEA, 0x84, 0x53, 0x03, 0x3E, 0x84, 0x82,
151 0x04, 0x05, 0x84, 0x51, 0x03, 0x75, 0xE2
153 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
154 if (res < 0)
155 return res;
159 const uint8_t values[] = {
160 0x6B, 0xC0, 0x00, 0x80, 0x07, 0x00, 0x80, 0xE0,
161 0x80, 0x31, 0xB8, 0x84, 0x82, 0x40, 0xE0, 0xF0,
162 0x1C, 0x51, 0xB9, 0xF0, 0x1C, 0x51, 0xBA, 0xF0,
163 0x1C, 0x51, 0xBB
165 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
166 if (res < 0)
167 return res;
170 res = tas5825m_set_page(dev, 0x04);
171 if (res < 0)
172 return res;
175 const uint8_t values[] = {
176 0xF0, 0x1F, 0x51, 0xBC, 0x86, 0xA1, 0x01, 0xC5,
177 0x80, 0x27, 0x80, 0xEA, 0x60, 0x00, 0x00, 0x00,
178 0x80, 0x00, 0x00, 0x81, 0x84, 0xA1, 0x03, 0x4F,
179 0xE0, 0x80, 0xA0, 0x00, 0x01, 0x07, 0x11
181 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
182 if (res < 0)
183 return res;
187 const uint8_t values[] = {
188 0x20, 0x08, 0x44, 0x26, 0x30, 0x08, 0x00, 0x98,
189 0x4A, 0x84, 0x53, 0x03, 0x75, 0x08, 0x00, 0x30,
190 0x48, 0x02, 0xCA, 0x00, 0x01, 0x08, 0x60, 0x26,
191 0x32, 0x84, 0x51, 0x03, 0x45, 0xE4, 0x10
193 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
194 if (res < 0)
195 return res;
199 const uint8_t values[] = {
200 0x40, 0x00, 0x80, 0x40, 0xC0, 0x82, 0x84, 0xC2,
201 0x40, 0xE0, 0x84, 0xC3, 0x03, 0x5E, 0x08, 0x00,
202 0x50, 0x48, 0xE0, 0x10, 0x11, 0xBD, 0x02, 0xC2,
203 0x00, 0x02, 0x08, 0x60, 0x06, 0x12, 0x84
205 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
206 if (res < 0)
207 return res;
211 const uint8_t values[] = {
212 0xD3, 0x03, 0x4F, 0xF0, 0x1C, 0x51, 0xBE, 0xF0,
213 0x1C, 0x51, 0xBF, 0xF0, 0x1C, 0x51, 0xC0, 0xF0,
214 0x1F, 0x51, 0xC1, 0x84, 0xA1, 0x03, 0x65, 0x80,
215 0x27, 0x80, 0xEA
217 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
218 if (res < 0)
219 return res;
222 res = tas5825m_set_page(dev, 0x05);
223 if (res < 0)
224 return res;
227 const uint8_t values[] = {
228 0xE0, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x83,
229 0x08, 0x00, 0x98, 0x6B, 0x08, 0x00, 0x30, 0x68,
230 0x84, 0x53, 0x03, 0x45, 0x08, 0x60, 0x26, 0x33,
231 0x84, 0x51, 0x03, 0x25, 0xE4, 0x10, 0x60
233 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
234 if (res < 0)
235 return res;
239 const uint8_t values[] = {
240 0x00, 0x80, 0x40, 0xC0, 0x81, 0x02, 0x70, 0x00,
241 0x7F, 0x08, 0x00, 0x50, 0x28, 0x08, 0x60, 0x06,
242 0x11, 0x84, 0xCB, 0x03, 0x65, 0xE0, 0x10, 0x51,
243 0xC4, 0x84, 0x80, 0x41, 0x00, 0x02, 0xA3
245 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
246 if (res < 0)
247 return res;
251 const uint8_t values[] = {
252 0x00, 0x10, 0xE4, 0x00, 0x00, 0x00, 0x84, 0xD0,
253 0x04, 0x01, 0x84, 0xA2, 0x04, 0x03, 0x84, 0xD2,
254 0x50, 0x01, 0x84, 0x53, 0x03, 0x25, 0x80, 0x00,
255 0xC4, 0x04, 0x8F, 0x30, 0x00, 0x00, 0x88
257 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
258 if (res < 0)
259 return res;
263 const uint8_t values[] = {
264 0x67, 0x03, 0x00, 0xE4, 0x00, 0x11, 0x9B, 0xEE,
265 0x64, 0x60, 0x00, 0x02, 0xD3, 0x00, 0x10, 0x88,
266 0x47, 0x00, 0x80, 0x10, 0x00, 0x18, 0x02, 0x86,
267 0xC1, 0x01, 0x9D
269 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
270 if (res < 0)
271 return res;
274 res = tas5825m_set_page(dev, 0x06);
275 if (res < 0)
276 return res;
279 const uint8_t values[] = {
280 0xE0, 0x10, 0x31, 0xC7, 0x86, 0xC9, 0x01, 0x9E,
281 0x80, 0x00, 0xC4, 0x02, 0x02, 0x50, 0x01, 0x9C,
282 0x00, 0xFF, 0x21, 0x65, 0x00, 0xFC, 0x00, 0x00,
283 0x02, 0x60, 0x00, 0x01, 0x02, 0x70, 0x00
285 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
286 if (res < 0)
287 return res;
291 const uint8_t values[] = {
292 0x04, 0x84, 0xC8, 0x04, 0x10, 0x84, 0x41, 0x03,
293 0x67, 0x84, 0x51, 0x03, 0x6D, 0x84, 0xC0, 0x04,
294 0x02, 0x04, 0x80, 0x91, 0x20, 0x08, 0x60, 0x26,
295 0x30, 0x02, 0x78, 0x00, 0x03, 0x02, 0x68
297 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
298 if (res < 0)
299 return res;
303 const uint8_t values[] = {
304 0x00, 0x02, 0x0D, 0x00, 0x10, 0x10, 0x08, 0x60,
305 0x06, 0x12, 0x84, 0x49, 0x03, 0x2F, 0xE0, 0x80,
306 0x71, 0xA9, 0x02, 0x28, 0x03, 0x55, 0x84, 0x82,
307 0x00, 0xE0, 0x84, 0x2A, 0x04, 0x00, 0xF0
309 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
310 if (res < 0)
311 return res;
315 const uint8_t values[] = {
316 0x1C, 0x11, 0xAA, 0xF0, 0x1C, 0x11, 0xAB, 0xF0,
317 0x1C, 0x11, 0xAC, 0xF0, 0x1F, 0x11, 0xAD, 0x86,
318 0xA1, 0x01, 0xAE, 0x80, 0x27, 0x80, 0xE8, 0x84,
319 0x82, 0x04, 0x07
321 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
322 if (res < 0)
323 return res;
326 res = tas5825m_set_page(dev, 0x07);
327 if (res < 0)
328 return res;
331 const uint8_t values[] = {
332 0xE0, 0x80, 0x60, 0x00, 0x84, 0x82, 0x40, 0xE0,
333 0x84, 0x43, 0x03, 0x67, 0xF0, 0x1C, 0x51, 0xAF,
334 0xF0, 0x1C, 0x51, 0xB0, 0xF0, 0x1C, 0x51, 0xB1,
335 0xF0, 0x1F, 0x51, 0xB2, 0x02, 0x78, 0x00
337 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
338 if (res < 0)
339 return res;
343 const uint8_t values[] = {
344 0x05, 0x80, 0x27, 0x80, 0xEA, 0x84, 0x82, 0x04,
345 0x08, 0x02, 0x70, 0x00, 0x06, 0x84, 0x53, 0x03,
346 0x6D, 0x84, 0x80, 0x04, 0x07, 0xE0, 0x00, 0x00,
347 0x82, 0xF0, 0x81, 0x00, 0x80, 0x80, 0x07
349 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
350 if (res < 0)
351 return res;
355 const uint8_t values[] = {
356 0x12, 0xBC, 0x86, 0xA1, 0x01, 0x9F, 0xE2, 0x57,
357 0xA0, 0x00, 0x84, 0x82, 0x04, 0x09, 0x84, 0x82,
358 0x20, 0xE0, 0xF0, 0x1C, 0x31, 0xA0, 0xF0, 0x1C,
359 0x31, 0xA1, 0xF0, 0x1C, 0x31, 0xA2, 0xF0
361 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
362 if (res < 0)
363 return res;
367 const uint8_t values[] = {
368 0x1F, 0x31, 0xA3, 0xE4, 0x00, 0x11, 0xA6, 0x80,
369 0x27, 0x80, 0xE1, 0xF4, 0x00, 0x11, 0xA4, 0xF4,
370 0x1D, 0x31, 0xA5, 0xF4, 0x1C, 0x31, 0xA7, 0xF4,
371 0x1F, 0x31, 0xA8
373 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
374 if (res < 0)
375 return res;
378 res = tas5825m_set_page(dev, 0x08);
379 if (res < 0)
380 return res;
383 const uint8_t values[] = {
384 0x02, 0x78, 0x00, 0x03, 0xE2, 0x6A, 0xF1, 0xC3,
385 0x80, 0x67, 0x80, 0xE9, 0x84, 0x4B, 0x03, 0x2F,
386 0x02, 0x70, 0x00, 0x04, 0x84, 0x59, 0x03, 0x3D,
387 0x80, 0x07, 0x00, 0x80, 0xE0, 0x00, 0x11
389 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
390 if (res < 0)
391 return res;
395 const uint8_t values[] = {
396 0xA9, 0x84, 0x82, 0x60, 0xE0, 0x8E, 0xFC, 0x04,
397 0x10, 0xF0, 0x1C, 0x71, 0xAA, 0xF0, 0x1C, 0x71,
398 0xAB, 0xF0, 0x1C, 0x71, 0xAC, 0xF0, 0x1F, 0x71,
399 0xAD, 0x86, 0xA1, 0x01, 0xC2, 0x80, 0x27
401 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
402 if (res < 0)
403 return res;
407 const uint8_t values[] = {
408 0x80, 0xEB, 0x60, 0x00, 0x00, 0x00, 0x84, 0x5B,
409 0x03, 0x3D, 0x80, 0x00, 0x00, 0x81, 0x0D, 0x00,
410 0x10, 0x20, 0x84, 0x59, 0x03, 0x3F, 0x08, 0x44,
411 0x26, 0x30, 0x84, 0xC3, 0x03, 0x57, 0x84
413 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
414 if (res < 0)
415 return res;
419 const uint8_t values[] = {
420 0xC2, 0x60, 0xE0, 0xE0, 0x10, 0x11, 0xB3, 0xF0,
421 0x1C, 0x71, 0xB4, 0xF0, 0x1C, 0x71, 0xB5, 0xF0,
422 0x1C, 0x71, 0xB6, 0xF0, 0x1F, 0x71, 0xB7, 0x86,
423 0xA1, 0x01, 0xC6
425 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
426 if (res < 0)
427 return res;
430 res = tas5825m_set_page(dev, 0x09);
431 if (res < 0)
432 return res;
435 const uint8_t values[] = {
436 0x80, 0x27, 0x80, 0xEB, 0x84, 0x5B, 0x03, 0x3F,
437 0x84, 0x82, 0x04, 0x0D, 0x84, 0x41, 0x03, 0x76,
438 0xE2, 0x6B, 0xE0, 0x00, 0x80, 0x07, 0x00, 0x80,
439 0xE0, 0x81, 0x31, 0xB8, 0x84, 0x82, 0x00
441 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
442 if (res < 0)
443 return res;
447 const uint8_t values[] = {
448 0xE0, 0xF0, 0x1C, 0x11, 0xB9, 0xF0, 0x1C, 0x11,
449 0xBA, 0xF0, 0x1C, 0x11, 0xBB, 0xF0, 0x1F, 0x11,
450 0xBC, 0x86, 0xA1, 0x01, 0xC5, 0x80, 0x27, 0x80,
451 0xE8, 0x60, 0x00, 0x00, 0x00, 0x80, 0x00
453 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
454 if (res < 0)
455 return res;
459 const uint8_t values[] = {
460 0x00, 0x81, 0x84, 0xA1, 0x03, 0x5D, 0xE0, 0x81,
461 0xA0, 0x00, 0x01, 0x07, 0x11, 0x20, 0x08, 0x44,
462 0x26, 0x30, 0x08, 0x00, 0x98, 0x4A, 0x84, 0x43,
463 0x03, 0x76, 0x08, 0x00, 0x30, 0x48, 0x02
465 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
466 if (res < 0)
467 return res;
471 const uint8_t values[] = {
472 0xCA, 0x00, 0x01, 0x08, 0x60, 0x26, 0x32, 0x84,
473 0x41, 0x03, 0x46, 0xE4, 0x10, 0x40, 0x00, 0x80,
474 0x40, 0xC0, 0x82, 0x84, 0xC2, 0x00, 0xE0, 0x84,
475 0xC3, 0x03, 0x5F
477 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
478 if (res < 0)
479 return res;
482 res = tas5825m_set_page(dev, 0x0A);
483 if (res < 0)
484 return res;
487 const uint8_t values[] = {
488 0x08, 0x00, 0x50, 0x48, 0xE0, 0x10, 0x11, 0xBD,
489 0x02, 0xC2, 0x00, 0x02, 0x08, 0x60, 0x06, 0x12,
490 0x84, 0xD3, 0x03, 0x5D, 0xF0, 0x1C, 0x11, 0xBE,
491 0xF0, 0x1C, 0x11, 0xBF, 0xF0, 0x1C, 0x11
493 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
494 if (res < 0)
495 return res;
499 const uint8_t values[] = {
500 0xC0, 0xF0, 0x1F, 0x11, 0xC1, 0x84, 0xA1, 0x03,
501 0x66, 0x80, 0x27, 0x80, 0xE8, 0xE0, 0x00, 0x00,
502 0x00, 0x80, 0x07, 0x00, 0x83, 0x08, 0x00, 0x98,
503 0x6B, 0x08, 0x00, 0x30, 0x68, 0x84, 0x43
505 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
506 if (res < 0)
507 return res;
511 const uint8_t values[] = {
512 0x03, 0x46, 0x08, 0x60, 0x26, 0x33, 0x84, 0x51,
513 0x03, 0x26, 0xE4, 0x10, 0x60, 0x00, 0x80, 0x40,
514 0xC0, 0x81, 0x02, 0x70, 0x00, 0x7F, 0x08, 0x00,
515 0x50, 0x28, 0x08, 0x60, 0x06, 0x11, 0x8C
517 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
518 if (res < 0)
519 return res;
523 const uint8_t values[] = {
524 0xFF, 0x03, 0x24, 0x84, 0xCB, 0x03, 0x66, 0xE0,
525 0x10, 0x51, 0xC4, 0x84, 0x80, 0x41, 0x00, 0x02,
526 0xA3, 0x00, 0x10, 0xE4, 0x00, 0x00, 0x00, 0x84,
527 0xD0, 0x04, 0x09
529 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
530 if (res < 0)
531 return res;
534 res = tas5825m_set_page(dev, 0x0B);
535 if (res < 0)
536 return res;
539 const uint8_t values[] = {
540 0x84, 0xA2, 0x04, 0x0B, 0x84, 0xD2, 0x50, 0x01,
541 0x84, 0x53, 0x03, 0x26, 0x80, 0x00, 0xC4, 0x0C,
542 0x8F, 0x30, 0x00, 0x00, 0x88, 0x67, 0x03, 0x00,
543 0xE4, 0x00, 0x11, 0x9B, 0xEE, 0x64, 0x80
545 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
546 if (res < 0)
547 return res;
551 const uint8_t values[] = {
552 0x00, 0x02, 0xD3, 0x00, 0x10, 0x88, 0x47, 0x00,
553 0x80, 0x10, 0x00, 0x18, 0x02, 0x86, 0xC1, 0x01,
554 0x9D, 0xE0, 0x10, 0x31, 0xC7, 0x86, 0xC9, 0x01,
555 0x9E, 0x80, 0x00, 0xC4, 0x0A, 0x02, 0x50
557 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
558 if (res < 0)
559 return res;
563 const uint8_t values[] = {
564 0x01, 0x9C, 0x00, 0xFF, 0x21, 0x65, 0x00, 0xFC,
565 0x00, 0x00, 0x02, 0x70, 0x00, 0x04, 0x02, 0x68,
566 0x00, 0x01, 0x02, 0x60, 0x00, 0x03, 0x02, 0x78,
567 0x00, 0x02, 0x84, 0x49, 0x03, 0x6E, 0x84
569 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
570 if (res < 0)
571 return res;
575 const uint8_t values[] = {
576 0x41, 0x03, 0x6F, 0x84, 0xC8, 0x04, 0x10, 0x84,
577 0xC0, 0x04, 0x0A, 0x04, 0x81, 0x91, 0x20, 0x08,
578 0x60, 0x26, 0x30, 0x0D, 0x00, 0x10, 0x10, 0x08,
579 0x60, 0x06, 0x12
581 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
582 if (res < 0)
583 return res;
586 res = tas5825m_set_page(dev, 0x0C);
587 if (res < 0)
588 return res;
591 const uint8_t values[] = {
592 0x84, 0x00, 0x04, 0x06, 0xE0, 0x81, 0x71, 0xA9,
593 0x84, 0x82, 0x20, 0xE8, 0xF0, 0x1D, 0x31, 0xAA,
594 0xF0, 0x1D, 0x31, 0xAB, 0xF0, 0x1D, 0x31, 0xAC,
595 0xF0, 0x1C, 0x31, 0xAD, 0x86, 0xA1, 0x01
597 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
598 if (res < 0)
599 return res;
603 const uint8_t values[] = {
604 0xAE, 0x80, 0x27, 0x80, 0xF9, 0x84, 0x82, 0x04,
605 0x0E, 0xE0, 0x81, 0x60, 0x00, 0x84, 0x82, 0x00,
606 0xE8, 0x84, 0x4B, 0x03, 0x6E, 0xF0, 0x1D, 0x11,
607 0xAF, 0xF0, 0x1D, 0x11, 0xB0, 0xF0, 0x1D
609 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
610 if (res < 0)
611 return res;
615 const uint8_t values[] = {
616 0x11, 0xB1, 0xF0, 0x1C, 0x11, 0xB2, 0x02, 0xA3,
617 0x00, 0x1A, 0x80, 0x27, 0x80, 0xF8, 0x84, 0x82,
618 0x04, 0x0F, 0xE0, 0x81, 0xC0, 0x00, 0xF0, 0x81,
619 0xE0, 0x80, 0x84, 0x43, 0x03, 0x6F, 0x80
621 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
622 if (res < 0)
623 return res;
627 const uint8_t values[] = {
628 0x07, 0x12, 0xBD, 0x02, 0xC0, 0x00, 0x00, 0x00,
629 0xFC, 0x50, 0x00, 0x8F, 0x00, 0x00, 0x11, 0x8F,
630 0x00, 0xFF, 0xFF, 0x84, 0x58, 0x04, 0x01, 0x84,
631 0xC2, 0x04, 0x00
633 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
634 if (res < 0)
635 return res;
638 res = tas5825m_set_page(dev, 0x0D);
639 if (res < 0)
640 return res;
643 const uint8_t values[] = {
644 0x02, 0xC2, 0x60, 0x00, 0x84, 0xA0, 0x61, 0x00,
645 0xE0, 0x20, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00,
646 0x40, 0x40, 0xA0, 0x00, 0x80, 0x00, 0xC0, 0x82,
647 0x08, 0xFC, 0x48, 0x3A, 0x08, 0xFC, 0x18
649 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
650 if (res < 0)
651 return res;
655 const uint8_t values[] = {
656 0x50, 0x00, 0xFC, 0x00, 0x00, 0xE0, 0x10, 0x00,
657 0x00, 0x86, 0xA0, 0x41, 0x00, 0x40, 0x47, 0x20,
658 0x00, 0x80, 0x00, 0xC0, 0x83, 0x04, 0xE0, 0x3D,
659 0x1E, 0x04, 0x80, 0x11, 0xE0, 0x08, 0x44
661 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
662 if (res < 0)
663 return res;
667 const uint8_t values[] = {
668 0x26, 0x33, 0x02, 0xCB, 0x00, 0x10, 0xE0, 0x10,
669 0x40, 0x83, 0x08, 0x00, 0x28, 0x21, 0x84, 0xCA,
670 0x61, 0x00, 0x80, 0x07, 0x00, 0x81, 0x0C, 0xE0,
671 0x2C, 0x09, 0x84, 0xCA, 0x21, 0x00, 0x00
673 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
674 if (res < 0)
675 return res;
679 const uint8_t values[] = {
680 0xFC, 0x50, 0x00, 0x8F, 0x00, 0x00, 0x01
682 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
683 if (res < 0)
684 return res;
687 return 0;
690 static int program_biquad_filters(struct device *dev)
692 int res;
694 res = tas5825m_set_book(dev, 0xAA);
695 if (res < 0)
696 return res;
698 res = tas5825m_set_page(dev, 0x01);
699 if (res < 0)
700 return res;
703 const uint8_t values[] = {
704 0x08, 0x10, 0x92, 0xFE, 0xF0, 0x84, 0x2F, 0xC0,
705 0x07, 0x6F, 0x67, 0x29, 0x0F, 0x7B, 0xD0, 0x40,
706 0xF8, 0x80, 0x05, 0xDA, 0x08, 0x18, 0xBA, 0xDB,
707 0xF0, 0xA9, 0xF7, 0x0B, 0x07, 0x44, 0x20
709 res = tas5825m_write_block_at(dev, 0x30, values, ARRAY_SIZE(values));
710 if (res < 0)
711 return res;
715 const uint8_t values[] = {
716 0x4E, 0x0F, 0x56, 0x08, 0xF5, 0xF8, 0xA3, 0x24,
717 0xD7, 0x08, 0x20, 0x24, 0xC9, 0xF1, 0x08, 0x6D,
718 0x45, 0x06, 0xE7, 0x92, 0x27, 0x0E, 0xF7, 0x92,
719 0xBB, 0xF8, 0xF8, 0x49, 0x10, 0x08, 0x13
721 res = tas5825m_write_block_at(dev, 0x4F, values, ARRAY_SIZE(values));
722 if (res < 0)
723 return res;
727 const uint8_t values[] = {
728 0xEA, 0xAD, 0xF3, 0x14, 0xE9, 0xB1, 0x05, 0x4B,
729 0xD4, 0xF4, 0x0C, 0xEB, 0x16, 0x4F, 0xFA, 0xA0,
730 0x40, 0x5F
732 res = tas5825m_write_block_at(dev, 0x6E, values, ARRAY_SIZE(values));
733 if (res < 0)
734 return res;
737 res = tas5825m_set_page(dev, 0x02);
738 if (res < 0)
739 return res;
742 const uint8_t values[] = {
743 0x08, 0x13, 0x8A, 0xBF, 0xF0, 0x78, 0x40, 0xD7,
744 0x07, 0x77, 0x45, 0xB3, 0x0F, 0x87, 0xBF, 0x29,
745 0xF8, 0x75, 0x2F, 0x8E, 0x08, 0x46, 0x76, 0x67,
746 0xF6, 0x0C, 0xF9, 0x7A, 0x03, 0x36, 0x96
748 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
749 if (res < 0)
750 return res;
754 const uint8_t values[] = {
755 0xD5, 0x09, 0xF3, 0x06, 0x86, 0xFC, 0x82, 0xF2,
756 0xC4, 0x08, 0x0B, 0x02, 0xAF, 0xF0, 0xBC, 0xDB,
757 0x13, 0x07, 0x40, 0x84, 0x68, 0x0F, 0x43, 0x24,
758 0xED, 0xF8, 0xB4, 0x78, 0xEA, 0x08, 0x00
760 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
761 if (res < 0)
762 return res;
766 const uint8_t values[] = {
767 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
768 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
769 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
770 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
772 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
773 if (res < 0)
774 return res;
778 const uint8_t values[] = {
779 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
780 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
781 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
782 0x00, 0x00, 0x00
784 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
785 if (res < 0)
786 return res;
789 res = tas5825m_set_page(dev, 0x03);
790 if (res < 0)
791 return res;
794 const uint8_t values[] = {
795 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
796 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
797 0x00, 0x00, 0x00, 0x00, 0x07, 0xB7, 0x9B, 0x16,
798 0xF0, 0x90, 0xC9, 0xD5, 0x07, 0xB7, 0x9B
800 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
801 if (res < 0)
802 return res;
806 const uint8_t values[] = {
807 0x16, 0x0F, 0x6D, 0xB0, 0xA9, 0xF8, 0x8F, 0x44,
808 0x52, 0x07, 0xBB, 0x6D, 0x71, 0xF0, 0xCF, 0x04,
809 0xEA, 0x07, 0x7F, 0x86, 0x4C, 0x0F, 0x30, 0xFB,
810 0x16, 0xF8, 0xC5, 0x0C, 0x43, 0x08, 0x49
812 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
813 if (res < 0)
814 return res;
818 const uint8_t values[] = {
819 0x93, 0xE5, 0xF0, 0x43, 0x4D, 0x1F, 0x07, 0x7D,
820 0x73, 0x57, 0x0F, 0xC0, 0x4F, 0x67, 0xF8, 0x3C,
821 0x95, 0x49, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
822 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
824 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
825 if (res < 0)
826 return res;
830 const uint8_t values[] = {
831 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
832 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
833 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
834 0x00, 0x00, 0x00
836 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
837 if (res < 0)
838 return res;
841 res = tas5825m_set_page(dev, 0x04);
842 if (res < 0)
843 return res;
846 const uint8_t values[] = {
847 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
848 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
849 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
850 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
852 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
853 if (res < 0)
854 return res;
858 const uint8_t values[] = {
859 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
860 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
861 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
862 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00
864 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
865 if (res < 0)
866 return res;
870 const uint8_t values[] = {
871 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
872 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
873 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
874 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
876 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
877 if (res < 0)
878 return res;
882 const uint8_t values[] = {
883 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
884 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
885 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
886 0x00, 0x00, 0x00
888 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
889 if (res < 0)
890 return res;
893 res = tas5825m_set_page(dev, 0x05);
894 if (res < 0)
895 return res;
898 const uint8_t values[] = {
899 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
900 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
901 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
902 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
904 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
905 if (res < 0)
906 return res;
910 const uint8_t values[] = {
911 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
912 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
913 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
914 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00
916 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
917 if (res < 0)
918 return res;
922 const uint8_t values[] = {
923 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
924 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
925 0x00, 0x00, 0x07, 0xB7, 0x9B, 0x16, 0xF0, 0x90,
926 0xC9, 0xD5, 0x07, 0xB7, 0x9B, 0x16, 0x0F
928 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
929 if (res < 0)
930 return res;
934 const uint8_t values[] = {
935 0x6D, 0xB0, 0xA9, 0xF8, 0x8F, 0x44, 0x52, 0x07,
936 0xBB, 0x6D, 0x71, 0xF0, 0xCF, 0x04, 0xEA, 0x07,
937 0x7F, 0x86, 0x4C, 0x0F, 0x30, 0xFB, 0x16, 0xF8,
938 0xC5, 0x0C, 0x43
940 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
941 if (res < 0)
942 return res;
945 res = tas5825m_set_page(dev, 0x06);
946 if (res < 0)
947 return res;
950 const uint8_t values[] = {
951 0x08, 0x49, 0x93, 0xE5, 0xF0, 0x43, 0x4D, 0x1F,
952 0x07, 0x7D, 0x73, 0x57, 0x0F, 0xC0, 0x4F, 0x67,
953 0xF8, 0x3C, 0x95, 0x49, 0x08, 0x00, 0x00, 0x00,
954 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
956 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
957 if (res < 0)
958 return res;
962 const uint8_t values[] = {
963 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
964 0x00
966 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
967 if (res < 0)
968 return res;
971 res = tas5825m_set_page(dev, 0x0E);
972 if (res < 0)
973 return res;
976 const uint8_t values[] = {
977 0x00, 0x99, 0xF7, 0x27, 0xFF, 0x09, 0x5A, 0xB9,
978 0x00, 0x66, 0xFF, 0x35, 0x0F, 0xB7, 0xB4, 0x87,
979 0xF8, 0x3D, 0xFA, 0x65
981 res = tas5825m_write_block_at(dev, 0x6C, values, ARRAY_SIZE(values));
982 if (res < 0)
983 return res;
986 res = tas5825m_set_page(dev, 0x0F);
987 if (res < 0)
988 return res;
991 const uint8_t values[] = {
992 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
993 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
994 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3D, 0x95,
995 0xFF, 0xFE, 0x7B, 0x29, 0xFF, 0xFF, 0x3D
997 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
998 if (res < 0)
999 return res;
1003 const uint8_t values[] = {
1004 0x95, 0x0F, 0x62, 0x3F, 0x77, 0xF8, 0x9A, 0xB6,
1005 0xDB, 0x07, 0xB1, 0xE2, 0x27, 0xF0, 0x9C, 0x3B,
1006 0xB2, 0x07, 0xB1, 0xE2, 0x27, 0x0F, 0x62, 0x3F,
1007 0x77, 0xF8, 0x9A, 0xB6, 0xDB, 0x00, 0x00
1009 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
1010 if (res < 0)
1011 return res;
1015 const uint8_t values[] = {
1016 0x38, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1017 0x00, 0x00, 0x0F, 0xD5, 0x55, 0x55, 0xF8, 0x2A,
1018 0x71, 0xC7
1020 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
1021 if (res < 0)
1022 return res;
1025 return 0;
1028 int tas5825m_setup(struct device *dev, int id)
1030 int res;
1032 res = tas5825m_set_book(dev, 0x00);
1033 if (res < 0)
1034 return res;
1036 res = tas5825m_write_at(dev, 0x60, 0x00);
1037 if (res < 0)
1038 return res;
1040 res = tas5825m_write_at(dev, 0x63, 0x03);
1041 if (res < 0)
1042 return res;
1044 res = tas5825m_write_at(dev, 0x64, 0x03);
1045 if (res < 0)
1046 return res;
1048 res = tas5825m_set_book(dev, 0x00);
1049 if (res < 0)
1050 return res;
1052 // Set to HiZ state and enable DSP
1053 res = tas5825m_write_at(dev, 0x03, 0x02);
1054 if (res < 0)
1055 return res;
1057 // Digital core and registers reset
1058 res = tas5825m_write_at(dev, 0x01, 0x11);
1059 if (res < 0)
1060 return res;
1062 res = tas5825m_set_page(dev, 0x00);
1063 if (res < 0)
1064 return res;
1066 res = tas5825m_set_page(dev, 0x00);
1067 if (res < 0)
1068 return res;
1070 res = tas5825m_set_page(dev, 0x00);
1071 if (res < 0)
1072 return res;
1074 res = tas5825m_set_page(dev, 0x00);
1075 if (res < 0)
1076 return res;
1078 res = tas5825m_set_page(dev, 0x00);
1079 if (res < 0)
1080 return res;
1082 res = tas5825m_set_book(dev, 0x00);
1083 if (res < 0)
1084 return res;
1086 res = tas5825m_write_at(dev, 0x46, 0x11);
1087 if (res < 0)
1088 return res;
1090 res = tas5825m_set_page(dev, 0x00);
1091 if (res < 0)
1092 return res;
1094 res = tas5825m_write_at(dev, 0x02, 0x00);
1095 if (res < 0)
1096 return res;
1098 res = tas5825m_write_at(dev, 0x53, 0x00);
1099 if (res < 0)
1100 return res;
1102 res = tas5825m_write_at(dev, 0x54, 0x00);
1103 if (res < 0)
1104 return res;
1106 res = tas5825m_write_at(dev, 0x29, 0x7C);
1107 if (res < 0)
1108 return res;
1110 // Reset to HiZ state and enable DSP
1111 res = tas5825m_write_at(dev, 0x03, 0x02);
1112 if (res < 0)
1113 return res;
1115 // Wait for device to settle
1116 mdelay(5);
1118 res = tas5825m_set_page(dev, 0x00);
1119 if (res < 0)
1120 return res;
1122 res = tas5825m_set_page(dev, 0x00);
1123 if (res < 0)
1124 return res;
1126 res = tas5825m_set_page(dev, 0x00);
1127 if (res < 0)
1128 return res;
1130 res = tas5825m_set_page(dev, 0x00);
1131 if (res < 0)
1132 return res;
1134 res = tas5825m_set_page(dev, 0x00);
1135 if (res < 0)
1136 return res;
1138 res = tas5825m_write_at(dev, 0x29, 0x00);
1139 if (res < 0)
1140 return res;
1142 res = tas5825m_set_book(dev, 0x00);
1143 if (res < 0)
1144 return res;
1146 // DSP reset
1147 res = tas5825m_write_at(dev, 0x03, 0x12);
1148 if (res < 0)
1149 return res;
1151 res = tas5825m_set_page(dev, 0x00);
1152 if (res < 0)
1153 return res;
1155 res = tas5825m_set_page(dev, 0x00);
1156 if (res < 0)
1157 return res;
1159 res = tas5825m_set_page(dev, 0x00);
1160 if (res < 0)
1161 return res;
1163 res = tas5825m_set_page(dev, 0x00);
1164 if (res < 0)
1165 return res;
1167 res = tas5825m_set_book(dev, 0x00);
1168 if (res < 0)
1169 return res;
1171 res = tas5825m_write_at(dev, 0x48, 0x0C);
1172 if (res < 0)
1173 return res;
1175 // Program DSP RAM
1176 res = program_dsp_ram(dev);
1177 if (res < 0)
1178 return res;
1180 res = tas5825m_set_book(dev, 0x78);
1181 if (res < 0)
1182 return res;
1184 res = tas5825m_set_page(dev, 0x18);
1185 if (res < 0)
1186 return res;
1189 const uint8_t values[] = {
1190 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1191 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1192 0x00, 0x00, 0x00, 0x00
1194 res = tas5825m_write_block_at(dev, 0x30, values, ARRAY_SIZE(values));
1195 if (res < 0)
1196 return res;
1199 res = tas5825m_set_book(dev, 0x78);
1200 if (res < 0)
1201 return res;
1203 res = tas5825m_set_page(dev, 0x1B);
1204 if (res < 0)
1205 return res;
1208 const uint8_t values[] = {
1209 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x04, 0x00,
1210 0x00, 0x00, 0x03, 0x28, 0x00, 0x00, 0x00, 0x00,
1211 0x00, 0x00, 0x00, 0x00
1213 res = tas5825m_write_block_at(dev, 0x6C, values, ARRAY_SIZE(values));
1214 if (res < 0)
1215 return res;
1218 res = tas5825m_set_page(dev, 0x1C);
1219 if (res < 0)
1220 return res;
1223 const uint8_t values[] = {
1224 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1225 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1226 0x00, 0x00, 0x00, 0x00
1228 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
1229 if (res < 0)
1230 return res;
1233 res = tas5825m_set_book(dev, 0x78);
1234 if (res < 0)
1235 return res;
1237 res = tas5825m_set_page(dev, 0x1C);
1238 if (res < 0)
1239 return res;
1242 const uint8_t values[] = {
1243 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00,
1244 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1245 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1246 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1248 res = tas5825m_write_block_at(dev, 0x1C, values, ARRAY_SIZE(values));
1249 if (res < 0)
1250 return res;
1254 const uint8_t values[] = {
1255 0x00, 0x00
1257 res = tas5825m_write_block_at(dev, 0xFD, values, ARRAY_SIZE(values));
1258 if (res < 0)
1259 return res;
1262 res = tas5825m_set_book(dev, 0x78);
1263 if (res < 0)
1264 return res;
1266 res = tas5825m_set_page(dev, 0x1C);
1267 if (res < 0)
1268 return res;
1271 const uint8_t values[] = {
1272 0x00, 0x00, 0x03, 0x38, 0x00, 0x00, 0x00, 0x00,
1273 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1274 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1276 res = tas5825m_write_block_at(dev, 0x3C, values, ARRAY_SIZE(values));
1277 if (res < 0)
1278 return res;
1281 res = tas5825m_set_book(dev, 0x78);
1282 if (res < 0)
1283 return res;
1285 res = tas5825m_set_page(dev, 0x1C);
1286 if (res < 0)
1287 return res;
1290 const uint8_t values[] = {
1291 0x00, 0x00, 0x03, 0x40, 0x00, 0x00, 0x03, 0x48,
1292 0x00, 0x00, 0x03, 0x50, 0x00, 0x00, 0x00, 0x00,
1293 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1294 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1296 res = tas5825m_write_block_at(dev, 0x54, values, ARRAY_SIZE(values));
1297 if (res < 0)
1298 return res;
1302 const uint8_t values[] = {
1303 0x00, 0x00
1305 res = tas5825m_write_block_at(dev, 0xFD, values, ARRAY_SIZE(values));
1306 if (res < 0)
1307 return res;
1310 res = tas5825m_set_book(dev, 0x78);
1311 if (res < 0)
1312 return res;
1314 res = tas5825m_set_page(dev, 0x1C);
1315 if (res < 0)
1316 return res;
1319 const uint8_t values[] = {
1320 0x00, 0x00, 0x03, 0x58, 0x00, 0x00, 0x03, 0x60,
1321 0x00, 0x00, 0x00, 0x00
1323 res = tas5825m_write_block_at(dev, 0x74, values, ARRAY_SIZE(values));
1324 if (res < 0)
1325 return res;
1328 res = tas5825m_set_page(dev, 0x1D);
1329 if (res < 0)
1330 return res;
1333 const uint8_t values[] = {
1334 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1335 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1336 0x00, 0x00, 0x00, 0x00
1338 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
1339 if (res < 0)
1340 return res;
1343 res = tas5825m_set_book(dev, 0x78);
1344 if (res < 0)
1345 return res;
1347 res = tas5825m_set_page(dev, 0x1D);
1348 if (res < 0)
1349 return res;
1352 const uint8_t values[] = {
1353 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1354 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1355 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1356 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1358 res = tas5825m_write_block_at(dev, 0x1C, values, ARRAY_SIZE(values));
1359 if (res < 0)
1360 return res;
1364 const uint8_t values[] = {
1365 0x00, 0x00
1367 res = tas5825m_write_block_at(dev, 0xFD, values, ARRAY_SIZE(values));
1368 if (res < 0)
1369 return res;
1372 res = tas5825m_set_book(dev, 0x78);
1373 if (res < 0)
1374 return res;
1376 res = tas5825m_set_page(dev, 0x1D);
1377 if (res < 0)
1378 return res;
1381 const uint8_t values[] = {
1382 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1383 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1384 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1385 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1387 res = tas5825m_write_block_at(dev, 0x3C, values, ARRAY_SIZE(values));
1388 if (res < 0)
1389 return res;
1393 const uint8_t values[] = {
1394 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1395 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1396 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1397 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1399 res = tas5825m_write_block_at(dev, 0x5B, values, ARRAY_SIZE(values));
1400 if (res < 0)
1401 return res;
1405 const uint8_t values[] = {
1406 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1408 res = tas5825m_write_block_at(dev, 0x7A, values, ARRAY_SIZE(values));
1409 if (res < 0)
1410 return res;
1413 res = tas5825m_set_page(dev, 0x1E);
1414 if (res < 0)
1415 return res;
1418 const uint8_t values[] = {
1419 0x00, 0x00, 0x00, 0x00
1421 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
1422 if (res < 0)
1423 return res;
1426 res = tas5825m_set_book(dev, 0x78);
1427 if (res < 0)
1428 return res;
1430 res = tas5825m_set_page(dev, 0x1E);
1431 if (res < 0)
1432 return res;
1435 const uint8_t values[] = {
1436 0x00, 0x00, 0x03, 0x68, 0x00, 0x00, 0x00, 0x00,
1437 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1438 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1440 res = tas5825m_write_block_at(dev, 0x0C, values, ARRAY_SIZE(values));
1441 if (res < 0)
1442 return res;
1445 res = tas5825m_set_book(dev, 0x78);
1446 if (res < 0)
1447 return res;
1449 res = tas5825m_set_page(dev, 0x1E);
1450 if (res < 0)
1451 return res;
1454 const uint8_t values[] = {
1455 0x00, 0x00, 0x03, 0x70, 0x00, 0x00, 0x03, 0x78,
1456 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00,
1457 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1458 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1460 res = tas5825m_write_block_at(dev, 0x24, values, ARRAY_SIZE(values));
1461 if (res < 0)
1462 return res;
1466 const uint8_t values[] = {
1467 0x00, 0x00
1469 res = tas5825m_write_block_at(dev, 0xFD, values, ARRAY_SIZE(values));
1470 if (res < 0)
1471 return res;
1474 res = tas5825m_set_book(dev, 0x78);
1475 if (res < 0)
1476 return res;
1478 res = tas5825m_set_page(dev, 0x1E);
1479 if (res < 0)
1480 return res;
1483 const uint8_t values[] = {
1484 0x00, 0x00, 0x04, 0x88, 0x00, 0x00, 0x04, 0x90,
1486 res = tas5825m_write_block_at(dev, 0x44, values, ARRAY_SIZE(values));
1487 if (res < 0)
1488 return res;
1491 res = tas5825m_set_book(dev, 0x8C);
1492 if (res < 0)
1493 return res;
1495 res = tas5825m_set_page(dev, 0x0E);
1496 if (res < 0)
1497 return res;
1500 const uint8_t values[] = {
1501 0x00, 0xA7, 0x26, 0x4A, 0x7F, 0xFF, 0xFF, 0xFF,
1502 0x00, 0x20, 0xC4, 0x9C, 0x00, 0x20, 0xC4, 0x9C,
1503 0x00, 0x00, 0x68, 0xDB, 0x00, 0x00, 0xD1, 0xB7,
1504 0x00, 0x00, 0x68, 0xDB, 0x0F, 0xA4, 0xA8
1506 res = tas5825m_write_block_at(dev, 0x5C, values, ARRAY_SIZE(values));
1507 if (res < 0)
1508 return res;
1512 const uint8_t values[] = {
1513 0xC1, 0xF8, 0x59, 0x7F, 0x63
1515 res = tas5825m_write_block_at(dev, 0x7B, values, ARRAY_SIZE(values));
1516 if (res < 0)
1517 return res;
1520 res = tas5825m_set_page(dev, 0x0F);
1521 if (res < 0)
1522 return res;
1525 const uint8_t values[] = {
1526 0x07, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
1527 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1528 0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xB7, 0xE9,
1529 0x00, 0x5F, 0x6F, 0xD2, 0x00, 0x2F, 0xB7
1531 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
1532 if (res < 0)
1533 return res;
1537 const uint8_t values[] = {
1538 0xE9, 0x0B, 0x1E, 0x4F, 0x76, 0xFC, 0x23, 0x05,
1539 0x54, 0xFA, 0x41, 0x20, 0x5C, 0x0B, 0x7D, 0xBF,
1540 0x48, 0xFA, 0x41, 0x20, 0x5C, 0x0B, 0x1E, 0x4F,
1541 0x76, 0xFC, 0x23, 0x05, 0x54, 0x00, 0x04
1543 res = tas5825m_write_block_at(dev, 0x27, values, ARRAY_SIZE(values));
1544 if (res < 0)
1545 return res;
1549 const uint8_t values[] = {
1550 0x81, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1551 0x00, 0x00, 0x0F, 0x3F, 0xE5, 0xC9, 0xF8, 0xBB,
1552 0x98, 0xC8, 0x07, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
1553 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1555 res = tas5825m_write_block_at(dev, 0x46, values, ARRAY_SIZE(values));
1556 if (res < 0)
1557 return res;
1561 const uint8_t values[] = {
1562 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1563 0x04, 0x81, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x00,
1564 0x00, 0x00, 0x00, 0x0F, 0x3F, 0xE5, 0xC9, 0xF8,
1565 0xBB, 0x98, 0xC8
1567 res = tas5825m_write_block_at(dev, 0x65, values, ARRAY_SIZE(values));
1568 if (res < 0)
1569 return res;
1572 res = tas5825m_set_page(dev, 0x10);
1573 if (res < 0)
1574 return res;
1577 const uint8_t values[] = {
1578 0x00, 0x89, 0xA0, 0x27, 0x7F, 0xEC, 0x56, 0xD5,
1579 0x7F, 0xFC, 0xB9, 0x23, 0x00, 0x89, 0xA0, 0x27,
1580 0x7F, 0xEC, 0x56, 0xD5, 0x7F, 0xFC, 0xB9, 0x23,
1582 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
1583 if (res < 0)
1584 return res;
1587 res = tas5825m_set_book(dev, 0x00);
1588 if (res < 0)
1589 return res;
1591 res = tas5825m_write_at(dev, 0x40, 0x00);
1592 if (res < 0)
1593 return res;
1595 res = tas5825m_set_book(dev, 0x00);
1596 if (res < 0)
1597 return res;
1600 const uint8_t values[] = {
1601 0x11, 0xFF
1603 res = tas5825m_write_block_at(dev, 0x7D, values, ARRAY_SIZE(values));
1604 if (res < 0)
1605 return res;
1608 res = tas5825m_set_page(dev, 0x01);
1609 if (res < 0)
1610 return res;
1612 res = tas5825m_write_at(dev, 0x51, 0x05);
1613 if (res < 0)
1614 return res;
1616 res = tas5825m_set_page(dev, 0x02);
1617 if (res < 0)
1618 return res;
1620 res = tas5825m_write_at(dev, 0x19, 0xDF);
1621 if (res < 0)
1622 return res;
1624 res = tas5825m_set_book(dev, 0x8C);
1625 if (res < 0)
1626 return res;
1628 res = tas5825m_set_page(dev, 0x01);
1629 if (res < 0)
1630 return res;
1633 const uint8_t values[] = {
1634 0x00, 0x71, 0x94, 0x9A
1636 res = tas5825m_write_block_at(dev, 0x2C, values, ARRAY_SIZE(values));
1637 if (res < 0)
1638 return res;
1641 res = tas5825m_set_page(dev, 0x0A);
1642 if (res < 0)
1643 return res;
1646 const uint8_t values[] = {
1647 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1648 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
1649 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1650 0x00, 0x00, 0x00, 0x00
1652 res = tas5825m_write_block_at(dev, 0x64, values, ARRAY_SIZE(values));
1653 if (res < 0)
1654 return res;
1657 res = tas5825m_set_page(dev, 0x0B);
1658 if (res < 0)
1659 return res;
1662 const uint8_t values[] = {
1663 0x00, 0x80, 0x00, 0x00, 0x00, 0x37, 0xDF, 0xC0,
1664 0x00, 0x37, 0xDF, 0xC0, 0x00, 0x80, 0x00, 0x00,
1665 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1666 0x00, 0x80, 0x00, 0x00
1668 res = tas5825m_write_block_at(dev, 0x08, values, ARRAY_SIZE(values));
1669 if (res < 0)
1670 return res;
1674 const uint8_t values[] = {
1675 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
1676 0x00, 0x00, 0x57, 0x62, 0x00, 0x00, 0x00, 0x00,
1678 res = tas5825m_write_block_at(dev, 0x28, values, ARRAY_SIZE(values));
1679 if (res < 0)
1680 return res;
1683 res = tas5825m_set_page(dev, 0x0E);
1684 if (res < 0)
1685 return res;
1688 const uint8_t values[] = {
1689 0x00, 0x03, 0x69, 0xC5, 0x00, 0x60, 0x3F, 0x2A,
1690 0x00, 0x22, 0x1D, 0x95, 0x00, 0x03, 0x69, 0xC5,
1692 res = tas5825m_write_block_at(dev, 0x5C, values, ARRAY_SIZE(values));
1693 if (res < 0)
1694 return res;
1697 res = tas5825m_set_page(dev, 0x0F);
1698 if (res < 0)
1699 return res;
1702 const uint8_t values[] = {
1703 0x7F, 0xF9, 0x2C, 0x60, 0x04, 0x1A, 0xB4, 0xF9,
1705 res = tas5825m_write_block_at(dev, 0x5C, values, ARRAY_SIZE(values));
1706 if (res < 0)
1707 return res;
1710 res = tas5825m_set_page(dev, 0x07);
1711 if (res < 0)
1712 return res;
1715 const uint8_t values[] = {
1716 0x00, 0x80, 0x00, 0x00
1718 res = tas5825m_write_block_at(dev, 0x64, values, ARRAY_SIZE(values));
1719 if (res < 0)
1720 return res;
1724 const uint8_t values[] = {
1725 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
1727 res = tas5825m_write_block_at(dev, 0x6C, values, ARRAY_SIZE(values));
1728 if (res < 0)
1729 return res;
1732 // Program biquad filters
1733 res = program_biquad_filters(dev);
1734 if (res < 0)
1735 return res;
1737 res = tas5825m_set_book(dev, 0x00);
1738 if (res < 0)
1739 return res;
1741 // Register tuning
1742 res = tas5825m_write_at(dev, 0x60, 0x00);
1743 if (res < 0)
1744 return res;
1746 res = tas5825m_write_at(dev, 0x63, 0x03);
1747 if (res < 0)
1748 return res;
1750 res = tas5825m_write_at(dev, 0x30, 0x00);
1751 if (res < 0)
1752 return res;
1754 res = tas5825m_write_at(dev, 0x4C, 0x30);
1755 if (res < 0)
1756 return res;
1758 res = tas5825m_write_at(dev, 0x03, 0x0B);
1759 if (res < 0)
1760 return res;
1762 res = tas5825m_set_book(dev, 0x00);
1763 if (res < 0)
1764 return res;
1766 // Clear analog fault
1767 res = tas5825m_write_at(dev, 0x78, 0x80);
1768 if (res < 0)
1769 return res;
1771 mdelay(100);
1773 // Set to PLAY state
1774 res = tas5825m_write_at(dev, 0x03, 0x03);
1775 if (res < 0)
1776 return res;
1778 res = tas5825m_set_book(dev, 0x00);
1779 if (res < 0)
1780 return res;
1782 res = tas5825m_write_at(dev, 0x03, 0x03);
1783 if (res < 0)
1784 return res;
1786 return 0;