aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/au88x0/au88x0_xtalk.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/au88x0/au88x0_xtalk.c')
-rw-r--r--sound/pci/au88x0/au88x0_xtalk.c151
1 files changed, 88 insertions, 63 deletions
diff --git a/sound/pci/au88x0/au88x0_xtalk.c b/sound/pci/au88x0/au88x0_xtalk.c
index b4151e208b7..b278e285fd4 100644
--- a/sound/pci/au88x0/au88x0_xtalk.c
+++ b/sound/pci/au88x0/au88x0_xtalk.c
@@ -48,43 +48,61 @@ static unsigned short const wXtalkNarrowLeftDelay = 0x7;
48static unsigned short const wXtalkNarrowRightDelay = 0x7; 48static unsigned short const wXtalkNarrowRightDelay = 0x7;
49 49
50static xtalk_gains_t const asXtalkGainsDefault = { 50static xtalk_gains_t const asXtalkGainsDefault = {
51 0x4000, 0x4000, 4000, 0x4000, 4000, 0x4000, 4000, 0x4000, 4000, 51 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
52 0x4000 52 0x4000, 0x4000, 0x4000, 0x4000, 0x4000
53}; 53};
54 54
55static xtalk_gains_t const asXtalkGainsTest = { 55static xtalk_gains_t const asXtalkGainsTest = {
56 0x8000, 0x7FFF, 0, 0xFFFF, 0x0001, 0xC000, 0x4000, 0xFFFE, 0x0002, 56 0x7fff, 0x8000, 0x0000, 0x0000, 0x0001,
57 0 57 0xffff, 0x4000, 0xc000, 0x0002, 0xfffe
58}; 58};
59
59static xtalk_gains_t const asXtalkGains1Chan = { 60static xtalk_gains_t const asXtalkGains1Chan = {
60 0x7FFF, 0, 0, 0, 0x7FFF, 0, 0, 0, 0, 0 61 0x7FFF, 0, 0, 0, 0,
62 0x7FFF, 0, 0, 0, 0,
61}; 63};
62 64
63// Input gain for 4 A3D slices. One possible input pair is left zero. 65// Input gain for 4 A3D slices. One possible input pair is left zero.
64static xtalk_gains_t const asXtalkGainsAllChan = { 66static xtalk_gains_t const asXtalkGainsAllChan = {
65 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 67 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0,
66 0 68 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0
67 //0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff 69};
70
71static xtalk_gains_t const asXtalkGainsZeros = {
72 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
68}; 73};
69static xtalk_gains_t const asXtalkGainsZeros;
70 74
71static xtalk_dline_t const alXtalkDlineZeros; 75static xtalk_dline_t const alXtalkDlineZeros = {
76 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
77 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
78};
72static xtalk_dline_t const alXtalkDlineTest = { 79static xtalk_dline_t const alXtalkDlineTest = {
73 0xFC18, 0x03E8FFFF, 0x186A0, 0x7960FFFE, 1, 0xFFFFFFFF, 80 0x0000fc18, 0xfff03e8, 0x000186a0, 0xfffe7960, 1, 0xffffffff, 0, 0,
74 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
82 0, 0, 0, 0, 0, 0, 0, 0
83};
84
85static xtalk_instate_t const asXtalkInStateZeros = {
75 0, 0, 0, 0 86 0, 0, 0, 0
76}; 87};
77 88
78static xtalk_instate_t const asXtalkInStateZeros; 89static xtalk_instate_t const asXtalkInStateTest = {
79static xtalk_instate_t const asXtalkInStateTest = 90 0x0080, 0xff80, 0x0001, 0xffff
80 { 0xFF80, 0x0080, 0xFFFF, 0x0001 }; 91};
81static xtalk_state_t const asXtalkOutStateZeros; 92
93static xtalk_state_t const asXtalkOutStateZeros = {
94 {0, 0, 0, 0},
95 {0, 0, 0, 0},
96 {0, 0, 0, 0},
97 {0, 0, 0, 0},
98 {0, 0, 0, 0}
99};
82 100
83static short const sDiamondKLeftEq = 0x401d; 101static short const sDiamondKLeftEq = 0x401d;
84static short const sDiamondKRightEq = 0x401d; 102static short const sDiamondKRightEq = 0x401d;
85static short const sDiamondKLeftXt = 0xF90E; 103static short const sDiamondKLeftXt = 0xF90E;
86static short const sDiamondKRightXt = 0xF90E; 104static short const sDiamondKRightXt = 0xF90E;
87static short const sDiamondShiftLeftEq = 1; /* 0xF90E Is this a bug ??? */ 105static short const sDiamondShiftLeftEq = 1;
88static short const sDiamondShiftRightEq = 1; 106static short const sDiamondShiftRightEq = 1;
89static short const sDiamondShiftLeftXt = 0; 107static short const sDiamondShiftLeftXt = 0;
90static short const sDiamondShiftRightXt = 0; 108static short const sDiamondShiftRightXt = 0;
@@ -94,29 +112,29 @@ static unsigned short const wDiamondRightDelay = 0xb;
94static xtalk_coefs_t const asXtalkWideCoefsLeftEq = { 112static xtalk_coefs_t const asXtalkWideCoefsLeftEq = {
95 {0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0}, 113 {0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0},
96 {0x5F60, 0xCBCB, 0xFC26, 0x0305, 0}, 114 {0x5F60, 0xCBCB, 0xFC26, 0x0305, 0},
97 {0x340B, 0xf504, 0x6CE8, 0x0D23, 0x00E4}, 115 {0x340B, 0xe8f5, 0x236c, 0xe40d, 0},
98 {0xD500, 0x8D76, 0xACC7, 0x5B05, 0x00FA}, 116 {0x76d5, 0xc78d, 0x05ac, 0xfa5b, 0},
99 {0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0} 117 {0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0}
100}; 118};
101static xtalk_coefs_t const asXtalkWideCoefsRightEq = { 119static xtalk_coefs_t const asXtalkWideCoefsRightEq = {
102 {0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0}, 120 {0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0},
103 {0x5F60, 0xCBCB, 0xFC26, 0x0305, 0}, 121 {0x5F60, 0xCBCB, 0xFC26, 0x0305, 0},
104 {0x340B, 0xF504, 0x6CE8, 0x0D23, 0x00E4}, 122 {0x340B, 0xe8f5, 0x236c, 0xe40d, 0},
105 {0xD500, 0x8D76, 0xACC7, 0x5B05, 0x00FA}, 123 {0x76d5, 0xc78d, 0x05ac, 0xfa5b, 0},
106 {0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0} 124 {0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0}
107}; 125};
108static xtalk_coefs_t const asXtalkWideCoefsLeftXt = { 126static xtalk_coefs_t const asXtalkWideCoefsLeftXt = {
109 {0x86C3, 0x7B55, 0x89C3, 0x005B, 0x0047}, 127 {0x55c6, 0xc97b, 0x005b, 0x0047, 0},
110 {0x6000, 0x206A, 0xC6CA, 0x40FF, 0}, 128 {0x6a60, 0xca20, 0xffc6, 0x0040, 0},
111 {0x1100, 0x1164, 0xA1D7, 0x90FC, 0x0001}, 129 {0x6411, 0xd711, 0xfca1, 0x0190, 0},
112 {0xDC00, 0x9E77, 0xB8C7, 0x0AFF, 0}, 130 {0x77dc, 0xc79e, 0xffb8, 0x000a, 0},
113 {0, 0, 0, 0, 0} 131 {0, 0, 0, 0, 0}
114}; 132};
115static xtalk_coefs_t const asXtalkWideCoefsRightXt = { 133static xtalk_coefs_t const asXtalkWideCoefsRightXt = {
116 {0x86C3, 0x7B55, 0x89C3, 0x005B, 0x0047}, 134 {0x55c6, 0xc97b, 0x005b, 0x0047, 0},
117 {0x6000, 0x206A, 0xC6CA, 0x40FF, 0}, 135 {0x6a60, 0xca20, 0xffc6, 0x0040, 0},
118 {0x1100, 0x1164, 0xA1D7, 0x90FC, 0x0001}, 136 {0x6411, 0xd711, 0xfca1, 0x0190, 0},
119 {0xDC00, 0x9E77, 0xB8C7, 0x0AFF, 0}, 137 {0x77dc, 0xc79e, 0xffb8, 0x000a, 0},
120 {0, 0, 0, 0, 0} 138 {0, 0, 0, 0, 0}
121}; 139};
122static xtalk_coefs_t const asXtalkNarrowCoefsLeftEq = { 140static xtalk_coefs_t const asXtalkNarrowCoefsLeftEq = {
@@ -151,7 +169,14 @@ static xtalk_coefs_t const asXtalkNarrowCoefsRightXt = {
151 {0, 0, 0, 0, 0} 169 {0, 0, 0, 0, 0}
152}; 170};
153 171
154static xtalk_coefs_t const asXtalkCoefsZeros; 172static xtalk_coefs_t const asXtalkCoefsZeros = {
173 {0, 0, 0, 0, 0},
174 {0, 0, 0, 0, 0},
175 {0, 0, 0, 0, 0},
176 {0, 0, 0, 0, 0},
177 {0, 0, 0, 0, 0}
178};
179
155static xtalk_coefs_t const asXtalkCoefsPipe = { 180static xtalk_coefs_t const asXtalkCoefsPipe = {
156 {0, 0, 0x0FA0, 0, 0}, 181 {0, 0, 0x0FA0, 0, 0},
157 {0, 0, 0x0FA0, 0, 0}, 182 {0, 0, 0x0FA0, 0, 0},
@@ -186,7 +211,7 @@ static xtalk_coefs_t const asXtalkCoefsDenTest = {
186static xtalk_state_t const asXtalkOutStateTest = { 211static xtalk_state_t const asXtalkOutStateTest = {
187 {0x7FFF, 0x0004, 0xFFFC, 0}, 212 {0x7FFF, 0x0004, 0xFFFC, 0},
188 {0xFE00, 0x0008, 0xFFF8, 0x4000}, 213 {0xFE00, 0x0008, 0xFFF8, 0x4000},
189 {0x200, 0x0010, 0xFFF0, 0xC000}, 214 {0x0200, 0x0010, 0xFFF0, 0xC000},
190 {0x8000, 0x0020, 0xFFE0, 0}, 215 {0x8000, 0x0020, 0xFFE0, 0},
191 {0, 0, 0, 0} 216 {0, 0, 0, 0}
192}; 217};
@@ -306,10 +331,10 @@ vortex_XtalkHw_SetLeftEQStates(vortex_t * vortex,
306 hwwrite(vortex->mmio, 0x2421C + i * 0x24, coefs[i][2]); 331 hwwrite(vortex->mmio, 0x2421C + i * 0x24, coefs[i][2]);
307 hwwrite(vortex->mmio, 0x24220 + i * 0x24, coefs[i][3]); 332 hwwrite(vortex->mmio, 0x24220 + i * 0x24, coefs[i][3]);
308 } 333 }
309 hwwrite(vortex->mmio, 0x244F8 + i * 0x24, arg_0[0]); 334 hwwrite(vortex->mmio, 0x244F8, arg_0[0]);
310 hwwrite(vortex->mmio, 0x244FC + i * 0x24, arg_0[1]); 335 hwwrite(vortex->mmio, 0x244FC, arg_0[1]);
311 hwwrite(vortex->mmio, 0x24500 + i * 0x24, arg_0[2]); 336 hwwrite(vortex->mmio, 0x24500, arg_0[2]);
312 hwwrite(vortex->mmio, 0x24504 + i * 0x24, arg_0[3]); 337 hwwrite(vortex->mmio, 0x24504, arg_0[3]);
313} 338}
314 339
315static void 340static void
@@ -325,10 +350,10 @@ vortex_XtalkHw_SetRightEQStates(vortex_t * vortex,
325 hwwrite(vortex->mmio, 0x242D0 + i * 0x24, coefs[i][2]); 350 hwwrite(vortex->mmio, 0x242D0 + i * 0x24, coefs[i][2]);
326 hwwrite(vortex->mmio, 0x244D4 + i * 0x24, coefs[i][3]); 351 hwwrite(vortex->mmio, 0x244D4 + i * 0x24, coefs[i][3]);
327 } 352 }
328 hwwrite(vortex->mmio, 0x24508 + i * 0x24, arg_0[0]); 353 hwwrite(vortex->mmio, 0x24508, arg_0[0]);
329 hwwrite(vortex->mmio, 0x2450C + i * 0x24, arg_0[1]); 354 hwwrite(vortex->mmio, 0x2450C, arg_0[1]);
330 hwwrite(vortex->mmio, 0x24510 + i * 0x24, arg_0[2]); 355 hwwrite(vortex->mmio, 0x24510, arg_0[2]);
331 hwwrite(vortex->mmio, 0x24514 + i * 0x24, arg_0[3]); 356 hwwrite(vortex->mmio, 0x24514, arg_0[3]);
332} 357}
333 358
334static void 359static void
@@ -344,10 +369,10 @@ vortex_XtalkHw_SetLeftXTStates(vortex_t * vortex,
344 hwwrite(vortex->mmio, 0x24384 + i * 0x24, coefs[i][2]); 369 hwwrite(vortex->mmio, 0x24384 + i * 0x24, coefs[i][2]);
345 hwwrite(vortex->mmio, 0x24388 + i * 0x24, coefs[i][3]); 370 hwwrite(vortex->mmio, 0x24388 + i * 0x24, coefs[i][3]);
346 } 371 }
347 hwwrite(vortex->mmio, 0x24518 + i * 0x24, arg_0[0]); 372 hwwrite(vortex->mmio, 0x24518, arg_0[0]);
348 hwwrite(vortex->mmio, 0x2451C + i * 0x24, arg_0[1]); 373 hwwrite(vortex->mmio, 0x2451C, arg_0[1]);
349 hwwrite(vortex->mmio, 0x24520 + i * 0x24, arg_0[2]); 374 hwwrite(vortex->mmio, 0x24520, arg_0[2]);
350 hwwrite(vortex->mmio, 0x24524 + i * 0x24, arg_0[3]); 375 hwwrite(vortex->mmio, 0x24524, arg_0[3]);
351} 376}
352 377
353static void 378static void
@@ -363,10 +388,10 @@ vortex_XtalkHw_SetRightXTStates(vortex_t * vortex,
363 hwwrite(vortex->mmio, 0x24438 + i * 0x24, coefs[i][2]); 388 hwwrite(vortex->mmio, 0x24438 + i * 0x24, coefs[i][2]);
364 hwwrite(vortex->mmio, 0x2443C + i * 0x24, coefs[i][3]); 389 hwwrite(vortex->mmio, 0x2443C + i * 0x24, coefs[i][3]);
365 } 390 }
366 hwwrite(vortex->mmio, 0x24528 + i * 0x24, arg_0[0]); 391 hwwrite(vortex->mmio, 0x24528, arg_0[0]);
367 hwwrite(vortex->mmio, 0x2452C + i * 0x24, arg_0[1]); 392 hwwrite(vortex->mmio, 0x2452C, arg_0[1]);
368 hwwrite(vortex->mmio, 0x24530 + i * 0x24, arg_0[2]); 393 hwwrite(vortex->mmio, 0x24530, arg_0[2]);
369 hwwrite(vortex->mmio, 0x24534 + i * 0x24, arg_0[3]); 394 hwwrite(vortex->mmio, 0x24534, arg_0[3]);
370} 395}
371 396
372#if 0 397#if 0
@@ -450,10 +475,10 @@ vortex_XtalkHw_GetLeftEQStates(vortex_t * vortex, xtalk_instate_t arg_0,
450 coefs[i][2] = hwread(vortex->mmio, 0x2421C + i * 0x24); 475 coefs[i][2] = hwread(vortex->mmio, 0x2421C + i * 0x24);
451 coefs[i][3] = hwread(vortex->mmio, 0x24220 + i * 0x24); 476 coefs[i][3] = hwread(vortex->mmio, 0x24220 + i * 0x24);
452 } 477 }
453 arg_0[0] = hwread(vortex->mmio, 0x244F8 + i * 0x24); 478 arg_0[0] = hwread(vortex->mmio, 0x244F8);
454 arg_0[1] = hwread(vortex->mmio, 0x244FC + i * 0x24); 479 arg_0[1] = hwread(vortex->mmio, 0x244FC);
455 arg_0[2] = hwread(vortex->mmio, 0x24500 + i * 0x24); 480 arg_0[2] = hwread(vortex->mmio, 0x24500);
456 arg_0[3] = hwread(vortex->mmio, 0x24504 + i * 0x24); 481 arg_0[3] = hwread(vortex->mmio, 0x24504);
457} 482}
458 483
459static void 484static void
@@ -468,10 +493,10 @@ vortex_XtalkHw_GetRightEQStates(vortex_t * vortex, xtalk_instate_t arg_0,
468 coefs[i][2] = hwread(vortex->mmio, 0x242D0 + i * 0x24); 493 coefs[i][2] = hwread(vortex->mmio, 0x242D0 + i * 0x24);
469 coefs[i][3] = hwread(vortex->mmio, 0x242D4 + i * 0x24); 494 coefs[i][3] = hwread(vortex->mmio, 0x242D4 + i * 0x24);
470 } 495 }
471 arg_0[0] = hwread(vortex->mmio, 0x24508 + i * 0x24); 496 arg_0[0] = hwread(vortex->mmio, 0x24508);
472 arg_0[1] = hwread(vortex->mmio, 0x2450C + i * 0x24); 497 arg_0[1] = hwread(vortex->mmio, 0x2450C);
473 arg_0[2] = hwread(vortex->mmio, 0x24510 + i * 0x24); 498 arg_0[2] = hwread(vortex->mmio, 0x24510);
474 arg_0[3] = hwread(vortex->mmio, 0x24514 + i * 0x24); 499 arg_0[3] = hwread(vortex->mmio, 0x24514);
475} 500}
476 501
477static void 502static void
@@ -486,10 +511,10 @@ vortex_XtalkHw_GetLeftXTStates(vortex_t * vortex, xtalk_instate_t arg_0,
486 coefs[i][2] = hwread(vortex->mmio, 0x24384 + i * 0x24); 511 coefs[i][2] = hwread(vortex->mmio, 0x24384 + i * 0x24);
487 coefs[i][3] = hwread(vortex->mmio, 0x24388 + i * 0x24); 512 coefs[i][3] = hwread(vortex->mmio, 0x24388 + i * 0x24);
488 } 513 }
489 arg_0[0] = hwread(vortex->mmio, 0x24518 + i * 0x24); 514 arg_0[0] = hwread(vortex->mmio, 0x24518);
490 arg_0[1] = hwread(vortex->mmio, 0x2451C + i * 0x24); 515 arg_0[1] = hwread(vortex->mmio, 0x2451C);
491 arg_0[2] = hwread(vortex->mmio, 0x24520 + i * 0x24); 516 arg_0[2] = hwread(vortex->mmio, 0x24520);
492 arg_0[3] = hwread(vortex->mmio, 0x24524 + i * 0x24); 517 arg_0[3] = hwread(vortex->mmio, 0x24524);
493} 518}
494 519
495static void 520static void
@@ -504,10 +529,10 @@ vortex_XtalkHw_GetRightXTStates(vortex_t * vortex, xtalk_instate_t arg_0,
504 coefs[i][2] = hwread(vortex->mmio, 0x24438 + i * 0x24); 529 coefs[i][2] = hwread(vortex->mmio, 0x24438 + i * 0x24);
505 coefs[i][3] = hwread(vortex->mmio, 0x2443C + i * 0x24); 530 coefs[i][3] = hwread(vortex->mmio, 0x2443C + i * 0x24);
506 } 531 }
507 arg_0[0] = hwread(vortex->mmio, 0x24528 + i * 0x24); 532 arg_0[0] = hwread(vortex->mmio, 0x24528);
508 arg_0[1] = hwread(vortex->mmio, 0x2452C + i * 0x24); 533 arg_0[1] = hwread(vortex->mmio, 0x2452C);
509 arg_0[2] = hwread(vortex->mmio, 0x24530 + i * 0x24); 534 arg_0[2] = hwread(vortex->mmio, 0x24530);
510 arg_0[3] = hwread(vortex->mmio, 0x24534 + i * 0x24); 535 arg_0[3] = hwread(vortex->mmio, 0x24534);
511} 536}
512 537
513#endif 538#endif