Linux Audio

Check our new training course

Linux BSP development engineering services

Need help to port Linux and bootloaders to your hardware?
Loading...
v5.9
  1// SPDX-License-Identifier: GPL-2.0-or-later
  2/***************************************************************************
  3 *            au88x0_cxtalk.c
  4 *
  5 *  Wed Nov 19 16:29:47 2003
  6 *  Copyright  2003  mjander
  7 *  mjander@users.sourceforge.org
  8 ****************************************************************************/
  9
 10/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 11 */
 12
 13#include "au88x0_xtalk.h"
 14
 15/* Data (a whole lot of data.... ) */
 16
 17static short const sXtalkWideKLeftEq = 0x269C;
 18static short const sXtalkWideKRightEq = 0x269C;
 19static short const sXtalkWideKLeftXt = 0xF25E;
 20static __maybe_unused short const sXtalkWideKRightXt = 0xF25E;
 21static short const sXtalkWideShiftLeftEq = 1;
 22static short const sXtalkWideShiftRightEq = 1;
 23static short const sXtalkWideShiftLeftXt = 0;
 24static __maybe_unused short const sXtalkWideShiftRightXt = 0;
 25static unsigned short const wXtalkWideLeftDelay = 0xd;
 26static unsigned short const wXtalkWideRightDelay = 0xd;
 27static short const sXtalkNarrowKLeftEq = 0x468D;
 28static short const sXtalkNarrowKRightEq = 0x468D;
 29static short const sXtalkNarrowKLeftXt = 0xF82E;
 30static __maybe_unused short const sXtalkNarrowKRightXt = 0xF82E;
 31static short const sXtalkNarrowShiftLeftEq = 0x3;
 32static short const sXtalkNarrowShiftRightEq = 0x3;
 33static short const sXtalkNarrowShiftLeftXt = 0;
 34static __maybe_unused short const sXtalkNarrowShiftRightXt = 0;
 35static unsigned short const wXtalkNarrowLeftDelay = 0x7;
 36static unsigned short const wXtalkNarrowRightDelay = 0x7;
 37
 38static __maybe_unused xtalk_gains_t const asXtalkGainsDefault = {
 39	0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
 40	0x4000, 0x4000, 0x4000, 0x4000,	0x4000
 41};
 42
 43static __maybe_unused xtalk_gains_t const asXtalkGainsTest = {
 44	0x7fff, 0x8000, 0x0000, 0x0000, 0x0001,
 45	0xffff, 0x4000, 0xc000, 0x0002, 0xfffe
 46};
 47
 48static __maybe_unused xtalk_gains_t const asXtalkGains1Chan = {
 49	0x7FFF, 0, 0, 0, 0,
 50	0x7FFF, 0, 0, 0, 0,
 51};
 52
 53// Input gain for 4 A3D slices. One possible input pair is left zero.
 54static xtalk_gains_t const asXtalkGainsAllChan = {
 55	0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0,
 56	0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF,	0
 57};
 58
 59static xtalk_gains_t const asXtalkGainsZeros = {
 60	0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 61};
 62
 63static xtalk_dline_t const alXtalkDlineZeros = {
 64	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 65	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 66};
 67static __maybe_unused xtalk_dline_t const alXtalkDlineTest = {
 68	0x0000fc18, 0xfff03e8, 0x000186a0, 0xfffe7960, 1, 0xffffffff, 0, 0,
 69	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 70	0, 0, 0, 0, 0, 0, 0, 0
 71};
 72
 73static xtalk_instate_t const asXtalkInStateZeros = {
 74	0, 0, 0, 0
 75};
 76
 77static __maybe_unused xtalk_instate_t const asXtalkInStateTest = {
 78	0x0080, 0xff80, 0x0001, 0xffff
 79};
 80
 81static xtalk_state_t const asXtalkOutStateZeros = {
 82	{0, 0, 0, 0},
 83	{0, 0, 0, 0},
 84	{0, 0, 0, 0},
 85	{0, 0, 0, 0},
 86	{0, 0, 0, 0}
 87};
 88
 89static short const sDiamondKLeftEq = 0x401d;
 90static short const sDiamondKRightEq = 0x401d;
 91static short const sDiamondKLeftXt = 0xF90E;
 92static __maybe_unused short const sDiamondKRightXt = 0xF90E;
 93static short const sDiamondShiftLeftEq = 1;
 94static short const sDiamondShiftRightEq = 1;
 95static short const sDiamondShiftLeftXt = 0;
 96static __maybe_unused short const sDiamondShiftRightXt = 0;
 97static unsigned short const wDiamondLeftDelay = 0xb;
 98static unsigned short const wDiamondRightDelay = 0xb;
 99
100static xtalk_coefs_t const asXtalkWideCoefsLeftEq = {
101	{0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0},
102	{0x5F60, 0xCBCB, 0xFC26, 0x0305, 0},
103	{0x340B, 0xe8f5, 0x236c, 0xe40d, 0},
104	{0x76d5, 0xc78d, 0x05ac, 0xfa5b, 0},
105	{0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0}
106};
107static xtalk_coefs_t const asXtalkWideCoefsRightEq = {
108	{0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0},
109	{0x5F60, 0xCBCB, 0xFC26, 0x0305, 0},
110	{0x340B, 0xe8f5, 0x236c, 0xe40d, 0},
111	{0x76d5, 0xc78d, 0x05ac, 0xfa5b, 0},
112	{0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0}
113};
114static xtalk_coefs_t const asXtalkWideCoefsLeftXt = {
115	{0x55c6, 0xc97b, 0x005b, 0x0047, 0},
116	{0x6a60, 0xca20, 0xffc6, 0x0040, 0},
117	{0x6411, 0xd711, 0xfca1, 0x0190, 0},
118	{0x77dc, 0xc79e, 0xffb8, 0x000a, 0},
119	{0, 0, 0, 0, 0}
120};
121static __maybe_unused xtalk_coefs_t const asXtalkWideCoefsRightXt = {
122	{0x55c6, 0xc97b, 0x005b, 0x0047, 0},
123	{0x6a60, 0xca20, 0xffc6, 0x0040, 0},
124	{0x6411, 0xd711, 0xfca1, 0x0190, 0},
125	{0x77dc, 0xc79e, 0xffb8, 0x000a, 0},
126	{0, 0, 0, 0, 0}
127};
128static xtalk_coefs_t const asXtalkNarrowCoefsLeftEq = {
129	{0x50B5, 0xD07C, 0x026D, 0xFD21, 0},
130	{0x460F, 0xE44F, 0xF75E, 0xEFA6, 0},
131	{0x556D, 0xDCAB, 0x2098, 0xF0F2, 0},
132	{0x7E03, 0xC1F0, 0x007D, 0xFF89, 0},
133	{0x383E, 0xFD9D, 0xB278, 0x4547, 0}
134};
135
136static xtalk_coefs_t const asXtalkNarrowCoefsRightEq = {
137	{0x50B5, 0xD07C, 0x026D, 0xFD21, 0},
138	{0x460F, 0xE44F, 0xF75E, 0xEFA6, 0},
139	{0x556D, 0xDCAB, 0x2098, 0xF0F2, 0},
140	{0x7E03, 0xC1F0, 0x007D, 0xFF89, 0},
141	{0x383E, 0xFD9D, 0xB278, 0x4547, 0}
142};
143
144static xtalk_coefs_t const asXtalkNarrowCoefsLeftXt = {
145	{0x3CB2, 0xDF49, 0xF6EA, 0x095B, 0},
146	{0x6777, 0xC915, 0xFEAF, 0x00B1, 0},
147	{0x7762, 0xC7D9, 0x025B, 0xFDA6, 0},
148	{0x6B7A, 0xD2AA, 0xF2FB, 0x0B64, 0},
149	{0, 0, 0, 0, 0}
150};
151
152static __maybe_unused xtalk_coefs_t const asXtalkNarrowCoefsRightXt = {
153	{0x3CB2, 0xDF49, 0xF6EA, 0x095B, 0},
154	{0x6777, 0xC915, 0xFEAF, 0x00B1, 0},
155	{0x7762, 0xC7D9, 0x025B, 0xFDA6, 0},
156	{0x6B7A, 0xD2AA, 0xF2FB, 0x0B64, 0},
157	{0, 0, 0, 0, 0}
158};
159
160static xtalk_coefs_t const asXtalkCoefsZeros = {
161	{0, 0, 0, 0, 0},
162	{0, 0, 0, 0, 0},
163	{0, 0, 0, 0, 0},
164	{0, 0, 0, 0, 0},
165	{0, 0, 0, 0, 0}
166};
167
168static xtalk_coefs_t const asXtalkCoefsPipe = {
169	{0, 0, 0x0FA0, 0, 0},
170	{0, 0, 0x0FA0, 0, 0},
171	{0, 0, 0x0FA0, 0, 0},
172	{0, 0, 0x0FA0, 0, 0},
173	{0, 0, 0x1180, 0, 0},
174};
175static __maybe_unused xtalk_coefs_t const asXtalkCoefsNegPipe = {
176	{0, 0, 0xF380, 0, 0},
177	{0, 0, 0xF380, 0, 0},
178	{0, 0, 0xF380, 0, 0},
179	{0, 0, 0xF380, 0, 0},
180	{0, 0, 0xF200, 0, 0}
181};
182
183static __maybe_unused xtalk_coefs_t const asXtalkCoefsNumTest = {
184	{0, 0, 0xF380, 0x8000, 0x6D60},
185	{0, 0, 0, 0, 0},
186	{0, 0, 0, 0, 0},
187	{0, 0, 0, 0, 0},
188	{0, 0, 0, 0, 0}
189};
190
191static __maybe_unused xtalk_coefs_t const asXtalkCoefsDenTest = {
192	{0xC000, 0x2000, 0x4000, 0, 0},
193	{0, 0, 0, 0, 0},
194	{0, 0, 0, 0, 0},
195	{0, 0, 0, 0, 0},
196	{0, 0, 0, 0, 0}
197};
198
199static __maybe_unused xtalk_state_t const asXtalkOutStateTest = {
200	{0x7FFF, 0x0004, 0xFFFC, 0},
201	{0xFE00, 0x0008, 0xFFF8, 0x4000},
202	{0x0200, 0x0010, 0xFFF0, 0xC000},
203	{0x8000, 0x0020, 0xFFE0, 0},
204	{0, 0, 0, 0}
205};
206
207static xtalk_coefs_t const asDiamondCoefsLeftEq = {
208	{0x0F1E, 0x2D05, 0xF8E3, 0x07C8, 0},
209	{0x45E2, 0xCA51, 0x0448, 0xFCE7, 0},
210	{0xA93E, 0xDBD5, 0x022C, 0x028A, 0},
211	{0, 0, 0, 0, 0},
212	{0, 0, 0, 0, 0}
213};
214
215static xtalk_coefs_t const asDiamondCoefsRightEq = {
216	{0x0F1E, 0x2D05, 0xF8E3, 0x07C8, 0},
217	{0x45E2, 0xCA51, 0x0448, 0xFCE7, 0},
218	{0xA93E, 0xDBD5, 0x022C, 0x028A, 0},
219	{0, 0, 0, 0, 0},
220	{0, 0, 0, 0, 0}
221};
222
223static xtalk_coefs_t const asDiamondCoefsLeftXt = {
224	{0x3B50, 0xFE08, 0xF959, 0x0060, 0},
225	{0x9FCB, 0xD8F1, 0x00A2, 0x003A, 0},
226	{0, 0, 0, 0, 0},
227	{0, 0, 0, 0, 0},
228	{0, 0, 0, 0, 0}
229};
230
231static __maybe_unused xtalk_coefs_t const asDiamondCoefsRightXt = {
232	{0x3B50, 0xFE08, 0xF959, 0x0060, 0},
233	{0x9FCB, 0xD8F1, 0x00A2, 0x003A, 0},
234	{0, 0, 0, 0, 0},
235	{0, 0, 0, 0, 0},
236	{0, 0, 0, 0, 0}
237};
238
239 /**/
240/* XTalk EQ and XT */
241static void
242vortex_XtalkHw_SetLeftEQ(vortex_t * vortex, short arg_0, short arg_4,
243			 xtalk_coefs_t const coefs)
244{
245	int i;
246
247	for (i = 0; i < 5; i++) {
248		hwwrite(vortex->mmio, 0x24200 + i * 0x24, coefs[i][0]);
249		hwwrite(vortex->mmio, 0x24204 + i * 0x24, coefs[i][1]);
250		hwwrite(vortex->mmio, 0x24208 + i * 0x24, coefs[i][2]);
251		hwwrite(vortex->mmio, 0x2420c + i * 0x24, coefs[i][3]);
252		hwwrite(vortex->mmio, 0x24210 + i * 0x24, coefs[i][4]);
253	}
254	hwwrite(vortex->mmio, 0x24538, arg_0 & 0xffff);
255	hwwrite(vortex->mmio, 0x2453C, arg_4 & 0xffff);
256}
257
258static void
259vortex_XtalkHw_SetRightEQ(vortex_t * vortex, short arg_0, short arg_4,
260			  xtalk_coefs_t const coefs)
261{
262	int i;
263
264	for (i = 0; i < 5; i++) {
265		hwwrite(vortex->mmio, 0x242b4 + i * 0x24, coefs[i][0]);
266		hwwrite(vortex->mmio, 0x242b8 + i * 0x24, coefs[i][1]);
267		hwwrite(vortex->mmio, 0x242bc + i * 0x24, coefs[i][2]);
268		hwwrite(vortex->mmio, 0x242c0 + i * 0x24, coefs[i][3]);
269		hwwrite(vortex->mmio, 0x242c4 + i * 0x24, coefs[i][4]);
270	}
271	hwwrite(vortex->mmio, 0x24540, arg_0 & 0xffff);
272	hwwrite(vortex->mmio, 0x24544, arg_4 & 0xffff);
273}
274
275static void
276vortex_XtalkHw_SetLeftXT(vortex_t * vortex, short arg_0, short arg_4,
277			 xtalk_coefs_t const coefs)
278{
279	int i;
280
281	for (i = 0; i < 5; i++) {
282		hwwrite(vortex->mmio, 0x24368 + i * 0x24, coefs[i][0]);
283		hwwrite(vortex->mmio, 0x2436c + i * 0x24, coefs[i][1]);
284		hwwrite(vortex->mmio, 0x24370 + i * 0x24, coefs[i][2]);
285		hwwrite(vortex->mmio, 0x24374 + i * 0x24, coefs[i][3]);
286		hwwrite(vortex->mmio, 0x24378 + i * 0x24, coefs[i][4]);
287	}
288	hwwrite(vortex->mmio, 0x24548, arg_0 & 0xffff);
289	hwwrite(vortex->mmio, 0x2454C, arg_4 & 0xffff);
290}
291
292static void
293vortex_XtalkHw_SetRightXT(vortex_t * vortex, short arg_0, short arg_4,
294			  xtalk_coefs_t const coefs)
295{
296	int i;
297
298	for (i = 0; i < 5; i++) {
299		hwwrite(vortex->mmio, 0x2441C + i * 0x24, coefs[i][0]);
300		hwwrite(vortex->mmio, 0x24420 + i * 0x24, coefs[i][1]);
301		hwwrite(vortex->mmio, 0x24424 + i * 0x24, coefs[i][2]);
302		hwwrite(vortex->mmio, 0x24428 + i * 0x24, coefs[i][3]);
303		hwwrite(vortex->mmio, 0x2442C + i * 0x24, coefs[i][4]);
304	}
305	hwwrite(vortex->mmio, 0x24550, arg_0 & 0xffff);
306	hwwrite(vortex->mmio, 0x24554, arg_4 & 0xffff);
307}
308
309static void
310vortex_XtalkHw_SetLeftEQStates(vortex_t * vortex,
311			       xtalk_instate_t const arg_0,
312			       xtalk_state_t const coefs)
313{
314	int i;
315
316	for (i = 0; i < 5; i++) {
317		hwwrite(vortex->mmio, 0x24214 + i * 0x24, coefs[i][0]);
318		hwwrite(vortex->mmio, 0x24218 + i * 0x24, coefs[i][1]);
319		hwwrite(vortex->mmio, 0x2421C + i * 0x24, coefs[i][2]);
320		hwwrite(vortex->mmio, 0x24220 + i * 0x24, coefs[i][3]);
321	}
322	hwwrite(vortex->mmio, 0x244F8, arg_0[0]);
323	hwwrite(vortex->mmio, 0x244FC, arg_0[1]);
324	hwwrite(vortex->mmio, 0x24500, arg_0[2]);
325	hwwrite(vortex->mmio, 0x24504, arg_0[3]);
326}
327
328static void
329vortex_XtalkHw_SetRightEQStates(vortex_t * vortex,
330				xtalk_instate_t const arg_0,
331				xtalk_state_t const coefs)
332{
333	int i;
334
335	for (i = 0; i < 5; i++) {
336		hwwrite(vortex->mmio, 0x242C8 + i * 0x24, coefs[i][0]);
337		hwwrite(vortex->mmio, 0x242CC + i * 0x24, coefs[i][1]);
338		hwwrite(vortex->mmio, 0x242D0 + i * 0x24, coefs[i][2]);
339		hwwrite(vortex->mmio, 0x244D4 + i * 0x24, coefs[i][3]);
340	}
341	hwwrite(vortex->mmio, 0x24508, arg_0[0]);
342	hwwrite(vortex->mmio, 0x2450C, arg_0[1]);
343	hwwrite(vortex->mmio, 0x24510, arg_0[2]);
344	hwwrite(vortex->mmio, 0x24514, arg_0[3]);
345}
346
347static void
348vortex_XtalkHw_SetLeftXTStates(vortex_t * vortex,
349			       xtalk_instate_t const arg_0,
350			       xtalk_state_t const coefs)
351{
352	int i;
353
354	for (i = 0; i < 5; i++) {
355		hwwrite(vortex->mmio, 0x2437C + i * 0x24, coefs[i][0]);
356		hwwrite(vortex->mmio, 0x24380 + i * 0x24, coefs[i][1]);
357		hwwrite(vortex->mmio, 0x24384 + i * 0x24, coefs[i][2]);
358		hwwrite(vortex->mmio, 0x24388 + i * 0x24, coefs[i][3]);
359	}
360	hwwrite(vortex->mmio, 0x24518, arg_0[0]);
361	hwwrite(vortex->mmio, 0x2451C, arg_0[1]);
362	hwwrite(vortex->mmio, 0x24520, arg_0[2]);
363	hwwrite(vortex->mmio, 0x24524, arg_0[3]);
364}
365
366static void
367vortex_XtalkHw_SetRightXTStates(vortex_t * vortex,
368				xtalk_instate_t const arg_0,
369				xtalk_state_t const coefs)
370{
371	int i;
372
373	for (i = 0; i < 5; i++) {
374		hwwrite(vortex->mmio, 0x24430 + i * 0x24, coefs[i][0]);
375		hwwrite(vortex->mmio, 0x24434 + i * 0x24, coefs[i][1]);
376		hwwrite(vortex->mmio, 0x24438 + i * 0x24, coefs[i][2]);
377		hwwrite(vortex->mmio, 0x2443C + i * 0x24, coefs[i][3]);
378	}
379	hwwrite(vortex->mmio, 0x24528, arg_0[0]);
380	hwwrite(vortex->mmio, 0x2452C, arg_0[1]);
381	hwwrite(vortex->mmio, 0x24530, arg_0[2]);
382	hwwrite(vortex->mmio, 0x24534, arg_0[3]);
383}
384
385#if 0
386static void
387vortex_XtalkHw_GetLeftEQ(vortex_t * vortex, short *arg_0, short *arg_4,
388			 xtalk_coefs_t coefs)
389{
390	int i;
391
392	for (i = 0; i < 5; i++) {
393		coefs[i][0] = hwread(vortex->mmio, 0x24200 + i * 0x24);
394		coefs[i][1] = hwread(vortex->mmio, 0x24204 + i * 0x24);
395		coefs[i][2] = hwread(vortex->mmio, 0x24208 + i * 0x24);
396		coefs[i][3] = hwread(vortex->mmio, 0x2420c + i * 0x24);
397		coefs[i][4] = hwread(vortex->mmio, 0x24210 + i * 0x24);
398	}
399	*arg_0 = hwread(vortex->mmio, 0x24538) & 0xffff;
400	*arg_4 = hwread(vortex->mmio, 0x2453c) & 0xffff;
401}
402
403static void
404vortex_XtalkHw_GetRightEQ(vortex_t * vortex, short *arg_0, short *arg_4,
405			  xtalk_coefs_t coefs)
406{
407	int i;
408
409	for (i = 0; i < 5; i++) {
410		coefs[i][0] = hwread(vortex->mmio, 0x242b4 + i * 0x24);
411		coefs[i][1] = hwread(vortex->mmio, 0x242b8 + i * 0x24);
412		coefs[i][2] = hwread(vortex->mmio, 0x242bc + i * 0x24);
413		coefs[i][3] = hwread(vortex->mmio, 0x242c0 + i * 0x24);
414		coefs[i][4] = hwread(vortex->mmio, 0x242c4 + i * 0x24);
415	}
416	*arg_0 = hwread(vortex->mmio, 0x24540) & 0xffff;
417	*arg_4 = hwread(vortex->mmio, 0x24544) & 0xffff;
418}
419
420static void
421vortex_XtalkHw_GetLeftXT(vortex_t * vortex, short *arg_0, short *arg_4,
422			 xtalk_coefs_t coefs)
423{
424	int i;
425
426	for (i = 0; i < 5; i++) {
427		coefs[i][0] = hwread(vortex->mmio, 0x24368 + i * 0x24);
428		coefs[i][1] = hwread(vortex->mmio, 0x2436C + i * 0x24);
429		coefs[i][2] = hwread(vortex->mmio, 0x24370 + i * 0x24);
430		coefs[i][3] = hwread(vortex->mmio, 0x24374 + i * 0x24);
431		coefs[i][4] = hwread(vortex->mmio, 0x24378 + i * 0x24);
432	}
433	*arg_0 = hwread(vortex->mmio, 0x24548) & 0xffff;
434	*arg_4 = hwread(vortex->mmio, 0x2454C) & 0xffff;
435}
436
437static void
438vortex_XtalkHw_GetRightXT(vortex_t * vortex, short *arg_0, short *arg_4,
439			  xtalk_coefs_t coefs)
440{
441	int i;
442
443	for (i = 0; i < 5; i++) {
444		coefs[i][0] = hwread(vortex->mmio, 0x2441C + i * 0x24);
445		coefs[i][1] = hwread(vortex->mmio, 0x24420 + i * 0x24);
446		coefs[i][2] = hwread(vortex->mmio, 0x24424 + i * 0x24);
447		coefs[i][3] = hwread(vortex->mmio, 0x24428 + i * 0x24);
448		coefs[i][4] = hwread(vortex->mmio, 0x2442C + i * 0x24);
449	}
450	*arg_0 = hwread(vortex->mmio, 0x24550) & 0xffff;
451	*arg_4 = hwread(vortex->mmio, 0x24554) & 0xffff;
452}
453
454static void
455vortex_XtalkHw_GetLeftEQStates(vortex_t * vortex, xtalk_instate_t arg_0,
456			       xtalk_state_t coefs)
457{
458	int i;
459
460	for (i = 0; i < 5; i++) {
461		coefs[i][0] = hwread(vortex->mmio, 0x24214 + i * 0x24);
462		coefs[i][1] = hwread(vortex->mmio, 0x24218 + i * 0x24);
463		coefs[i][2] = hwread(vortex->mmio, 0x2421C + i * 0x24);
464		coefs[i][3] = hwread(vortex->mmio, 0x24220 + i * 0x24);
465	}
466	arg_0[0] = hwread(vortex->mmio, 0x244F8);
467	arg_0[1] = hwread(vortex->mmio, 0x244FC);
468	arg_0[2] = hwread(vortex->mmio, 0x24500);
469	arg_0[3] = hwread(vortex->mmio, 0x24504);
470}
471
472static void
473vortex_XtalkHw_GetRightEQStates(vortex_t * vortex, xtalk_instate_t arg_0,
474				xtalk_state_t coefs)
475{
476	int i;
477
478	for (i = 0; i < 5; i++) {
479		coefs[i][0] = hwread(vortex->mmio, 0x242C8 + i * 0x24);
480		coefs[i][1] = hwread(vortex->mmio, 0x242CC + i * 0x24);
481		coefs[i][2] = hwread(vortex->mmio, 0x242D0 + i * 0x24);
482		coefs[i][3] = hwread(vortex->mmio, 0x242D4 + i * 0x24);
483	}
484	arg_0[0] = hwread(vortex->mmio, 0x24508);
485	arg_0[1] = hwread(vortex->mmio, 0x2450C);
486	arg_0[2] = hwread(vortex->mmio, 0x24510);
487	arg_0[3] = hwread(vortex->mmio, 0x24514);
488}
489
490static void
491vortex_XtalkHw_GetLeftXTStates(vortex_t * vortex, xtalk_instate_t arg_0,
492			       xtalk_state_t coefs)
493{
494	int i;
495
496	for (i = 0; i < 5; i++) {
497		coefs[i][0] = hwread(vortex->mmio, 0x2437C + i * 0x24);
498		coefs[i][1] = hwread(vortex->mmio, 0x24380 + i * 0x24);
499		coefs[i][2] = hwread(vortex->mmio, 0x24384 + i * 0x24);
500		coefs[i][3] = hwread(vortex->mmio, 0x24388 + i * 0x24);
501	}
502	arg_0[0] = hwread(vortex->mmio, 0x24518);
503	arg_0[1] = hwread(vortex->mmio, 0x2451C);
504	arg_0[2] = hwread(vortex->mmio, 0x24520);
505	arg_0[3] = hwread(vortex->mmio, 0x24524);
506}
507
508static void
509vortex_XtalkHw_GetRightXTStates(vortex_t * vortex, xtalk_instate_t arg_0,
510				xtalk_state_t coefs)
511{
512	int i;
513
514	for (i = 0; i < 5; i++) {
515		coefs[i][0] = hwread(vortex->mmio, 0x24430 + i * 0x24);
516		coefs[i][1] = hwread(vortex->mmio, 0x24434 + i * 0x24);
517		coefs[i][2] = hwread(vortex->mmio, 0x24438 + i * 0x24);
518		coefs[i][3] = hwread(vortex->mmio, 0x2443C + i * 0x24);
519	}
520	arg_0[0] = hwread(vortex->mmio, 0x24528);
521	arg_0[1] = hwread(vortex->mmio, 0x2452C);
522	arg_0[2] = hwread(vortex->mmio, 0x24530);
523	arg_0[3] = hwread(vortex->mmio, 0x24534);
524}
525
526#endif
527/* Gains */
528
529static void
530vortex_XtalkHw_SetGains(vortex_t * vortex, xtalk_gains_t const gains)
531{
532	int i;
533
534	for (i = 0; i < XTGAINS_SZ; i++) {
535		hwwrite(vortex->mmio, 0x244D0 + (i * 4), gains[i]);
536	}
537}
538
539static void
540vortex_XtalkHw_SetGainsAllChan(vortex_t * vortex)
541{
542	vortex_XtalkHw_SetGains(vortex, asXtalkGainsAllChan);
543}
544
545#if 0
546static void vortex_XtalkHw_GetGains(vortex_t * vortex, xtalk_gains_t gains)
547{
548	int i;
549
550	for (i = 0; i < XTGAINS_SZ; i++)
551		gains[i] = hwread(vortex->mmio, 0x244D0 + i * 4);
552}
553
554#endif
555/* Delay parameters */
556
557static void
558vortex_XtalkHw_SetDelay(vortex_t * vortex, unsigned short right,
559			unsigned short left)
560{
561	u32 esp0 = 0;
562
563	esp0 &= 0x1FFFFFFF;
564	esp0 |= 0xA0000000;
565	esp0 = (esp0 & 0xffffE0ff) | ((right & 0x1F) << 8);
566	esp0 = (esp0 & 0xfffc1fff) | ((left & 0x1F) << 0xd);
567
568	hwwrite(vortex->mmio, 0x24660, esp0);
569}
570
571static void
572vortex_XtalkHw_SetLeftDline(vortex_t * vortex, xtalk_dline_t const dline)
573{
574	int i;
575
576	for (i = 0; i < 0x20; i++) {
577		hwwrite(vortex->mmio, 0x24000 + (i << 2), dline[i] & 0xffff);
578		hwwrite(vortex->mmio, 0x24080 + (i << 2), dline[i] >> 0x10);
579	}
580}
581
582static void
583vortex_XtalkHw_SetRightDline(vortex_t * vortex, xtalk_dline_t const dline)
584{
585	int i;
586
587	for (i = 0; i < 0x20; i++) {
588		hwwrite(vortex->mmio, 0x24100 + (i << 2), dline[i] & 0xffff);
589		hwwrite(vortex->mmio, 0x24180 + (i << 2), dline[i] >> 0x10);
590	}
591}
592
593#if 0
594static void
595vortex_XtalkHw_GetDelay(vortex_t * vortex, unsigned short *right,
596			unsigned short *left)
597{
598	int esp0;
599
600	esp0 = hwread(vortex->mmio, 0x24660);
601	*right = (esp0 >> 8) & 0x1f;
602	*left = (esp0 >> 0xd) & 0x1f;
603}
604
605static void vortex_XtalkHw_GetLeftDline(vortex_t * vortex, xtalk_dline_t dline)
606{
607	int i;
608
609	for (i = 0; i < 0x20; i++) {
610		dline[i] =
611		    (hwread(vortex->mmio, 0x24000 + (i << 2)) & 0xffff) |
612		    (hwread(vortex->mmio, 0x24080 + (i << 2)) << 0x10);
613	}
614}
615
616static void vortex_XtalkHw_GetRightDline(vortex_t * vortex, xtalk_dline_t dline)
617{
618	int i;
619
620	for (i = 0; i < 0x20; i++) {
621		dline[i] =
622		    (hwread(vortex->mmio, 0x24100 + (i << 2)) & 0xffff) |
623		    (hwread(vortex->mmio, 0x24180 + (i << 2)) << 0x10);
624	}
625}
626
627#endif
628/* Control/Global stuff */
629
630#if 0
631static void vortex_XtalkHw_SetControlReg(vortex_t * vortex, u32 ctrl)
632{
633	hwwrite(vortex->mmio, 0x24660, ctrl);
634}
635static void vortex_XtalkHw_GetControlReg(vortex_t * vortex, u32 *ctrl)
636{
637	*ctrl = hwread(vortex->mmio, 0x24660);
638}
639#endif
640static void vortex_XtalkHw_SetSampleRate(vortex_t * vortex, u32 sr)
641{
642	u32 temp;
643
644	temp = (hwread(vortex->mmio, 0x24660) & 0x1FFFFFFF) | 0xC0000000;
645	temp = (temp & 0xffffff07) | ((sr & 0x1f) << 3);
646	hwwrite(vortex->mmio, 0x24660, temp);
647}
648
649#if 0
650static void vortex_XtalkHw_GetSampleRate(vortex_t * vortex, u32 *sr)
651{
652	*sr = (hwread(vortex->mmio, 0x24660) >> 3) & 0x1f;
653}
654
655#endif
656static void vortex_XtalkHw_Enable(vortex_t * vortex)
657{
658	u32 temp;
659
660	temp = (hwread(vortex->mmio, 0x24660) & 0x1FFFFFFF) | 0xC0000000;
661	temp |= 1;
662	hwwrite(vortex->mmio, 0x24660, temp);
663
664}
665
666static void vortex_XtalkHw_Disable(vortex_t * vortex)
667{
668	u32 temp;
669
670	temp = (hwread(vortex->mmio, 0x24660) & 0x1FFFFFFF) | 0xC0000000;
671	temp &= 0xfffffffe;
672	hwwrite(vortex->mmio, 0x24660, temp);
673
674}
675
676static void vortex_XtalkHw_ZeroIO(vortex_t * vortex)
677{
678	int i;
679
680	for (i = 0; i < 20; i++)
681		hwwrite(vortex->mmio, 0x24600 + (i << 2), 0);
682	for (i = 0; i < 4; i++)
683		hwwrite(vortex->mmio, 0x24650 + (i << 2), 0);
684}
685
686static void vortex_XtalkHw_ZeroState(vortex_t * vortex)
687{
688	vortex_XtalkHw_ZeroIO(vortex);	// inlined
689
690	vortex_XtalkHw_SetLeftEQ(vortex, 0, 0, asXtalkCoefsZeros);
691	vortex_XtalkHw_SetRightEQ(vortex, 0, 0, asXtalkCoefsZeros);
692
693	vortex_XtalkHw_SetLeftXT(vortex, 0, 0, asXtalkCoefsZeros);
694	vortex_XtalkHw_SetRightXT(vortex, 0, 0, asXtalkCoefsZeros);
695
696	vortex_XtalkHw_SetGains(vortex, asXtalkGainsZeros);	// inlined
697
698	vortex_XtalkHw_SetDelay(vortex, 0, 0);	// inlined
699
700	vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros);	// inlined
701	vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros);	// inlined
702	vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros);	// inlined
703	vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros);	// inlined
704
705	vortex_XtalkHw_SetLeftEQStates(vortex, asXtalkInStateZeros,
706				       asXtalkOutStateZeros);
707	vortex_XtalkHw_SetRightEQStates(vortex, asXtalkInStateZeros,
708					asXtalkOutStateZeros);
709	vortex_XtalkHw_SetLeftXTStates(vortex, asXtalkInStateZeros,
710				       asXtalkOutStateZeros);
711	vortex_XtalkHw_SetRightXTStates(vortex, asXtalkInStateZeros,
712					asXtalkOutStateZeros);
713}
714
715static void vortex_XtalkHw_ProgramPipe(vortex_t * vortex)
716{
717
718	vortex_XtalkHw_SetLeftEQ(vortex, 0, 1, asXtalkCoefsPipe);
719	vortex_XtalkHw_SetRightEQ(vortex, 0, 1, asXtalkCoefsPipe);
720	vortex_XtalkHw_SetLeftXT(vortex, 0, 0, asXtalkCoefsZeros);
721	vortex_XtalkHw_SetRightXT(vortex, 0, 0, asXtalkCoefsZeros);
722
723	vortex_XtalkHw_SetDelay(vortex, 0, 0);	// inlined
724}
725
726static void vortex_XtalkHw_ProgramXtalkWide(vortex_t * vortex)
727{
728
729	vortex_XtalkHw_SetLeftEQ(vortex, sXtalkWideKLeftEq,
730				 sXtalkWideShiftLeftEq, asXtalkWideCoefsLeftEq);
731	vortex_XtalkHw_SetRightEQ(vortex, sXtalkWideKRightEq,
732				  sXtalkWideShiftRightEq,
733				  asXtalkWideCoefsRightEq);
734	vortex_XtalkHw_SetLeftXT(vortex, sXtalkWideKLeftXt,
735				 sXtalkWideShiftLeftXt, asXtalkWideCoefsLeftXt);
736	vortex_XtalkHw_SetRightXT(vortex, sXtalkWideKLeftXt,
737				  sXtalkWideShiftLeftXt,
738				  asXtalkWideCoefsLeftXt);
739
740	vortex_XtalkHw_SetDelay(vortex, wXtalkWideRightDelay, wXtalkWideLeftDelay);	// inlined
741}
742
743static void vortex_XtalkHw_ProgramXtalkNarrow(vortex_t * vortex)
744{
745
746	vortex_XtalkHw_SetLeftEQ(vortex, sXtalkNarrowKLeftEq,
747				 sXtalkNarrowShiftLeftEq,
748				 asXtalkNarrowCoefsLeftEq);
749	vortex_XtalkHw_SetRightEQ(vortex, sXtalkNarrowKRightEq,
750				  sXtalkNarrowShiftRightEq,
751				  asXtalkNarrowCoefsRightEq);
752	vortex_XtalkHw_SetLeftXT(vortex, sXtalkNarrowKLeftXt,
753				 sXtalkNarrowShiftLeftXt,
754				 asXtalkNarrowCoefsLeftXt);
755	vortex_XtalkHw_SetRightXT(vortex, sXtalkNarrowKLeftXt,
756				  sXtalkNarrowShiftLeftXt,
757				  asXtalkNarrowCoefsLeftXt);
758
759	vortex_XtalkHw_SetDelay(vortex, wXtalkNarrowRightDelay, wXtalkNarrowLeftDelay);	// inlined
760}
761
762static void vortex_XtalkHw_ProgramDiamondXtalk(vortex_t * vortex)
763{
764
765	//sDiamondKLeftEq,sDiamondKRightXt,asDiamondCoefsLeftEq
766	vortex_XtalkHw_SetLeftEQ(vortex, sDiamondKLeftEq,
767				 sDiamondShiftLeftEq, asDiamondCoefsLeftEq);
768	vortex_XtalkHw_SetRightEQ(vortex, sDiamondKRightEq,
769				  sDiamondShiftRightEq, asDiamondCoefsRightEq);
770	vortex_XtalkHw_SetLeftXT(vortex, sDiamondKLeftXt,
771				 sDiamondShiftLeftXt, asDiamondCoefsLeftXt);
772	vortex_XtalkHw_SetRightXT(vortex, sDiamondKLeftXt,
773				  sDiamondShiftLeftXt, asDiamondCoefsLeftXt);
774
775	vortex_XtalkHw_SetDelay(vortex, wDiamondRightDelay, wDiamondLeftDelay);	// inlined
776}
777
778static void vortex_XtalkHw_init(vortex_t * vortex)
779{
780	vortex_XtalkHw_ZeroState(vortex);
781}
782
783/* End of file */
v3.1
 
  1/***************************************************************************
  2 *            au88x0_cxtalk.c
  3 *
  4 *  Wed Nov 19 16:29:47 2003
  5 *  Copyright  2003  mjander
  6 *  mjander@users.sourceforge.org
  7 ****************************************************************************/
  8
  9/*
 10 *  This program is free software; you can redistribute it and/or modify
 11 *  it under the terms of the GNU General Public License as published by
 12 *  the Free Software Foundation; either version 2 of the License, or
 13 *  (at your option) any later version.
 14 *
 15 *  This program is distributed in the hope that it will be useful,
 16 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 17 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 18 *  GNU Library General Public License for more details.
 19 *
 20 *  You should have received a copy of the GNU General Public License
 21 *  along with this program; if not, write to the Free Software
 22 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 23 */
 24
 25#include "au88x0_xtalk.h"
 26
 27/* Data (a whole lot of data.... ) */
 28
 29static short const sXtalkWideKLeftEq = 0x269C;
 30static short const sXtalkWideKRightEq = 0x269C;
 31static short const sXtalkWideKLeftXt = 0xF25E;
 32static short const sXtalkWideKRightXt = 0xF25E;
 33static short const sXtalkWideShiftLeftEq = 1;
 34static short const sXtalkWideShiftRightEq = 1;
 35static short const sXtalkWideShiftLeftXt = 0;
 36static short const sXtalkWideShiftRightXt = 0;
 37static unsigned short const wXtalkWideLeftDelay = 0xd;
 38static unsigned short const wXtalkWideRightDelay = 0xd;
 39static short const sXtalkNarrowKLeftEq = 0x468D;
 40static short const sXtalkNarrowKRightEq = 0x468D;
 41static short const sXtalkNarrowKLeftXt = 0xF82E;
 42static short const sXtalkNarrowKRightXt = 0xF82E;
 43static short const sXtalkNarrowShiftLeftEq = 0x3;
 44static short const sXtalkNarrowShiftRightEq = 0x3;
 45static short const sXtalkNarrowShiftLeftXt = 0;
 46static short const sXtalkNarrowShiftRightXt = 0;
 47static unsigned short const wXtalkNarrowLeftDelay = 0x7;
 48static unsigned short const wXtalkNarrowRightDelay = 0x7;
 49
 50static xtalk_gains_t const asXtalkGainsDefault = {
 51	0x4000, 0x4000, 4000, 0x4000, 4000, 0x4000, 4000, 0x4000, 4000,
 52	0x4000
 53};
 54
 55static xtalk_gains_t const asXtalkGainsTest = {
 56	0x8000, 0x7FFF, 0, 0xFFFF, 0x0001, 0xC000, 0x4000, 0xFFFE, 0x0002,
 57	0
 58};
 59static xtalk_gains_t const asXtalkGains1Chan = {
 60	0x7FFF, 0, 0, 0, 0x7FFF, 0, 0, 0, 0, 0
 
 
 61};
 62
 63// Input gain for 4 A3D slices. One possible input pair is left zero.
 64static xtalk_gains_t const asXtalkGainsAllChan = {
 65	0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF,
 66	0
 67	    //0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff
 68};
 69static xtalk_gains_t const asXtalkGainsZeros;
 70
 71static xtalk_dline_t const alXtalkDlineZeros;
 72static xtalk_dline_t const alXtalkDlineTest = {
 73	0xFC18, 0x03E8FFFF, 0x186A0, 0x7960FFFE, 1, 0xFFFFFFFF,
 74	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 
 
 
 
 
 
 
 
 
 75	0, 0, 0, 0
 76};
 77
 78static xtalk_instate_t const asXtalkInStateZeros;
 79static xtalk_instate_t const asXtalkInStateTest =
 80    { 0xFF80, 0x0080, 0xFFFF, 0x0001 };
 81static xtalk_state_t const asXtalkOutStateZeros;
 
 
 
 
 
 
 
 82
 83static short const sDiamondKLeftEq = 0x401d;
 84static short const sDiamondKRightEq = 0x401d;
 85static short const sDiamondKLeftXt = 0xF90E;
 86static short const sDiamondKRightXt = 0xF90E;
 87static short const sDiamondShiftLeftEq = 1;	/* 0xF90E Is this a bug ??? */
 88static short const sDiamondShiftRightEq = 1;
 89static short const sDiamondShiftLeftXt = 0;
 90static short const sDiamondShiftRightXt = 0;
 91static unsigned short const wDiamondLeftDelay = 0xb;
 92static unsigned short const wDiamondRightDelay = 0xb;
 93
 94static xtalk_coefs_t const asXtalkWideCoefsLeftEq = {
 95	{0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0},
 96	{0x5F60, 0xCBCB, 0xFC26, 0x0305, 0},
 97	{0x340B, 0xf504, 0x6CE8, 0x0D23, 0x00E4},
 98	{0xD500, 0x8D76, 0xACC7, 0x5B05, 0x00FA},
 99	{0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0}
100};
101static xtalk_coefs_t const asXtalkWideCoefsRightEq = {
102	{0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0},
103	{0x5F60, 0xCBCB, 0xFC26, 0x0305, 0},
104	{0x340B, 0xF504, 0x6CE8, 0x0D23, 0x00E4},
105	{0xD500, 0x8D76, 0xACC7, 0x5B05, 0x00FA},
106	{0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0}
107};
108static xtalk_coefs_t const asXtalkWideCoefsLeftXt = {
109	{0x86C3, 0x7B55, 0x89C3, 0x005B, 0x0047},
110	{0x6000, 0x206A, 0xC6CA, 0x40FF, 0},
111	{0x1100, 0x1164, 0xA1D7, 0x90FC, 0x0001},
112	{0xDC00, 0x9E77, 0xB8C7, 0x0AFF, 0},
113	{0, 0, 0, 0, 0}
114};
115static xtalk_coefs_t const asXtalkWideCoefsRightXt = {
116	{0x86C3, 0x7B55, 0x89C3, 0x005B, 0x0047},
117	{0x6000, 0x206A, 0xC6CA, 0x40FF, 0},
118	{0x1100, 0x1164, 0xA1D7, 0x90FC, 0x0001},
119	{0xDC00, 0x9E77, 0xB8C7, 0x0AFF, 0},
120	{0, 0, 0, 0, 0}
121};
122static xtalk_coefs_t const asXtalkNarrowCoefsLeftEq = {
123	{0x50B5, 0xD07C, 0x026D, 0xFD21, 0},
124	{0x460F, 0xE44F, 0xF75E, 0xEFA6, 0},
125	{0x556D, 0xDCAB, 0x2098, 0xF0F2, 0},
126	{0x7E03, 0xC1F0, 0x007D, 0xFF89, 0},
127	{0x383E, 0xFD9D, 0xB278, 0x4547, 0}
128};
129
130static xtalk_coefs_t const asXtalkNarrowCoefsRightEq = {
131	{0x50B5, 0xD07C, 0x026D, 0xFD21, 0},
132	{0x460F, 0xE44F, 0xF75E, 0xEFA6, 0},
133	{0x556D, 0xDCAB, 0x2098, 0xF0F2, 0},
134	{0x7E03, 0xC1F0, 0x007D, 0xFF89, 0},
135	{0x383E, 0xFD9D, 0xB278, 0x4547, 0}
136};
137
138static xtalk_coefs_t const asXtalkNarrowCoefsLeftXt = {
139	{0x3CB2, 0xDF49, 0xF6EA, 0x095B, 0},
140	{0x6777, 0xC915, 0xFEAF, 0x00B1, 0},
141	{0x7762, 0xC7D9, 0x025B, 0xFDA6, 0},
142	{0x6B7A, 0xD2AA, 0xF2FB, 0x0B64, 0},
143	{0, 0, 0, 0, 0}
144};
145
146static xtalk_coefs_t const asXtalkNarrowCoefsRightXt = {
147	{0x3CB2, 0xDF49, 0xF6EA, 0x095B, 0},
148	{0x6777, 0xC915, 0xFEAF, 0x00B1, 0},
149	{0x7762, 0xC7D9, 0x025B, 0xFDA6, 0},
150	{0x6B7A, 0xD2AA, 0xF2FB, 0x0B64, 0},
151	{0, 0, 0, 0, 0}
152};
153
154static xtalk_coefs_t const asXtalkCoefsZeros;
 
 
 
 
 
 
 
155static xtalk_coefs_t const asXtalkCoefsPipe = {
156	{0, 0, 0x0FA0, 0, 0},
157	{0, 0, 0x0FA0, 0, 0},
158	{0, 0, 0x0FA0, 0, 0},
159	{0, 0, 0x0FA0, 0, 0},
160	{0, 0, 0x1180, 0, 0},
161};
162static xtalk_coefs_t const asXtalkCoefsNegPipe = {
163	{0, 0, 0xF380, 0, 0},
164	{0, 0, 0xF380, 0, 0},
165	{0, 0, 0xF380, 0, 0},
166	{0, 0, 0xF380, 0, 0},
167	{0, 0, 0xF200, 0, 0}
168};
169
170static xtalk_coefs_t const asXtalkCoefsNumTest = {
171	{0, 0, 0xF380, 0x8000, 0x6D60},
172	{0, 0, 0, 0, 0},
173	{0, 0, 0, 0, 0},
174	{0, 0, 0, 0, 0},
175	{0, 0, 0, 0, 0}
176};
177
178static xtalk_coefs_t const asXtalkCoefsDenTest = {
179	{0xC000, 0x2000, 0x4000, 0, 0},
180	{0, 0, 0, 0, 0},
181	{0, 0, 0, 0, 0},
182	{0, 0, 0, 0, 0},
183	{0, 0, 0, 0, 0}
184};
185
186static xtalk_state_t const asXtalkOutStateTest = {
187	{0x7FFF, 0x0004, 0xFFFC, 0},
188	{0xFE00, 0x0008, 0xFFF8, 0x4000},
189	{0x200, 0x0010, 0xFFF0, 0xC000},
190	{0x8000, 0x0020, 0xFFE0, 0},
191	{0, 0, 0, 0}
192};
193
194static xtalk_coefs_t const asDiamondCoefsLeftEq = {
195	{0x0F1E, 0x2D05, 0xF8E3, 0x07C8, 0},
196	{0x45E2, 0xCA51, 0x0448, 0xFCE7, 0},
197	{0xA93E, 0xDBD5, 0x022C, 0x028A, 0},
198	{0, 0, 0, 0, 0},
199	{0, 0, 0, 0, 0}
200};
201
202static xtalk_coefs_t const asDiamondCoefsRightEq = {
203	{0x0F1E, 0x2D05, 0xF8E3, 0x07C8, 0},
204	{0x45E2, 0xCA51, 0x0448, 0xFCE7, 0},
205	{0xA93E, 0xDBD5, 0x022C, 0x028A, 0},
206	{0, 0, 0, 0, 0},
207	{0, 0, 0, 0, 0}
208};
209
210static xtalk_coefs_t const asDiamondCoefsLeftXt = {
211	{0x3B50, 0xFE08, 0xF959, 0x0060, 0},
212	{0x9FCB, 0xD8F1, 0x00A2, 0x003A, 0},
213	{0, 0, 0, 0, 0},
214	{0, 0, 0, 0, 0},
215	{0, 0, 0, 0, 0}
216};
217
218static xtalk_coefs_t const asDiamondCoefsRightXt = {
219	{0x3B50, 0xFE08, 0xF959, 0x0060, 0},
220	{0x9FCB, 0xD8F1, 0x00A2, 0x003A, 0},
221	{0, 0, 0, 0, 0},
222	{0, 0, 0, 0, 0},
223	{0, 0, 0, 0, 0}
224};
225
226 /**/
227/* XTalk EQ and XT */
228static void
229vortex_XtalkHw_SetLeftEQ(vortex_t * vortex, short arg_0, short arg_4,
230			 xtalk_coefs_t const coefs)
231{
232	int i;
233
234	for (i = 0; i < 5; i++) {
235		hwwrite(vortex->mmio, 0x24200 + i * 0x24, coefs[i][0]);
236		hwwrite(vortex->mmio, 0x24204 + i * 0x24, coefs[i][1]);
237		hwwrite(vortex->mmio, 0x24208 + i * 0x24, coefs[i][2]);
238		hwwrite(vortex->mmio, 0x2420c + i * 0x24, coefs[i][3]);
239		hwwrite(vortex->mmio, 0x24210 + i * 0x24, coefs[i][4]);
240	}
241	hwwrite(vortex->mmio, 0x24538, arg_0 & 0xffff);
242	hwwrite(vortex->mmio, 0x2453C, arg_4 & 0xffff);
243}
244
245static void
246vortex_XtalkHw_SetRightEQ(vortex_t * vortex, short arg_0, short arg_4,
247			  xtalk_coefs_t const coefs)
248{
249	int i;
250
251	for (i = 0; i < 5; i++) {
252		hwwrite(vortex->mmio, 0x242b4 + i * 0x24, coefs[i][0]);
253		hwwrite(vortex->mmio, 0x242b8 + i * 0x24, coefs[i][1]);
254		hwwrite(vortex->mmio, 0x242bc + i * 0x24, coefs[i][2]);
255		hwwrite(vortex->mmio, 0x242c0 + i * 0x24, coefs[i][3]);
256		hwwrite(vortex->mmio, 0x242c4 + i * 0x24, coefs[i][4]);
257	}
258	hwwrite(vortex->mmio, 0x24540, arg_0 & 0xffff);
259	hwwrite(vortex->mmio, 0x24544, arg_4 & 0xffff);
260}
261
262static void
263vortex_XtalkHw_SetLeftXT(vortex_t * vortex, short arg_0, short arg_4,
264			 xtalk_coefs_t const coefs)
265{
266	int i;
267
268	for (i = 0; i < 5; i++) {
269		hwwrite(vortex->mmio, 0x24368 + i * 0x24, coefs[i][0]);
270		hwwrite(vortex->mmio, 0x2436c + i * 0x24, coefs[i][1]);
271		hwwrite(vortex->mmio, 0x24370 + i * 0x24, coefs[i][2]);
272		hwwrite(vortex->mmio, 0x24374 + i * 0x24, coefs[i][3]);
273		hwwrite(vortex->mmio, 0x24378 + i * 0x24, coefs[i][4]);
274	}
275	hwwrite(vortex->mmio, 0x24548, arg_0 & 0xffff);
276	hwwrite(vortex->mmio, 0x2454C, arg_4 & 0xffff);
277}
278
279static void
280vortex_XtalkHw_SetRightXT(vortex_t * vortex, short arg_0, short arg_4,
281			  xtalk_coefs_t const coefs)
282{
283	int i;
284
285	for (i = 0; i < 5; i++) {
286		hwwrite(vortex->mmio, 0x2441C + i * 0x24, coefs[i][0]);
287		hwwrite(vortex->mmio, 0x24420 + i * 0x24, coefs[i][1]);
288		hwwrite(vortex->mmio, 0x24424 + i * 0x24, coefs[i][2]);
289		hwwrite(vortex->mmio, 0x24428 + i * 0x24, coefs[i][3]);
290		hwwrite(vortex->mmio, 0x2442C + i * 0x24, coefs[i][4]);
291	}
292	hwwrite(vortex->mmio, 0x24550, arg_0 & 0xffff);
293	hwwrite(vortex->mmio, 0x24554, arg_4 & 0xffff);
294}
295
296static void
297vortex_XtalkHw_SetLeftEQStates(vortex_t * vortex,
298			       xtalk_instate_t const arg_0,
299			       xtalk_state_t const coefs)
300{
301	int i;
302
303	for (i = 0; i < 5; i++) {
304		hwwrite(vortex->mmio, 0x24214 + i * 0x24, coefs[i][0]);
305		hwwrite(vortex->mmio, 0x24218 + i * 0x24, coefs[i][1]);
306		hwwrite(vortex->mmio, 0x2421C + i * 0x24, coefs[i][2]);
307		hwwrite(vortex->mmio, 0x24220 + i * 0x24, coefs[i][3]);
308	}
309	hwwrite(vortex->mmio, 0x244F8 + i * 0x24, arg_0[0]);
310	hwwrite(vortex->mmio, 0x244FC + i * 0x24, arg_0[1]);
311	hwwrite(vortex->mmio, 0x24500 + i * 0x24, arg_0[2]);
312	hwwrite(vortex->mmio, 0x24504 + i * 0x24, arg_0[3]);
313}
314
315static void
316vortex_XtalkHw_SetRightEQStates(vortex_t * vortex,
317				xtalk_instate_t const arg_0,
318				xtalk_state_t const coefs)
319{
320	int i;
321
322	for (i = 0; i < 5; i++) {
323		hwwrite(vortex->mmio, 0x242C8 + i * 0x24, coefs[i][0]);
324		hwwrite(vortex->mmio, 0x242CC + i * 0x24, coefs[i][1]);
325		hwwrite(vortex->mmio, 0x242D0 + i * 0x24, coefs[i][2]);
326		hwwrite(vortex->mmio, 0x244D4 + i * 0x24, coefs[i][3]);
327	}
328	hwwrite(vortex->mmio, 0x24508 + i * 0x24, arg_0[0]);
329	hwwrite(vortex->mmio, 0x2450C + i * 0x24, arg_0[1]);
330	hwwrite(vortex->mmio, 0x24510 + i * 0x24, arg_0[2]);
331	hwwrite(vortex->mmio, 0x24514 + i * 0x24, arg_0[3]);
332}
333
334static void
335vortex_XtalkHw_SetLeftXTStates(vortex_t * vortex,
336			       xtalk_instate_t const arg_0,
337			       xtalk_state_t const coefs)
338{
339	int i;
340
341	for (i = 0; i < 5; i++) {
342		hwwrite(vortex->mmio, 0x2437C + i * 0x24, coefs[i][0]);
343		hwwrite(vortex->mmio, 0x24380 + i * 0x24, coefs[i][1]);
344		hwwrite(vortex->mmio, 0x24384 + i * 0x24, coefs[i][2]);
345		hwwrite(vortex->mmio, 0x24388 + i * 0x24, coefs[i][3]);
346	}
347	hwwrite(vortex->mmio, 0x24518 + i * 0x24, arg_0[0]);
348	hwwrite(vortex->mmio, 0x2451C + i * 0x24, arg_0[1]);
349	hwwrite(vortex->mmio, 0x24520 + i * 0x24, arg_0[2]);
350	hwwrite(vortex->mmio, 0x24524 + i * 0x24, arg_0[3]);
351}
352
353static void
354vortex_XtalkHw_SetRightXTStates(vortex_t * vortex,
355				xtalk_instate_t const arg_0,
356				xtalk_state_t const coefs)
357{
358	int i;
359
360	for (i = 0; i < 5; i++) {
361		hwwrite(vortex->mmio, 0x24430 + i * 0x24, coefs[i][0]);
362		hwwrite(vortex->mmio, 0x24434 + i * 0x24, coefs[i][1]);
363		hwwrite(vortex->mmio, 0x24438 + i * 0x24, coefs[i][2]);
364		hwwrite(vortex->mmio, 0x2443C + i * 0x24, coefs[i][3]);
365	}
366	hwwrite(vortex->mmio, 0x24528 + i * 0x24, arg_0[0]);
367	hwwrite(vortex->mmio, 0x2452C + i * 0x24, arg_0[1]);
368	hwwrite(vortex->mmio, 0x24530 + i * 0x24, arg_0[2]);
369	hwwrite(vortex->mmio, 0x24534 + i * 0x24, arg_0[3]);
370}
371
372#if 0
373static void
374vortex_XtalkHw_GetLeftEQ(vortex_t * vortex, short *arg_0, short *arg_4,
375			 xtalk_coefs_t coefs)
376{
377	int i;
378
379	for (i = 0; i < 5; i++) {
380		coefs[i][0] = hwread(vortex->mmio, 0x24200 + i * 0x24);
381		coefs[i][1] = hwread(vortex->mmio, 0x24204 + i * 0x24);
382		coefs[i][2] = hwread(vortex->mmio, 0x24208 + i * 0x24);
383		coefs[i][3] = hwread(vortex->mmio, 0x2420c + i * 0x24);
384		coefs[i][4] = hwread(vortex->mmio, 0x24210 + i * 0x24);
385	}
386	*arg_0 = hwread(vortex->mmio, 0x24538) & 0xffff;
387	*arg_4 = hwread(vortex->mmio, 0x2453c) & 0xffff;
388}
389
390static void
391vortex_XtalkHw_GetRightEQ(vortex_t * vortex, short *arg_0, short *arg_4,
392			  xtalk_coefs_t coefs)
393{
394	int i;
395
396	for (i = 0; i < 5; i++) {
397		coefs[i][0] = hwread(vortex->mmio, 0x242b4 + i * 0x24);
398		coefs[i][1] = hwread(vortex->mmio, 0x242b8 + i * 0x24);
399		coefs[i][2] = hwread(vortex->mmio, 0x242bc + i * 0x24);
400		coefs[i][3] = hwread(vortex->mmio, 0x242c0 + i * 0x24);
401		coefs[i][4] = hwread(vortex->mmio, 0x242c4 + i * 0x24);
402	}
403	*arg_0 = hwread(vortex->mmio, 0x24540) & 0xffff;
404	*arg_4 = hwread(vortex->mmio, 0x24544) & 0xffff;
405}
406
407static void
408vortex_XtalkHw_GetLeftXT(vortex_t * vortex, short *arg_0, short *arg_4,
409			 xtalk_coefs_t coefs)
410{
411	int i;
412
413	for (i = 0; i < 5; i++) {
414		coefs[i][0] = hwread(vortex->mmio, 0x24368 + i * 0x24);
415		coefs[i][1] = hwread(vortex->mmio, 0x2436C + i * 0x24);
416		coefs[i][2] = hwread(vortex->mmio, 0x24370 + i * 0x24);
417		coefs[i][3] = hwread(vortex->mmio, 0x24374 + i * 0x24);
418		coefs[i][4] = hwread(vortex->mmio, 0x24378 + i * 0x24);
419	}
420	*arg_0 = hwread(vortex->mmio, 0x24548) & 0xffff;
421	*arg_4 = hwread(vortex->mmio, 0x2454C) & 0xffff;
422}
423
424static void
425vortex_XtalkHw_GetRightXT(vortex_t * vortex, short *arg_0, short *arg_4,
426			  xtalk_coefs_t coefs)
427{
428	int i;
429
430	for (i = 0; i < 5; i++) {
431		coefs[i][0] = hwread(vortex->mmio, 0x2441C + i * 0x24);
432		coefs[i][1] = hwread(vortex->mmio, 0x24420 + i * 0x24);
433		coefs[i][2] = hwread(vortex->mmio, 0x24424 + i * 0x24);
434		coefs[i][3] = hwread(vortex->mmio, 0x24428 + i * 0x24);
435		coefs[i][4] = hwread(vortex->mmio, 0x2442C + i * 0x24);
436	}
437	*arg_0 = hwread(vortex->mmio, 0x24550) & 0xffff;
438	*arg_4 = hwread(vortex->mmio, 0x24554) & 0xffff;
439}
440
441static void
442vortex_XtalkHw_GetLeftEQStates(vortex_t * vortex, xtalk_instate_t arg_0,
443			       xtalk_state_t coefs)
444{
445	int i;
446
447	for (i = 0; i < 5; i++) {
448		coefs[i][0] = hwread(vortex->mmio, 0x24214 + i * 0x24);
449		coefs[i][1] = hwread(vortex->mmio, 0x24218 + i * 0x24);
450		coefs[i][2] = hwread(vortex->mmio, 0x2421C + i * 0x24);
451		coefs[i][3] = hwread(vortex->mmio, 0x24220 + i * 0x24);
452	}
453	arg_0[0] = hwread(vortex->mmio, 0x244F8 + i * 0x24);
454	arg_0[1] = hwread(vortex->mmio, 0x244FC + i * 0x24);
455	arg_0[2] = hwread(vortex->mmio, 0x24500 + i * 0x24);
456	arg_0[3] = hwread(vortex->mmio, 0x24504 + i * 0x24);
457}
458
459static void
460vortex_XtalkHw_GetRightEQStates(vortex_t * vortex, xtalk_instate_t arg_0,
461				xtalk_state_t coefs)
462{
463	int i;
464
465	for (i = 0; i < 5; i++) {
466		coefs[i][0] = hwread(vortex->mmio, 0x242C8 + i * 0x24);
467		coefs[i][1] = hwread(vortex->mmio, 0x242CC + i * 0x24);
468		coefs[i][2] = hwread(vortex->mmio, 0x242D0 + i * 0x24);
469		coefs[i][3] = hwread(vortex->mmio, 0x242D4 + i * 0x24);
470	}
471	arg_0[0] = hwread(vortex->mmio, 0x24508 + i * 0x24);
472	arg_0[1] = hwread(vortex->mmio, 0x2450C + i * 0x24);
473	arg_0[2] = hwread(vortex->mmio, 0x24510 + i * 0x24);
474	arg_0[3] = hwread(vortex->mmio, 0x24514 + i * 0x24);
475}
476
477static void
478vortex_XtalkHw_GetLeftXTStates(vortex_t * vortex, xtalk_instate_t arg_0,
479			       xtalk_state_t coefs)
480{
481	int i;
482
483	for (i = 0; i < 5; i++) {
484		coefs[i][0] = hwread(vortex->mmio, 0x2437C + i * 0x24);
485		coefs[i][1] = hwread(vortex->mmio, 0x24380 + i * 0x24);
486		coefs[i][2] = hwread(vortex->mmio, 0x24384 + i * 0x24);
487		coefs[i][3] = hwread(vortex->mmio, 0x24388 + i * 0x24);
488	}
489	arg_0[0] = hwread(vortex->mmio, 0x24518 + i * 0x24);
490	arg_0[1] = hwread(vortex->mmio, 0x2451C + i * 0x24);
491	arg_0[2] = hwread(vortex->mmio, 0x24520 + i * 0x24);
492	arg_0[3] = hwread(vortex->mmio, 0x24524 + i * 0x24);
493}
494
495static void
496vortex_XtalkHw_GetRightXTStates(vortex_t * vortex, xtalk_instate_t arg_0,
497				xtalk_state_t coefs)
498{
499	int i;
500
501	for (i = 0; i < 5; i++) {
502		coefs[i][0] = hwread(vortex->mmio, 0x24430 + i * 0x24);
503		coefs[i][1] = hwread(vortex->mmio, 0x24434 + i * 0x24);
504		coefs[i][2] = hwread(vortex->mmio, 0x24438 + i * 0x24);
505		coefs[i][3] = hwread(vortex->mmio, 0x2443C + i * 0x24);
506	}
507	arg_0[0] = hwread(vortex->mmio, 0x24528 + i * 0x24);
508	arg_0[1] = hwread(vortex->mmio, 0x2452C + i * 0x24);
509	arg_0[2] = hwread(vortex->mmio, 0x24530 + i * 0x24);
510	arg_0[3] = hwread(vortex->mmio, 0x24534 + i * 0x24);
511}
512
513#endif
514/* Gains */
515
516static void
517vortex_XtalkHw_SetGains(vortex_t * vortex, xtalk_gains_t const gains)
518{
519	int i;
520
521	for (i = 0; i < XTGAINS_SZ; i++) {
522		hwwrite(vortex->mmio, 0x244D0 + (i * 4), gains[i]);
523	}
524}
525
526static void
527vortex_XtalkHw_SetGainsAllChan(vortex_t * vortex)
528{
529	vortex_XtalkHw_SetGains(vortex, asXtalkGainsAllChan);
530}
531
532#if 0
533static void vortex_XtalkHw_GetGains(vortex_t * vortex, xtalk_gains_t gains)
534{
535	int i;
536
537	for (i = 0; i < XTGAINS_SZ; i++)
538		gains[i] = hwread(vortex->mmio, 0x244D0 + i * 4);
539}
540
541#endif
542/* Delay parameters */
543
544static void
545vortex_XtalkHw_SetDelay(vortex_t * vortex, unsigned short right,
546			unsigned short left)
547{
548	u32 esp0 = 0;
549
550	esp0 &= 0x1FFFFFFF;
551	esp0 |= 0xA0000000;
552	esp0 = (esp0 & 0xffffE0ff) | ((right & 0x1F) << 8);
553	esp0 = (esp0 & 0xfffc1fff) | ((left & 0x1F) << 0xd);
554
555	hwwrite(vortex->mmio, 0x24660, esp0);
556}
557
558static void
559vortex_XtalkHw_SetLeftDline(vortex_t * vortex, xtalk_dline_t const dline)
560{
561	int i;
562
563	for (i = 0; i < 0x20; i++) {
564		hwwrite(vortex->mmio, 0x24000 + (i << 2), dline[i] & 0xffff);
565		hwwrite(vortex->mmio, 0x24080 + (i << 2), dline[i] >> 0x10);
566	}
567}
568
569static void
570vortex_XtalkHw_SetRightDline(vortex_t * vortex, xtalk_dline_t const dline)
571{
572	int i;
573
574	for (i = 0; i < 0x20; i++) {
575		hwwrite(vortex->mmio, 0x24100 + (i << 2), dline[i] & 0xffff);
576		hwwrite(vortex->mmio, 0x24180 + (i << 2), dline[i] >> 0x10);
577	}
578}
579
580#if 0
581static void
582vortex_XtalkHw_GetDelay(vortex_t * vortex, unsigned short *right,
583			unsigned short *left)
584{
585	int esp0;
586
587	esp0 = hwread(vortex->mmio, 0x24660);
588	*right = (esp0 >> 8) & 0x1f;
589	*left = (esp0 >> 0xd) & 0x1f;
590}
591
592static void vortex_XtalkHw_GetLeftDline(vortex_t * vortex, xtalk_dline_t dline)
593{
594	int i;
595
596	for (i = 0; i < 0x20; i++) {
597		dline[i] =
598		    (hwread(vortex->mmio, 0x24000 + (i << 2)) & 0xffff) |
599		    (hwread(vortex->mmio, 0x24080 + (i << 2)) << 0x10);
600	}
601}
602
603static void vortex_XtalkHw_GetRightDline(vortex_t * vortex, xtalk_dline_t dline)
604{
605	int i;
606
607	for (i = 0; i < 0x20; i++) {
608		dline[i] =
609		    (hwread(vortex->mmio, 0x24100 + (i << 2)) & 0xffff) |
610		    (hwread(vortex->mmio, 0x24180 + (i << 2)) << 0x10);
611	}
612}
613
614#endif
615/* Control/Global stuff */
616
617#if 0
618static void vortex_XtalkHw_SetControlReg(vortex_t * vortex, u32 ctrl)
619{
620	hwwrite(vortex->mmio, 0x24660, ctrl);
621}
622static void vortex_XtalkHw_GetControlReg(vortex_t * vortex, u32 *ctrl)
623{
624	*ctrl = hwread(vortex->mmio, 0x24660);
625}
626#endif
627static void vortex_XtalkHw_SetSampleRate(vortex_t * vortex, u32 sr)
628{
629	u32 temp;
630
631	temp = (hwread(vortex->mmio, 0x24660) & 0x1FFFFFFF) | 0xC0000000;
632	temp = (temp & 0xffffff07) | ((sr & 0x1f) << 3);
633	hwwrite(vortex->mmio, 0x24660, temp);
634}
635
636#if 0
637static void vortex_XtalkHw_GetSampleRate(vortex_t * vortex, u32 *sr)
638{
639	*sr = (hwread(vortex->mmio, 0x24660) >> 3) & 0x1f;
640}
641
642#endif
643static void vortex_XtalkHw_Enable(vortex_t * vortex)
644{
645	u32 temp;
646
647	temp = (hwread(vortex->mmio, 0x24660) & 0x1FFFFFFF) | 0xC0000000;
648	temp |= 1;
649	hwwrite(vortex->mmio, 0x24660, temp);
650
651}
652
653static void vortex_XtalkHw_Disable(vortex_t * vortex)
654{
655	u32 temp;
656
657	temp = (hwread(vortex->mmio, 0x24660) & 0x1FFFFFFF) | 0xC0000000;
658	temp &= 0xfffffffe;
659	hwwrite(vortex->mmio, 0x24660, temp);
660
661}
662
663static void vortex_XtalkHw_ZeroIO(vortex_t * vortex)
664{
665	int i;
666
667	for (i = 0; i < 20; i++)
668		hwwrite(vortex->mmio, 0x24600 + (i << 2), 0);
669	for (i = 0; i < 4; i++)
670		hwwrite(vortex->mmio, 0x24650 + (i << 2), 0);
671}
672
673static void vortex_XtalkHw_ZeroState(vortex_t * vortex)
674{
675	vortex_XtalkHw_ZeroIO(vortex);	// inlined
676
677	vortex_XtalkHw_SetLeftEQ(vortex, 0, 0, asXtalkCoefsZeros);
678	vortex_XtalkHw_SetRightEQ(vortex, 0, 0, asXtalkCoefsZeros);
679
680	vortex_XtalkHw_SetLeftXT(vortex, 0, 0, asXtalkCoefsZeros);
681	vortex_XtalkHw_SetRightXT(vortex, 0, 0, asXtalkCoefsZeros);
682
683	vortex_XtalkHw_SetGains(vortex, asXtalkGainsZeros);	// inlined
684
685	vortex_XtalkHw_SetDelay(vortex, 0, 0);	// inlined
686
687	vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros);	// inlined
688	vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros);	// inlined
689	vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros);	// inlined
690	vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros);	// inlined
691
692	vortex_XtalkHw_SetLeftEQStates(vortex, asXtalkInStateZeros,
693				       asXtalkOutStateZeros);
694	vortex_XtalkHw_SetRightEQStates(vortex, asXtalkInStateZeros,
695					asXtalkOutStateZeros);
696	vortex_XtalkHw_SetLeftXTStates(vortex, asXtalkInStateZeros,
697				       asXtalkOutStateZeros);
698	vortex_XtalkHw_SetRightXTStates(vortex, asXtalkInStateZeros,
699					asXtalkOutStateZeros);
700}
701
702static void vortex_XtalkHw_ProgramPipe(vortex_t * vortex)
703{
704
705	vortex_XtalkHw_SetLeftEQ(vortex, 0, 1, asXtalkCoefsPipe);
706	vortex_XtalkHw_SetRightEQ(vortex, 0, 1, asXtalkCoefsPipe);
707	vortex_XtalkHw_SetLeftXT(vortex, 0, 0, asXtalkCoefsZeros);
708	vortex_XtalkHw_SetRightXT(vortex, 0, 0, asXtalkCoefsZeros);
709
710	vortex_XtalkHw_SetDelay(vortex, 0, 0);	// inlined
711}
712
713static void vortex_XtalkHw_ProgramXtalkWide(vortex_t * vortex)
714{
715
716	vortex_XtalkHw_SetLeftEQ(vortex, sXtalkWideKLeftEq,
717				 sXtalkWideShiftLeftEq, asXtalkWideCoefsLeftEq);
718	vortex_XtalkHw_SetRightEQ(vortex, sXtalkWideKRightEq,
719				  sXtalkWideShiftRightEq,
720				  asXtalkWideCoefsRightEq);
721	vortex_XtalkHw_SetLeftXT(vortex, sXtalkWideKLeftXt,
722				 sXtalkWideShiftLeftXt, asXtalkWideCoefsLeftXt);
723	vortex_XtalkHw_SetRightXT(vortex, sXtalkWideKLeftXt,
724				  sXtalkWideShiftLeftXt,
725				  asXtalkWideCoefsLeftXt);
726
727	vortex_XtalkHw_SetDelay(vortex, wXtalkWideRightDelay, wXtalkWideLeftDelay);	// inlined
728}
729
730static void vortex_XtalkHw_ProgramXtalkNarrow(vortex_t * vortex)
731{
732
733	vortex_XtalkHw_SetLeftEQ(vortex, sXtalkNarrowKLeftEq,
734				 sXtalkNarrowShiftLeftEq,
735				 asXtalkNarrowCoefsLeftEq);
736	vortex_XtalkHw_SetRightEQ(vortex, sXtalkNarrowKRightEq,
737				  sXtalkNarrowShiftRightEq,
738				  asXtalkNarrowCoefsRightEq);
739	vortex_XtalkHw_SetLeftXT(vortex, sXtalkNarrowKLeftXt,
740				 sXtalkNarrowShiftLeftXt,
741				 asXtalkNarrowCoefsLeftXt);
742	vortex_XtalkHw_SetRightXT(vortex, sXtalkNarrowKLeftXt,
743				  sXtalkNarrowShiftLeftXt,
744				  asXtalkNarrowCoefsLeftXt);
745
746	vortex_XtalkHw_SetDelay(vortex, wXtalkNarrowRightDelay, wXtalkNarrowLeftDelay);	// inlined
747}
748
749static void vortex_XtalkHw_ProgramDiamondXtalk(vortex_t * vortex)
750{
751
752	//sDiamondKLeftEq,sDiamondKRightXt,asDiamondCoefsLeftEq
753	vortex_XtalkHw_SetLeftEQ(vortex, sDiamondKLeftEq,
754				 sDiamondShiftLeftEq, asDiamondCoefsLeftEq);
755	vortex_XtalkHw_SetRightEQ(vortex, sDiamondKRightEq,
756				  sDiamondShiftRightEq, asDiamondCoefsRightEq);
757	vortex_XtalkHw_SetLeftXT(vortex, sDiamondKLeftXt,
758				 sDiamondShiftLeftXt, asDiamondCoefsLeftXt);
759	vortex_XtalkHw_SetRightXT(vortex, sDiamondKLeftXt,
760				  sDiamondShiftLeftXt, asDiamondCoefsLeftXt);
761
762	vortex_XtalkHw_SetDelay(vortex, wDiamondRightDelay, wDiamondLeftDelay);	// inlined
763}
764
765static void vortex_XtalkHw_init(vortex_t * vortex)
766{
767	vortex_XtalkHw_ZeroState(vortex);
768}
769
770/* End of file */