This source file includes following definitions.
- snd_emu10k1_wc
1
2
3
4
5
6
7 #ifndef __SOUND_EMU10K1_H
8 #define __SOUND_EMU10K1_H
9
10
11 #include <sound/pcm.h>
12 #include <sound/rawmidi.h>
13 #include <sound/hwdep.h>
14 #include <sound/ac97_codec.h>
15 #include <sound/util_mem.h>
16 #include <sound/pcm-indirect.h>
17 #include <sound/timer.h>
18 #include <linux/interrupt.h>
19 #include <linux/mutex.h>
20 #include <linux/firmware.h>
21 #include <linux/io.h>
22
23 #include <uapi/sound/emu10k1.h>
24
25
26
27 #define EMUPAGESIZE 4096
28 #define MAXREQVOICES 8
29 #define MAXPAGES0 4096
30 #define MAXPAGES1 8192
31 #define RESERVED 0
32 #define NUM_MIDI 16
33 #define NUM_G 64
34 #define NUM_FXSENDS 4
35 #define NUM_EFX_PLAYBACK 16
36
37
38 #define EMU10K1_DMA_MASK 0x7fffffffUL
39 #define AUDIGY_DMA_MASK 0xffffffffUL
40
41 #define TMEMSIZE 256*1024
42 #define TMEMSIZEREG 4
43
44 #define IP_TO_CP(ip) ((ip == 0) ? 0 : (((0x00001000uL | (ip & 0x00000FFFL)) << (((ip >> 12) & 0x000FL) + 4)) & 0xFFFF0000uL))
45
46
47
48
49
50
51
52 #define PTR 0x00
53
54
55 #define PTR_CHANNELNUM_MASK 0x0000003f
56
57
58
59 #define PTR_ADDRESS_MASK 0x07ff0000
60 #define A_PTR_ADDRESS_MASK 0x0fff0000
61
62 #define DATA 0x04
63
64 #define IPR 0x08
65
66
67 #define IPR_P16V 0x80000000
68
69 #define IPR_GPIOMSG 0x20000000
70
71
72
73 #define IPR_A_MIDITRANSBUFEMPTY2 0x10000000
74 #define IPR_A_MIDIRECVBUFEMPTY2 0x08000000
75
76 #define IPR_SPDIFBUFFULL 0x04000000
77 #define IPR_SPDIFBUFHALFFULL 0x02000000
78
79 #define IPR_SAMPLERATETRACKER 0x01000000
80 #define IPR_FXDSP 0x00800000
81 #define IPR_FORCEINT 0x00400000
82 #define IPR_PCIERROR 0x00200000
83 #define IPR_VOLINCR 0x00100000
84 #define IPR_VOLDECR 0x00080000
85 #define IPR_MUTE 0x00040000
86 #define IPR_MICBUFFULL 0x00020000
87 #define IPR_MICBUFHALFFULL 0x00010000
88 #define IPR_ADCBUFFULL 0x00008000
89 #define IPR_ADCBUFHALFFULL 0x00004000
90 #define IPR_EFXBUFFULL 0x00002000
91 #define IPR_EFXBUFHALFFULL 0x00001000
92 #define IPR_GPSPDIFSTATUSCHANGE 0x00000800
93 #define IPR_CDROMSTATUSCHANGE 0x00000400
94 #define IPR_INTERVALTIMER 0x00000200
95 #define IPR_MIDITRANSBUFEMPTY 0x00000100
96 #define IPR_MIDIRECVBUFEMPTY 0x00000080
97 #define IPR_CHANNELLOOP 0x00000040
98 #define IPR_CHANNELNUMBERMASK 0x0000003f
99
100
101
102
103
104 #define INTE 0x0c
105 #define INTE_VIRTUALSB_MASK 0xc0000000
106 #define INTE_VIRTUALSB_220 0x00000000
107 #define INTE_VIRTUALSB_240 0x40000000
108 #define INTE_VIRTUALSB_260 0x80000000
109 #define INTE_VIRTUALSB_280 0xc0000000
110 #define INTE_VIRTUALMPU_MASK 0x30000000
111 #define INTE_VIRTUALMPU_300 0x00000000
112 #define INTE_VIRTUALMPU_310 0x10000000
113 #define INTE_VIRTUALMPU_320 0x20000000
114 #define INTE_VIRTUALMPU_330 0x30000000
115 #define INTE_MASTERDMAENABLE 0x08000000
116 #define INTE_SLAVEDMAENABLE 0x04000000
117 #define INTE_MASTERPICENABLE 0x02000000
118 #define INTE_SLAVEPICENABLE 0x01000000
119 #define INTE_VSBENABLE 0x00800000
120 #define INTE_ADLIBENABLE 0x00400000
121 #define INTE_MPUENABLE 0x00200000
122 #define INTE_FORCEINT 0x00100000
123
124 #define INTE_MRHANDENABLE 0x00080000
125
126
127
128
129
130
131 #define INTE_A_MIDITXENABLE2 0x00020000
132 #define INTE_A_MIDIRXENABLE2 0x00010000
133
134
135 #define INTE_SAMPLERATETRACKER 0x00002000
136
137 #define INTE_FXDSPENABLE 0x00001000
138 #define INTE_PCIERRORENABLE 0x00000800
139 #define INTE_VOLINCRENABLE 0x00000400
140 #define INTE_VOLDECRENABLE 0x00000200
141 #define INTE_MUTEENABLE 0x00000100
142 #define INTE_MICBUFENABLE 0x00000080
143 #define INTE_ADCBUFENABLE 0x00000040
144 #define INTE_EFXBUFENABLE 0x00000020
145 #define INTE_GPSPDIFENABLE 0x00000010
146 #define INTE_CDSPDIFENABLE 0x00000008
147 #define INTE_INTERVALTIMERENB 0x00000004
148 #define INTE_MIDITXENABLE 0x00000002
149 #define INTE_MIDIRXENABLE 0x00000001
150
151 #define WC 0x10
152 #define WC_SAMPLECOUNTER_MASK 0x03FFFFC0
153 #define WC_SAMPLECOUNTER 0x14060010
154 #define WC_CURRENTCHANNEL 0x0000003F
155
156
157
158 #define HCFG 0x14
159
160
161
162
163 #define HCFG_LEGACYFUNC_MASK 0xe0000000
164 #define HCFG_LEGACYFUNC_MPU 0x00000000
165 #define HCFG_LEGACYFUNC_SB 0x40000000
166 #define HCFG_LEGACYFUNC_AD 0x60000000
167 #define HCFG_LEGACYFUNC_MPIC 0x80000000
168 #define HCFG_LEGACYFUNC_MDMA 0xa0000000
169 #define HCFG_LEGACYFUNC_SPCI 0xc0000000
170 #define HCFG_LEGACYFUNC_SDMA 0xe0000000
171 #define HCFG_IOCAPTUREADDR 0x1f000000
172 #define HCFG_LEGACYWRITE 0x00800000
173 #define HCFG_LEGACYWORD 0x00400000
174 #define HCFG_LEGACYINT 0x00200000
175
176
177 #define HCFG_PUSH_BUTTON_ENABLE 0x00100000
178 #define HCFG_BAUD_RATE 0x00080000
179 #define HCFG_EXPANDED_MEM 0x00040000
180 #define HCFG_CODECFORMAT_MASK 0x00030000
181
182
183 #define HCFG_CODECFORMAT_AC97_1 0x00000000
184 #define HCFG_CODECFORMAT_AC97_2 0x00010000
185 #define HCFG_AUTOMUTE_ASYNC 0x00008000
186
187
188
189 #define HCFG_AUTOMUTE_SPDIF 0x00004000
190
191
192 #define HCFG_EMU32_SLAVE 0x00002000
193 #define HCFG_SLOW_RAMP 0x00001000
194
195 #define HCFG_PHASE_TRACK_MASK 0x00000700
196
197
198 #define HCFG_I2S_ASRC_ENABLE 0x00000070
199
200
201
202
203
204
205
206 #define HCFG_CODECFORMAT_AC97 0x00000000
207 #define HCFG_CODECFORMAT_I2S 0x00010000
208 #define HCFG_GPINPUT0 0x00004000
209 #define HCFG_GPINPUT1 0x00002000
210 #define HCFG_GPOUTPUT_MASK 0x00001c00
211 #define HCFG_GPOUT0 0x00001000
212 #define HCFG_GPOUT1 0x00000800
213 #define HCFG_GPOUT2 0x00000400
214 #define HCFG_JOYENABLE 0x00000200
215 #define HCFG_PHASETRACKENABLE 0x00000100
216
217
218 #define HCFG_AC3ENABLE_MASK 0x000000e0
219 #define HCFG_AC3ENABLE_ZVIDEO 0x00000080
220 #define HCFG_AC3ENABLE_CDSPDIF 0x00000040
221 #define HCFG_AC3ENABLE_GPSPDIF 0x00000020
222 #define HCFG_AUTOMUTE 0x00000010
223
224
225
226 #define HCFG_LOCKSOUNDCACHE 0x00000008
227
228 #define HCFG_LOCKTANKCACHE_MASK 0x00000004
229
230 #define HCFG_LOCKTANKCACHE 0x01020014
231 #define HCFG_MUTEBUTTONENABLE 0x00000002
232
233
234
235
236
237 #define HCFG_AUDIOENABLE 0x00000001
238
239
240
241
242
243 #define MUDATA 0x18
244
245 #define MUCMD 0x19
246 #define MUCMD_RESET 0xff
247 #define MUCMD_ENTERUARTMODE 0x3f
248
249
250 #define MUSTAT MUCMD
251 #define MUSTAT_IRDYN 0x80
252 #define MUSTAT_ORDYN 0x40
253
254 #define A_IOCFG 0x18
255 #define A_GPINPUT_MASK 0xff00
256 #define A_GPOUTPUT_MASK 0x00ff
257
258
259 #define A_IOCFG_GPOUT0 0x0044
260 #define A_IOCFG_DISABLE_ANALOG 0x0040
261 #define A_IOCFG_ENABLE_DIGITAL 0x0004
262 #define A_IOCFG_ENABLE_DIGITAL_AUDIGY4 0x0080
263 #define A_IOCFG_UNKNOWN_20 0x0020
264 #define A_IOCFG_DISABLE_AC97_FRONT 0x0080
265 #define A_IOCFG_GPOUT1 0x0002
266 #define A_IOCFG_GPOUT2 0x0001
267 #define A_IOCFG_MULTIPURPOSE_JACK 0x2000
268
269 #define A_IOCFG_DIGITAL_JACK 0x1000
270 #define A_IOCFG_FRONT_JACK 0x4000
271 #define A_IOCFG_REAR_JACK 0x8000
272 #define A_IOCFG_PHONES_JACK 0x0100
273
274
275
276
277
278
279
280 #define TIMER 0x1a
281
282
283
284 #define TIMER_RATE_MASK 0x000003ff
285
286 #define TIMER_RATE 0x0a00001a
287
288 #define AC97DATA 0x1c
289
290 #define AC97ADDRESS 0x1e
291 #define AC97ADDRESS_READY 0x80
292 #define AC97ADDRESS_ADDRESS 0x7f
293
294
295 #define PTR2 0x20
296 #define DATA2 0x24
297 #define IPR2 0x28
298 #define IPR2_PLAYBACK_CH_0_LOOP 0x00001000
299 #define IPR2_PLAYBACK_CH_0_HALF_LOOP 0x00000100
300 #define IPR2_CAPTURE_CH_0_LOOP 0x00100000
301 #define IPR2_CAPTURE_CH_0_HALF_LOOP 0x00010000
302
303
304
305 #define INTE2 0x2c
306 #define INTE2_PLAYBACK_CH_0_LOOP 0x00001000
307 #define INTE2_PLAYBACK_CH_0_HALF_LOOP 0x00000100
308 #define INTE2_PLAYBACK_CH_1_LOOP 0x00002000
309 #define INTE2_PLAYBACK_CH_1_HALF_LOOP 0x00000200
310 #define INTE2_PLAYBACK_CH_2_LOOP 0x00004000
311 #define INTE2_PLAYBACK_CH_2_HALF_LOOP 0x00000400
312 #define INTE2_PLAYBACK_CH_3_LOOP 0x00008000
313 #define INTE2_PLAYBACK_CH_3_HALF_LOOP 0x00000800
314 #define INTE2_CAPTURE_CH_0_LOOP 0x00100000
315 #define INTE2_CAPTURE_CH_0_HALF_LOOP 0x00010000
316 #define HCFG2 0x34
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332 #define IPR3 0x38
333 #define INTE3 0x3c
334
335
336
337
338 #define JOYSTICK1 0x00
339 #define JOYSTICK2 0x01
340 #define JOYSTICK3 0x02
341 #define JOYSTICK4 0x03
342 #define JOYSTICK5 0x04
343 #define JOYSTICK6 0x05
344 #define JOYSTICK7 0x06
345 #define JOYSTICK8 0x07
346
347
348
349 #define JOYSTICK_BUTTONS 0x0f
350 #define JOYSTICK_COMPARATOR 0xf0
351
352
353
354
355
356
357 #define CPF 0x00
358 #define CPF_CURRENTPITCH_MASK 0xffff0000
359 #define CPF_CURRENTPITCH 0x10100000
360 #define CPF_STEREO_MASK 0x00008000
361 #define CPF_STOP_MASK 0x00004000
362 #define CPF_FRACADDRESS_MASK 0x00003fff
363
364 #define PTRX 0x01
365 #define PTRX_PITCHTARGET_MASK 0xffff0000
366 #define PTRX_PITCHTARGET 0x10100001
367 #define PTRX_FXSENDAMOUNT_A_MASK 0x0000ff00
368 #define PTRX_FXSENDAMOUNT_A 0x08080001
369 #define PTRX_FXSENDAMOUNT_B_MASK 0x000000ff
370 #define PTRX_FXSENDAMOUNT_B 0x08000001
371
372 #define CVCF 0x02
373 #define CVCF_CURRENTVOL_MASK 0xffff0000
374 #define CVCF_CURRENTVOL 0x10100002
375 #define CVCF_CURRENTFILTER_MASK 0x0000ffff
376 #define CVCF_CURRENTFILTER 0x10000002
377
378 #define VTFT 0x03
379 #define VTFT_VOLUMETARGET_MASK 0xffff0000
380 #define VTFT_VOLUMETARGET 0x10100003
381 #define VTFT_FILTERTARGET_MASK 0x0000ffff
382 #define VTFT_FILTERTARGET 0x10000003
383
384 #define Z1 0x05
385
386 #define Z2 0x04
387
388 #define PSST 0x06
389 #define PSST_FXSENDAMOUNT_C_MASK 0xff000000
390
391 #define PSST_FXSENDAMOUNT_C 0x08180006
392
393 #define PSST_LOOPSTARTADDR_MASK 0x00ffffff
394 #define PSST_LOOPSTARTADDR 0x18000006
395
396 #define DSL 0x07
397 #define DSL_FXSENDAMOUNT_D_MASK 0xff000000
398
399 #define DSL_FXSENDAMOUNT_D 0x08180007
400
401 #define DSL_LOOPENDADDR_MASK 0x00ffffff
402 #define DSL_LOOPENDADDR 0x18000007
403
404 #define CCCA 0x08
405 #define CCCA_RESONANCE 0xf0000000
406 #define CCCA_INTERPROMMASK 0x0e000000
407
408
409
410
411
412 #define CCCA_INTERPROM_0 0x00000000
413 #define CCCA_INTERPROM_1 0x02000000
414 #define CCCA_INTERPROM_2 0x04000000
415 #define CCCA_INTERPROM_3 0x06000000
416 #define CCCA_INTERPROM_4 0x08000000
417 #define CCCA_INTERPROM_5 0x0a000000
418 #define CCCA_INTERPROM_6 0x0c000000
419 #define CCCA_INTERPROM_7 0x0e000000
420 #define CCCA_8BITSELECT 0x01000000
421 #define CCCA_CURRADDR_MASK 0x00ffffff
422 #define CCCA_CURRADDR 0x18000008
423
424 #define CCR 0x09
425 #define CCR_CACHEINVALIDSIZE 0x07190009
426 #define CCR_CACHEINVALIDSIZE_MASK 0xfe000000
427 #define CCR_CACHELOOPFLAG 0x01000000
428 #define CCR_INTERLEAVEDSAMPLES 0x00800000
429 #define CCR_WORDSIZEDSAMPLES 0x00400000
430 #define CCR_READADDRESS 0x06100009
431 #define CCR_READADDRESS_MASK 0x003f0000
432 #define CCR_LOOPINVALSIZE 0x0000fe00
433
434 #define CCR_LOOPFLAG 0x00000100
435 #define CCR_CACHELOOPADDRHI 0x000000ff
436
437 #define CLP 0x0a
438
439 #define CLP_CACHELOOPADDR 0x0000ffff
440
441 #define FXRT 0x0b
442
443
444 #define FXRT_CHANNELA 0x000f0000
445 #define FXRT_CHANNELB 0x00f00000
446 #define FXRT_CHANNELC 0x0f000000
447 #define FXRT_CHANNELD 0xf0000000
448
449 #define A_HR 0x0b
450 #define MAPA 0x0c
451
452 #define MAPB 0x0d
453
454 #define MAP_PTE_MASK0 0xfffff000
455 #define MAP_PTI_MASK0 0x00000fff
456
457 #define MAP_PTE_MASK1 0xffffe000
458 #define MAP_PTI_MASK1 0x00001fff
459
460
461
462 #define ENVVOL 0x10
463 #define ENVVOL_MASK 0x0000ffff
464
465
466 #define ATKHLDV 0x11
467 #define ATKHLDV_PHASE0 0x00008000
468 #define ATKHLDV_HOLDTIME_MASK 0x00007f00
469 #define ATKHLDV_ATTACKTIME_MASK 0x0000007f
470
471
472 #define DCYSUSV 0x12
473 #define DCYSUSV_PHASE1_MASK 0x00008000
474 #define DCYSUSV_SUSTAINLEVEL_MASK 0x00007f00
475 #define DCYSUSV_CHANNELENABLE_MASK 0x00000080
476
477
478 #define DCYSUSV_DECAYTIME_MASK 0x0000007f
479
480
481 #define LFOVAL1 0x13
482 #define LFOVAL_MASK 0x0000ffff
483
484
485 #define ENVVAL 0x14
486 #define ENVVAL_MASK 0x0000ffff
487
488
489 #define ATKHLDM 0x15
490 #define ATKHLDM_PHASE0 0x00008000
491 #define ATKHLDM_HOLDTIME 0x00007f00
492 #define ATKHLDM_ATTACKTIME 0x0000007f
493
494
495 #define DCYSUSM 0x16
496 #define DCYSUSM_PHASE1_MASK 0x00008000
497 #define DCYSUSM_SUSTAINLEVEL_MASK 0x00007f00
498 #define DCYSUSM_DECAYTIME_MASK 0x0000007f
499
500
501 #define LFOVAL2 0x17
502 #define LFOVAL2_MASK 0x0000ffff
503
504
505 #define IP 0x18
506 #define IP_MASK 0x0000ffff
507
508 #define IP_UNITY 0x0000e000
509
510 #define IFATN 0x19
511 #define IFATN_FILTERCUTOFF_MASK 0x0000ff00
512
513
514 #define IFATN_FILTERCUTOFF 0x08080019
515 #define IFATN_ATTENUATION_MASK 0x000000ff
516 #define IFATN_ATTENUATION 0x08000019
517
518
519 #define PEFE 0x1a
520 #define PEFE_PITCHAMOUNT_MASK 0x0000ff00
521
522 #define PEFE_PITCHAMOUNT 0x0808001a
523 #define PEFE_FILTERAMOUNT_MASK 0x000000ff
524
525 #define PEFE_FILTERAMOUNT 0x0800001a
526 #define FMMOD 0x1b
527 #define FMMOD_MODVIBRATO 0x0000ff00
528
529 #define FMMOD_MOFILTER 0x000000ff
530
531
532
533 #define TREMFRQ 0x1c
534 #define TREMFRQ_DEPTH 0x0000ff00
535
536
537 #define TREMFRQ_FREQUENCY 0x000000ff
538
539 #define FM2FRQ2 0x1d
540 #define FM2FRQ2_DEPTH 0x0000ff00
541
542 #define FM2FRQ2_FREQUENCY 0x000000ff
543
544
545 #define TEMPENV 0x1e
546 #define TEMPENV_MASK 0x0000ffff
547
548
549
550
551
552 #define CD0 0x20
553 #define CD1 0x21
554 #define CD2 0x22
555 #define CD3 0x23
556 #define CD4 0x24
557 #define CD5 0x25
558 #define CD6 0x26
559 #define CD7 0x27
560 #define CD8 0x28
561 #define CD9 0x29
562 #define CDA 0x2a
563 #define CDB 0x2b
564 #define CDC 0x2c
565 #define CDD 0x2d
566 #define CDE 0x2e
567 #define CDF 0x2f
568
569
570
571 #define PTB 0x40
572 #define PTB_MASK 0xfffff000
573
574 #define TCB 0x41
575 #define TCB_MASK 0xfffff000
576
577 #define ADCCR 0x42
578 #define ADCCR_RCHANENABLE 0x00000010
579 #define ADCCR_LCHANENABLE 0x00000008
580
581
582 #define A_ADCCR_RCHANENABLE 0x00000020
583 #define A_ADCCR_LCHANENABLE 0x00000010
584
585 #define A_ADCCR_SAMPLERATE_MASK 0x0000000F
586 #define ADCCR_SAMPLERATE_MASK 0x00000007
587 #define ADCCR_SAMPLERATE_48 0x00000000
588 #define ADCCR_SAMPLERATE_44 0x00000001
589 #define ADCCR_SAMPLERATE_32 0x00000002
590 #define ADCCR_SAMPLERATE_24 0x00000003
591 #define ADCCR_SAMPLERATE_22 0x00000004
592 #define ADCCR_SAMPLERATE_16 0x00000005
593 #define ADCCR_SAMPLERATE_11 0x00000006
594 #define ADCCR_SAMPLERATE_8 0x00000007
595 #define A_ADCCR_SAMPLERATE_12 0x00000006
596 #define A_ADCCR_SAMPLERATE_11 0x00000007
597 #define A_ADCCR_SAMPLERATE_8 0x00000008
598
599 #define FXWC 0x43
600
601
602
603
604
605
606 #define FXWC_DEFAULTROUTE_C (1<<0)
607 #define FXWC_DEFAULTROUTE_B (1<<1)
608 #define FXWC_DEFAULTROUTE_A (1<<12)
609 #define FXWC_DEFAULTROUTE_D (1<<13)
610 #define FXWC_ADCLEFT (1<<18)
611 #define FXWC_CDROMSPDIFLEFT (1<<18)
612 #define FXWC_ADCRIGHT (1<<19)
613 #define FXWC_CDROMSPDIFRIGHT (1<<19)
614 #define FXWC_MIC (1<<20)
615 #define FXWC_ZOOMLEFT (1<<20)
616 #define FXWC_ZOOMRIGHT (1<<21)
617 #define FXWC_SPDIFLEFT (1<<22)
618 #define FXWC_SPDIFRIGHT (1<<23)
619
620 #define A_TBLSZ 0x43
621
622 #define TCBS 0x44
623 #define TCBS_MASK 0x00000007
624 #define TCBS_BUFFSIZE_16K 0x00000000
625 #define TCBS_BUFFSIZE_32K 0x00000001
626 #define TCBS_BUFFSIZE_64K 0x00000002
627 #define TCBS_BUFFSIZE_128K 0x00000003
628 #define TCBS_BUFFSIZE_256K 0x00000004
629 #define TCBS_BUFFSIZE_512K 0x00000005
630 #define TCBS_BUFFSIZE_1024K 0x00000006
631 #define TCBS_BUFFSIZE_2048K 0x00000007
632
633 #define MICBA 0x45
634 #define MICBA_MASK 0xfffff000
635
636 #define ADCBA 0x46
637 #define ADCBA_MASK 0xfffff000
638
639 #define FXBA 0x47
640 #define FXBA_MASK 0xfffff000
641
642 #define A_HWM 0x48
643
644 #define MICBS 0x49
645
646 #define ADCBS 0x4a
647
648 #define FXBS 0x4b
649
650
651
652
653 #define ADCBS_BUFSIZE_NONE 0x00000000
654 #define ADCBS_BUFSIZE_384 0x00000001
655 #define ADCBS_BUFSIZE_448 0x00000002
656 #define ADCBS_BUFSIZE_512 0x00000003
657 #define ADCBS_BUFSIZE_640 0x00000004
658 #define ADCBS_BUFSIZE_768 0x00000005
659 #define ADCBS_BUFSIZE_896 0x00000006
660 #define ADCBS_BUFSIZE_1024 0x00000007
661 #define ADCBS_BUFSIZE_1280 0x00000008
662 #define ADCBS_BUFSIZE_1536 0x00000009
663 #define ADCBS_BUFSIZE_1792 0x0000000a
664 #define ADCBS_BUFSIZE_2048 0x0000000b
665 #define ADCBS_BUFSIZE_2560 0x0000000c
666 #define ADCBS_BUFSIZE_3072 0x0000000d
667 #define ADCBS_BUFSIZE_3584 0x0000000e
668 #define ADCBS_BUFSIZE_4096 0x0000000f
669 #define ADCBS_BUFSIZE_5120 0x00000010
670 #define ADCBS_BUFSIZE_6144 0x00000011
671 #define ADCBS_BUFSIZE_7168 0x00000012
672 #define ADCBS_BUFSIZE_8192 0x00000013
673 #define ADCBS_BUFSIZE_10240 0x00000014
674 #define ADCBS_BUFSIZE_12288 0x00000015
675 #define ADCBS_BUFSIZE_14366 0x00000016
676 #define ADCBS_BUFSIZE_16384 0x00000017
677 #define ADCBS_BUFSIZE_20480 0x00000018
678 #define ADCBS_BUFSIZE_24576 0x00000019
679 #define ADCBS_BUFSIZE_28672 0x0000001a
680 #define ADCBS_BUFSIZE_32768 0x0000001b
681 #define ADCBS_BUFSIZE_40960 0x0000001c
682 #define ADCBS_BUFSIZE_49152 0x0000001d
683 #define ADCBS_BUFSIZE_57344 0x0000001e
684 #define ADCBS_BUFSIZE_65536 0x0000001f
685
686
687 #define A_CSBA 0x4c
688
689
690 #define A_CSDC 0x4d
691
692
693 #define A_CSFE 0x4e
694
695
696 #define A_CSHG 0x4f
697
698
699 #define CDCS 0x50
700
701 #define GPSCS 0x51
702
703 #define DBG 0x52
704
705
706 #define A_SPSC 0x52
707
708 #define REG53 0x53
709
710 #define A_DBG 0x53
711 #define A_DBG_SINGLE_STEP 0x00020000
712 #define A_DBG_ZC 0x40000000
713 #define A_DBG_STEP_ADDR 0x000003ff
714 #define A_DBG_SATURATION_OCCURED 0x20000000
715 #define A_DBG_SATURATION_ADDR 0x0ffc0000
716
717
718 #define SPCS0 0x54
719
720 #define SPCS1 0x55
721
722 #define SPCS2 0x56
723
724 #define SPCS_CLKACCYMASK 0x30000000
725 #define SPCS_CLKACCY_1000PPM 0x00000000
726 #define SPCS_CLKACCY_50PPM 0x10000000
727 #define SPCS_CLKACCY_VARIABLE 0x20000000
728 #define SPCS_SAMPLERATEMASK 0x0f000000
729 #define SPCS_SAMPLERATE_44 0x00000000
730 #define SPCS_SAMPLERATE_48 0x02000000
731 #define SPCS_SAMPLERATE_32 0x03000000
732 #define SPCS_CHANNELNUMMASK 0x00f00000
733 #define SPCS_CHANNELNUM_UNSPEC 0x00000000
734 #define SPCS_CHANNELNUM_LEFT 0x00100000
735 #define SPCS_CHANNELNUM_RIGHT 0x00200000
736 #define SPCS_SOURCENUMMASK 0x000f0000
737 #define SPCS_SOURCENUM_UNSPEC 0x00000000
738 #define SPCS_GENERATIONSTATUS 0x00008000
739 #define SPCS_CATEGORYCODEMASK 0x00007f00
740 #define SPCS_MODEMASK 0x000000c0
741 #define SPCS_EMPHASISMASK 0x00000038
742 #define SPCS_EMPHASIS_NONE 0x00000000
743 #define SPCS_EMPHASIS_50_15 0x00000008
744 #define SPCS_COPYRIGHT 0x00000004
745 #define SPCS_NOTAUDIODATA 0x00000002
746 #define SPCS_PROFESSIONAL 0x00000001
747
748
749
750
751 #define CLIEL 0x58
752
753 #define CLIEH 0x59
754
755 #define CLIPL 0x5a
756
757 #define CLIPH 0x5b
758
759 #define SOLEL 0x5c
760
761 #define SOLEH 0x5d
762
763 #define SPBYPASS 0x5e
764 #define SPBYPASS_SPDIF0_MASK 0x00000003
765 #define SPBYPASS_SPDIF1_MASK 0x0000000c
766
767 #define SPBYPASS_FORMAT 0x00000f00
768
769 #define AC97SLOT 0x5f
770 #define AC97SLOT_REAR_RIGHT 0x01
771 #define AC97SLOT_REAR_LEFT 0x02
772 #define AC97SLOT_CNTR 0x10
773 #define AC97SLOT_LFE 0x20
774
775
776 #define A_PCB 0x5f
777
778
779 #define CDSRCS 0x60
780
781 #define GPSRCS 0x61
782
783 #define ZVSRCS 0x62
784
785
786
787
788 #define SRCS_SPDIFVALID 0x04000000
789 #define SRCS_SPDIFLOCKED 0x02000000
790 #define SRCS_RATELOCKED 0x01000000
791 #define SRCS_ESTSAMPLERATE 0x0007ffff
792
793
794 #define SRCS_SPDIFRATE_44 0x0003acd9
795 #define SRCS_SPDIFRATE_48 0x00040000
796 #define SRCS_SPDIFRATE_96 0x00080000
797
798 #define MICIDX 0x63
799 #define MICIDX_MASK 0x0000ffff
800 #define MICIDX_IDX 0x10000063
801
802 #define ADCIDX 0x64
803 #define ADCIDX_MASK 0x0000ffff
804 #define ADCIDX_IDX 0x10000064
805
806 #define A_ADCIDX 0x63
807 #define A_ADCIDX_IDX 0x10000063
808
809 #define A_MICIDX 0x64
810 #define A_MICIDX_IDX 0x10000064
811
812 #define FXIDX 0x65
813 #define FXIDX_MASK 0x0000ffff
814 #define FXIDX_IDX 0x10000065
815
816
817 #define HLIEL 0x66
818
819 #define HLIEH 0x67
820
821 #define HLIPL 0x68
822
823 #define HLIPH 0x69
824
825
826 #define A_SPRI 0x6a
827
828 #define A_SPRA 0x6b
829
830 #define A_SPRC 0x6c
831
832 #define A_DICE 0x6d
833
834 #define A_TTB 0x6e
835
836 #define A_TDOF 0x6f
837
838
839 #define A_MUDATA1 0x70
840 #define A_MUCMD1 0x71
841 #define A_MUSTAT1 A_MUCMD1
842
843
844 #define A_MUDATA2 0x72
845 #define A_MUCMD2 0x73
846 #define A_MUSTAT2 A_MUCMD2
847
848
849
850
851 #define A_FXWC1 0x74
852 #define A_FXWC2 0x75
853
854
855 #define A_SPDIF_SAMPLERATE 0x76
856 #define A_SAMPLE_RATE 0x76
857 #define A_SAMPLE_RATE_NOT_USED 0x0ffc111e
858 #define A_SAMPLE_RATE_UNKNOWN 0xf0030001
859 #define A_SPDIF_RATE_MASK 0x000000e0
860 #define A_SPDIF_48000 0x00000000
861 #define A_SPDIF_192000 0x00000020
862 #define A_SPDIF_96000 0x00000040
863 #define A_SPDIF_44100 0x00000080
864
865 #define A_I2S_CAPTURE_RATE_MASK 0x00000e00
866 #define A_I2S_CAPTURE_48000 0x00000000
867 #define A_I2S_CAPTURE_192000 0x00000200
868 #define A_I2S_CAPTURE_96000 0x00000400
869 #define A_I2S_CAPTURE_44100 0x00000800
870
871 #define A_PCM_RATE_MASK 0x0000e000
872 #define A_PCM_48000 0x00000000
873 #define A_PCM_192000 0x00002000
874 #define A_PCM_96000 0x00004000
875 #define A_PCM_44100 0x00008000
876
877
878 #define A_SRT3 0x77
879
880
881 #define A_SRT4 0x78
882
883
884 #define A_SRT5 0x79
885
886
887
888 #define A_TTDA 0x7a
889
890 #define A_TTDD 0x7b
891
892 #define A_FXRT2 0x7c
893 #define A_FXRT_CHANNELE 0x0000003f
894 #define A_FXRT_CHANNELF 0x00003f00
895 #define A_FXRT_CHANNELG 0x003f0000
896 #define A_FXRT_CHANNELH 0x3f000000
897
898 #define A_SENDAMOUNTS 0x7d
899 #define A_FXSENDAMOUNT_E_MASK 0xFF000000
900 #define A_FXSENDAMOUNT_F_MASK 0x00FF0000
901 #define A_FXSENDAMOUNT_G_MASK 0x0000FF00
902 #define A_FXSENDAMOUNT_H_MASK 0x000000FF
903
904
905
906 #define A_FXRT1 0x7e
907 #define A_FXRT_CHANNELA 0x0000003f
908 #define A_FXRT_CHANNELB 0x00003f00
909 #define A_FXRT_CHANNELC 0x003f0000
910 #define A_FXRT_CHANNELD 0x3f000000
911
912
913
914 #define FXGPREGBASE 0x100
915 #define A_FXGPREGBASE 0x400
916
917 #define A_TANKMEMCTLREGBASE 0x100
918 #define A_TANKMEMCTLREG_MASK 0x1f
919
920
921
922
923 #define TANKMEMDATAREGBASE 0x200
924 #define TANKMEMDATAREG_MASK 0x000fffff
925
926
927 #define TANKMEMADDRREGBASE 0x300
928 #define TANKMEMADDRREG_ADDR_MASK 0x000fffff
929 #define TANKMEMADDRREG_CLEAR 0x00800000
930 #define TANKMEMADDRREG_ALIGN 0x00400000
931 #define TANKMEMADDRREG_WRITE 0x00200000
932 #define TANKMEMADDRREG_READ 0x00100000
933
934 #define MICROCODEBASE 0x400
935
936
937
938 #define LOWORD_OPX_MASK 0x000ffc00
939 #define LOWORD_OPY_MASK 0x000003ff
940 #define HIWORD_OPCODE_MASK 0x00f00000
941 #define HIWORD_RESULT_MASK 0x000ffc00
942 #define HIWORD_OPA_MASK 0x000003ff
943
944
945
946 #define A_MICROCODEBASE 0x600
947 #define A_LOWORD_OPY_MASK 0x000007ff
948 #define A_LOWORD_OPX_MASK 0x007ff000
949 #define A_HIWORD_OPCODE_MASK 0x0f000000
950 #define A_HIWORD_RESULT_MASK 0x007ff000
951 #define A_HIWORD_OPA_MASK 0x000007ff
952
953
954
955
956 #define EMU_HANA_DESTHI 0x00
957 #define EMU_HANA_DESTLO 0x01
958 #define EMU_HANA_SRCHI 0x02
959 #define EMU_HANA_SRCLO 0x03
960 #define EMU_HANA_DOCK_PWR 0x04
961 #define EMU_HANA_DOCK_PWR_ON 0x01
962 #define EMU_HANA_WCLOCK 0x05
963
964
965 #define EMU_HANA_WCLOCK_SRC_MASK 0x07
966 #define EMU_HANA_WCLOCK_INT_48K 0x00
967 #define EMU_HANA_WCLOCK_INT_44_1K 0x01
968 #define EMU_HANA_WCLOCK_HANA_SPDIF_IN 0x02
969 #define EMU_HANA_WCLOCK_HANA_ADAT_IN 0x03
970 #define EMU_HANA_WCLOCK_SYNC_BNCN 0x04
971 #define EMU_HANA_WCLOCK_2ND_HANA 0x05
972 #define EMU_HANA_WCLOCK_SRC_RESERVED 0x06
973 #define EMU_HANA_WCLOCK_OFF 0x07
974 #define EMU_HANA_WCLOCK_MULT_MASK 0x18
975 #define EMU_HANA_WCLOCK_1X 0x00
976 #define EMU_HANA_WCLOCK_2X 0x08
977 #define EMU_HANA_WCLOCK_4X 0x10
978 #define EMU_HANA_WCLOCK_MULT_RESERVED 0x18
979
980 #define EMU_HANA_DEFCLOCK 0x06
981 #define EMU_HANA_DEFCLOCK_48K 0x00
982 #define EMU_HANA_DEFCLOCK_44_1K 0x01
983
984 #define EMU_HANA_UNMUTE 0x07
985 #define EMU_MUTE 0x00
986 #define EMU_UNMUTE 0x01
987
988 #define EMU_HANA_FPGA_CONFIG 0x08
989 #define EMU_HANA_FPGA_CONFIG_AUDIODOCK 0x01
990 #define EMU_HANA_FPGA_CONFIG_HANA 0x02
991
992 #define EMU_HANA_IRQ_ENABLE 0x09
993 #define EMU_HANA_IRQ_WCLK_CHANGED 0x01
994 #define EMU_HANA_IRQ_ADAT 0x02
995 #define EMU_HANA_IRQ_DOCK 0x04
996 #define EMU_HANA_IRQ_DOCK_LOST 0x08
997
998 #define EMU_HANA_SPDIF_MODE 0x0a
999 #define EMU_HANA_SPDIF_MODE_TX_COMSUMER 0x00
1000 #define EMU_HANA_SPDIF_MODE_TX_PRO 0x01
1001 #define EMU_HANA_SPDIF_MODE_TX_NOCOPY 0x02
1002 #define EMU_HANA_SPDIF_MODE_RX_COMSUMER 0x00
1003 #define EMU_HANA_SPDIF_MODE_RX_PRO 0x04
1004 #define EMU_HANA_SPDIF_MODE_RX_NOCOPY 0x08
1005 #define EMU_HANA_SPDIF_MODE_RX_INVALID 0x10
1006
1007 #define EMU_HANA_OPTICAL_TYPE 0x0b
1008 #define EMU_HANA_OPTICAL_IN_SPDIF 0x00
1009 #define EMU_HANA_OPTICAL_IN_ADAT 0x01
1010 #define EMU_HANA_OPTICAL_OUT_SPDIF 0x00
1011 #define EMU_HANA_OPTICAL_OUT_ADAT 0x02
1012
1013 #define EMU_HANA_MIDI_IN 0x0c
1014 #define EMU_HANA_MIDI_IN_FROM_HAMOA 0x00
1015 #define EMU_HANA_MIDI_IN_FROM_DOCK 0x01
1016
1017 #define EMU_HANA_DOCK_LEDS_1 0x0d
1018 #define EMU_HANA_DOCK_LEDS_1_MIDI1 0x01
1019 #define EMU_HANA_DOCK_LEDS_1_MIDI2 0x02
1020 #define EMU_HANA_DOCK_LEDS_1_SMPTE_IN 0x04
1021 #define EMU_HANA_DOCK_LEDS_1_SMPTE_OUT 0x08
1022
1023 #define EMU_HANA_DOCK_LEDS_2 0x0e
1024 #define EMU_HANA_DOCK_LEDS_2_44K 0x01
1025 #define EMU_HANA_DOCK_LEDS_2_48K 0x02
1026 #define EMU_HANA_DOCK_LEDS_2_96K 0x04
1027 #define EMU_HANA_DOCK_LEDS_2_192K 0x08
1028 #define EMU_HANA_DOCK_LEDS_2_LOCK 0x10
1029 #define EMU_HANA_DOCK_LEDS_2_EXT 0x20
1030
1031 #define EMU_HANA_DOCK_LEDS_3 0x0f
1032 #define EMU_HANA_DOCK_LEDS_3_CLIP_A 0x01
1033 #define EMU_HANA_DOCK_LEDS_3_CLIP_B 0x02
1034 #define EMU_HANA_DOCK_LEDS_3_SIGNAL_A 0x04
1035 #define EMU_HANA_DOCK_LEDS_3_SIGNAL_B 0x08
1036 #define EMU_HANA_DOCK_LEDS_3_MANUAL_CLIP 0x10
1037 #define EMU_HANA_DOCK_LEDS_3_MANUAL_SIGNAL 0x20
1038
1039 #define EMU_HANA_ADC_PADS 0x10
1040 #define EMU_HANA_DOCK_ADC_PAD1 0x01
1041 #define EMU_HANA_DOCK_ADC_PAD2 0x02
1042 #define EMU_HANA_DOCK_ADC_PAD3 0x04
1043 #define EMU_HANA_0202_ADC_PAD1 0x08
1044
1045 #define EMU_HANA_DOCK_MISC 0x11
1046 #define EMU_HANA_DOCK_DAC1_MUTE 0x01
1047 #define EMU_HANA_DOCK_DAC2_MUTE 0x02
1048 #define EMU_HANA_DOCK_DAC3_MUTE 0x04
1049 #define EMU_HANA_DOCK_DAC4_MUTE 0x08
1050 #define EMU_HANA_DOCK_PHONES_192_DAC1 0x00
1051 #define EMU_HANA_DOCK_PHONES_192_DAC2 0x10
1052 #define EMU_HANA_DOCK_PHONES_192_DAC3 0x20
1053 #define EMU_HANA_DOCK_PHONES_192_DAC4 0x30
1054
1055 #define EMU_HANA_MIDI_OUT 0x12
1056 #define EMU_HANA_MIDI_OUT_0202 0x01
1057 #define EMU_HANA_MIDI_OUT_DOCK1 0x02
1058 #define EMU_HANA_MIDI_OUT_DOCK2 0x04
1059 #define EMU_HANA_MIDI_OUT_SYNC2 0x08
1060 #define EMU_HANA_MIDI_OUT_LOOP 0x10
1061
1062 #define EMU_HANA_DAC_PADS 0x13
1063 #define EMU_HANA_DOCK_DAC_PAD1 0x01
1064 #define EMU_HANA_DOCK_DAC_PAD2 0x02
1065 #define EMU_HANA_DOCK_DAC_PAD3 0x04
1066 #define EMU_HANA_DOCK_DAC_PAD4 0x08
1067 #define EMU_HANA_0202_DAC_PAD1 0x10
1068
1069
1070 #define EMU_HANA_IRQ_STATUS 0x20
1071 #if 0
1072 #define EMU_HANA_IRQ_WCLK_CHANGED 0x01
1073 #define EMU_HANA_IRQ_ADAT 0x02
1074 #define EMU_HANA_IRQ_DOCK 0x04
1075 #define EMU_HANA_IRQ_DOCK_LOST 0x08
1076 #endif
1077
1078 #define EMU_HANA_OPTION_CARDS 0x21
1079 #define EMU_HANA_OPTION_HAMOA 0x01
1080 #define EMU_HANA_OPTION_SYNC 0x02
1081 #define EMU_HANA_OPTION_DOCK_ONLINE 0x04
1082 #define EMU_HANA_OPTION_DOCK_OFFLINE 0x08
1083
1084 #define EMU_HANA_ID 0x22
1085
1086 #define EMU_HANA_MAJOR_REV 0x23
1087 #define EMU_HANA_MINOR_REV 0x24
1088
1089 #define EMU_DOCK_MAJOR_REV 0x25
1090 #define EMU_DOCK_MINOR_REV 0x26
1091
1092 #define EMU_DOCK_BOARD_ID 0x27
1093 #define EMU_DOCK_BOARD_ID0 0x00
1094 #define EMU_DOCK_BOARD_ID1 0x03
1095
1096 #define EMU_HANA_WC_SPDIF_HI 0x28
1097 #define EMU_HANA_WC_SPDIF_LO 0x29
1098
1099 #define EMU_HANA_WC_ADAT_HI 0x2a
1100 #define EMU_HANA_WC_ADAT_LO 0x2b
1101
1102 #define EMU_HANA_WC_BNC_LO 0x2c
1103 #define EMU_HANA_WC_BNC_HI 0x2d
1104
1105 #define EMU_HANA2_WC_SPDIF_HI 0x2e
1106 #define EMU_HANA2_WC_SPDIF_LO 0x2f
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215 #define EMU_DST_ALICE2_EMU32_0 0x000f
1216 #define EMU_DST_ALICE2_EMU32_1 0x0000
1217 #define EMU_DST_ALICE2_EMU32_2 0x0001
1218 #define EMU_DST_ALICE2_EMU32_3 0x0002
1219 #define EMU_DST_ALICE2_EMU32_4 0x0003
1220 #define EMU_DST_ALICE2_EMU32_5 0x0004
1221 #define EMU_DST_ALICE2_EMU32_6 0x0005
1222 #define EMU_DST_ALICE2_EMU32_7 0x0006
1223 #define EMU_DST_ALICE2_EMU32_8 0x0007
1224 #define EMU_DST_ALICE2_EMU32_9 0x0008
1225 #define EMU_DST_ALICE2_EMU32_A 0x0009
1226 #define EMU_DST_ALICE2_EMU32_B 0x000a
1227 #define EMU_DST_ALICE2_EMU32_C 0x000b
1228 #define EMU_DST_ALICE2_EMU32_D 0x000c
1229 #define EMU_DST_ALICE2_EMU32_E 0x000d
1230 #define EMU_DST_ALICE2_EMU32_F 0x000e
1231 #define EMU_DST_DOCK_DAC1_LEFT1 0x0100
1232 #define EMU_DST_DOCK_DAC1_LEFT2 0x0101
1233 #define EMU_DST_DOCK_DAC1_LEFT3 0x0102
1234 #define EMU_DST_DOCK_DAC1_LEFT4 0x0103
1235 #define EMU_DST_DOCK_DAC1_RIGHT1 0x0104
1236 #define EMU_DST_DOCK_DAC1_RIGHT2 0x0105
1237 #define EMU_DST_DOCK_DAC1_RIGHT3 0x0106
1238 #define EMU_DST_DOCK_DAC1_RIGHT4 0x0107
1239 #define EMU_DST_DOCK_DAC2_LEFT1 0x0108
1240 #define EMU_DST_DOCK_DAC2_LEFT2 0x0109
1241 #define EMU_DST_DOCK_DAC2_LEFT3 0x010a
1242 #define EMU_DST_DOCK_DAC2_LEFT4 0x010b
1243 #define EMU_DST_DOCK_DAC2_RIGHT1 0x010c
1244 #define EMU_DST_DOCK_DAC2_RIGHT2 0x010d
1245 #define EMU_DST_DOCK_DAC2_RIGHT3 0x010e
1246 #define EMU_DST_DOCK_DAC2_RIGHT4 0x010f
1247 #define EMU_DST_DOCK_DAC3_LEFT1 0x0110
1248 #define EMU_DST_DOCK_DAC3_LEFT2 0x0111
1249 #define EMU_DST_DOCK_DAC3_LEFT3 0x0112
1250 #define EMU_DST_DOCK_DAC3_LEFT4 0x0113
1251 #define EMU_DST_DOCK_PHONES_LEFT1 0x0112
1252 #define EMU_DST_DOCK_PHONES_LEFT2 0x0113
1253 #define EMU_DST_DOCK_DAC3_RIGHT1 0x0114
1254 #define EMU_DST_DOCK_DAC3_RIGHT2 0x0115
1255 #define EMU_DST_DOCK_DAC3_RIGHT3 0x0116
1256 #define EMU_DST_DOCK_DAC3_RIGHT4 0x0117
1257 #define EMU_DST_DOCK_PHONES_RIGHT1 0x0116
1258 #define EMU_DST_DOCK_PHONES_RIGHT2 0x0117
1259 #define EMU_DST_DOCK_DAC4_LEFT1 0x0118
1260 #define EMU_DST_DOCK_DAC4_LEFT2 0x0119
1261 #define EMU_DST_DOCK_DAC4_LEFT3 0x011a
1262 #define EMU_DST_DOCK_DAC4_LEFT4 0x011b
1263 #define EMU_DST_DOCK_SPDIF_LEFT1 0x011a
1264 #define EMU_DST_DOCK_SPDIF_LEFT2 0x011b
1265 #define EMU_DST_DOCK_DAC4_RIGHT1 0x011c
1266 #define EMU_DST_DOCK_DAC4_RIGHT2 0x011d
1267 #define EMU_DST_DOCK_DAC4_RIGHT3 0x011e
1268 #define EMU_DST_DOCK_DAC4_RIGHT4 0x011f
1269 #define EMU_DST_DOCK_SPDIF_RIGHT1 0x011e
1270 #define EMU_DST_DOCK_SPDIF_RIGHT2 0x011f
1271 #define EMU_DST_HANA_SPDIF_LEFT1 0x0200
1272 #define EMU_DST_HANA_SPDIF_LEFT2 0x0202
1273 #define EMU_DST_HANA_SPDIF_RIGHT1 0x0201
1274 #define EMU_DST_HANA_SPDIF_RIGHT2 0x0203
1275 #define EMU_DST_HAMOA_DAC_LEFT1 0x0300
1276 #define EMU_DST_HAMOA_DAC_LEFT2 0x0302
1277 #define EMU_DST_HAMOA_DAC_LEFT3 0x0304
1278 #define EMU_DST_HAMOA_DAC_LEFT4 0x0306
1279 #define EMU_DST_HAMOA_DAC_RIGHT1 0x0301
1280 #define EMU_DST_HAMOA_DAC_RIGHT2 0x0303
1281 #define EMU_DST_HAMOA_DAC_RIGHT3 0x0305
1282 #define EMU_DST_HAMOA_DAC_RIGHT4 0x0307
1283 #define EMU_DST_HANA_ADAT 0x0400
1284 #define EMU_DST_ALICE_I2S0_LEFT 0x0500
1285 #define EMU_DST_ALICE_I2S0_RIGHT 0x0501
1286 #define EMU_DST_ALICE_I2S1_LEFT 0x0600
1287 #define EMU_DST_ALICE_I2S1_RIGHT 0x0601
1288 #define EMU_DST_ALICE_I2S2_LEFT 0x0700
1289 #define EMU_DST_ALICE_I2S2_RIGHT 0x0701
1290
1291
1292
1293 #define EMU_DST_MDOCK_SPDIF_LEFT1 0x0112
1294
1295 #define EMU_DST_MDOCK_SPDIF_LEFT2 0x0113
1296
1297 #define EMU_DST_MDOCK_SPDIF_RIGHT1 0x0116
1298
1299 #define EMU_DST_MDOCK_SPDIF_RIGHT2 0x0117
1300
1301 #define EMU_DST_MDOCK_ADAT 0x0118
1302
1303
1304 #define EMU_DST_MANA_DAC_LEFT 0x0300
1305
1306 #define EMU_DST_MANA_DAC_RIGHT 0x0301
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413 #define EMU_SRC_SILENCE 0x0000
1414 #define EMU_SRC_DOCK_MIC_A1 0x0100
1415 #define EMU_SRC_DOCK_MIC_A2 0x0101
1416 #define EMU_SRC_DOCK_MIC_A3 0x0102
1417 #define EMU_SRC_DOCK_MIC_A4 0x0103
1418 #define EMU_SRC_DOCK_MIC_B1 0x0104
1419 #define EMU_SRC_DOCK_MIC_B2 0x0105
1420 #define EMU_SRC_DOCK_MIC_B3 0x0106
1421 #define EMU_SRC_DOCK_MIC_B4 0x0107
1422 #define EMU_SRC_DOCK_ADC1_LEFT1 0x0108
1423 #define EMU_SRC_DOCK_ADC1_LEFT2 0x0109
1424 #define EMU_SRC_DOCK_ADC1_LEFT3 0x010a
1425 #define EMU_SRC_DOCK_ADC1_LEFT4 0x010b
1426 #define EMU_SRC_DOCK_ADC1_RIGHT1 0x010c
1427 #define EMU_SRC_DOCK_ADC1_RIGHT2 0x010d
1428 #define EMU_SRC_DOCK_ADC1_RIGHT3 0x010e
1429 #define EMU_SRC_DOCK_ADC1_RIGHT4 0x010f
1430 #define EMU_SRC_DOCK_ADC2_LEFT1 0x0110
1431 #define EMU_SRC_DOCK_ADC2_LEFT2 0x0111
1432 #define EMU_SRC_DOCK_ADC2_LEFT3 0x0112
1433 #define EMU_SRC_DOCK_ADC2_LEFT4 0x0113
1434 #define EMU_SRC_DOCK_ADC2_RIGHT1 0x0114
1435 #define EMU_SRC_DOCK_ADC2_RIGHT2 0x0115
1436 #define EMU_SRC_DOCK_ADC2_RIGHT3 0x0116
1437 #define EMU_SRC_DOCK_ADC2_RIGHT4 0x0117
1438 #define EMU_SRC_DOCK_ADC3_LEFT1 0x0118
1439 #define EMU_SRC_DOCK_ADC3_LEFT2 0x0119
1440 #define EMU_SRC_DOCK_ADC3_LEFT3 0x011a
1441 #define EMU_SRC_DOCK_ADC3_LEFT4 0x011b
1442 #define EMU_SRC_DOCK_ADC3_RIGHT1 0x011c
1443 #define EMU_SRC_DOCK_ADC3_RIGHT2 0x011d
1444 #define EMU_SRC_DOCK_ADC3_RIGHT3 0x011e
1445 #define EMU_SRC_DOCK_ADC3_RIGHT4 0x011f
1446 #define EMU_SRC_HAMOA_ADC_LEFT1 0x0200
1447 #define EMU_SRC_HAMOA_ADC_LEFT2 0x0202
1448 #define EMU_SRC_HAMOA_ADC_LEFT3 0x0204
1449 #define EMU_SRC_HAMOA_ADC_LEFT4 0x0206
1450 #define EMU_SRC_HAMOA_ADC_RIGHT1 0x0201
1451 #define EMU_SRC_HAMOA_ADC_RIGHT2 0x0203
1452 #define EMU_SRC_HAMOA_ADC_RIGHT3 0x0205
1453 #define EMU_SRC_HAMOA_ADC_RIGHT4 0x0207
1454 #define EMU_SRC_ALICE_EMU32A 0x0300
1455 #define EMU_SRC_ALICE_EMU32B 0x0310
1456 #define EMU_SRC_HANA_ADAT 0x0400
1457 #define EMU_SRC_HANA_SPDIF_LEFT1 0x0500
1458 #define EMU_SRC_HANA_SPDIF_LEFT2 0x0502
1459 #define EMU_SRC_HANA_SPDIF_RIGHT1 0x0501
1460 #define EMU_SRC_HANA_SPDIF_RIGHT2 0x0503
1461
1462
1463
1464 #define EMU_SRC_MDOCK_SPDIF_LEFT1 0x0112
1465
1466 #define EMU_SRC_MDOCK_SPDIF_LEFT2 0x0113
1467
1468 #define EMU_SRC_MDOCK_SPDIF_RIGHT1 0x0116
1469
1470 #define EMU_SRC_MDOCK_SPDIF_RIGHT2 0x0117
1471
1472 #define EMU_SRC_MDOCK_ADAT 0x0118
1473
1474
1475
1476
1477
1478 enum {
1479 EMU10K1_EFX,
1480 EMU10K1_PCM,
1481 EMU10K1_SYNTH,
1482 EMU10K1_MIDI
1483 };
1484
1485 struct snd_emu10k1;
1486
1487 struct snd_emu10k1_voice {
1488 struct snd_emu10k1 *emu;
1489 int number;
1490 unsigned int use: 1,
1491 pcm: 1,
1492 efx: 1,
1493 synth: 1,
1494 midi: 1;
1495 void (*interrupt)(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice);
1496
1497 struct snd_emu10k1_pcm *epcm;
1498 };
1499
1500 enum {
1501 PLAYBACK_EMUVOICE,
1502 PLAYBACK_EFX,
1503 CAPTURE_AC97ADC,
1504 CAPTURE_AC97MIC,
1505 CAPTURE_EFX
1506 };
1507
1508 struct snd_emu10k1_pcm {
1509 struct snd_emu10k1 *emu;
1510 int type;
1511 struct snd_pcm_substream *substream;
1512 struct snd_emu10k1_voice *voices[NUM_EFX_PLAYBACK];
1513 struct snd_emu10k1_voice *extra;
1514 unsigned short running;
1515 unsigned short first_ptr;
1516 struct snd_util_memblk *memblk;
1517 unsigned int start_addr;
1518 unsigned int ccca_start_addr;
1519 unsigned int capture_ipr;
1520 unsigned int capture_inte;
1521 unsigned int capture_ba_reg;
1522 unsigned int capture_bs_reg;
1523 unsigned int capture_idx_reg;
1524 unsigned int capture_cr_val;
1525 unsigned int capture_cr_val2;
1526 unsigned int capture_bs_val;
1527 unsigned int capture_bufsize;
1528 };
1529
1530 struct snd_emu10k1_pcm_mixer {
1531
1532 unsigned char send_routing[3][8];
1533 unsigned char send_volume[3][8];
1534 unsigned short attn[3];
1535 struct snd_emu10k1_pcm *epcm;
1536 };
1537
1538 #define snd_emu10k1_compose_send_routing(route) \
1539 ((route[0] | (route[1] << 4) | (route[2] << 8) | (route[3] << 12)) << 16)
1540
1541 #define snd_emu10k1_compose_audigy_fxrt1(route) \
1542 ((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 24))
1543
1544 #define snd_emu10k1_compose_audigy_fxrt2(route) \
1545 ((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24))
1546
1547 struct snd_emu10k1_memblk {
1548 struct snd_util_memblk mem;
1549
1550 int first_page, last_page, pages, mapped_page;
1551 unsigned int map_locked;
1552 struct list_head mapped_link;
1553 struct list_head mapped_order_link;
1554 };
1555
1556 #define snd_emu10k1_memblk_offset(blk) (((blk)->mapped_page << PAGE_SHIFT) | ((blk)->mem.offset & (PAGE_SIZE - 1)))
1557
1558 #define EMU10K1_MAX_TRAM_BLOCKS_PER_CODE 16
1559
1560 struct snd_emu10k1_fx8010_ctl {
1561 struct list_head list;
1562 unsigned int vcount;
1563 unsigned int count;
1564 unsigned short gpr[32];
1565 unsigned int value[32];
1566 unsigned int min;
1567 unsigned int max;
1568 unsigned int translation;
1569 struct snd_kcontrol *kcontrol;
1570 };
1571
1572 typedef void (snd_fx8010_irq_handler_t)(struct snd_emu10k1 *emu, void *private_data);
1573
1574 struct snd_emu10k1_fx8010_irq {
1575 struct snd_emu10k1_fx8010_irq *next;
1576 snd_fx8010_irq_handler_t *handler;
1577 unsigned short gpr_running;
1578 void *private_data;
1579 };
1580
1581 struct snd_emu10k1_fx8010_pcm {
1582 unsigned int valid: 1,
1583 opened: 1,
1584 active: 1;
1585 unsigned int channels;
1586 unsigned int tram_start;
1587 unsigned int buffer_size;
1588 unsigned short gpr_size;
1589 unsigned short gpr_ptr;
1590 unsigned short gpr_count;
1591 unsigned short gpr_tmpcount;
1592 unsigned short gpr_trigger;
1593 unsigned short gpr_running;
1594 unsigned char etram[32];
1595 struct snd_pcm_indirect pcm_rec;
1596 unsigned int tram_pos;
1597 unsigned int tram_shift;
1598 struct snd_emu10k1_fx8010_irq irq;
1599 };
1600
1601 struct snd_emu10k1_fx8010 {
1602 unsigned short fxbus_mask;
1603 unsigned short extin_mask;
1604 unsigned short extout_mask;
1605 unsigned short pad1;
1606 unsigned int itram_size;
1607 struct snd_dma_buffer etram_pages;
1608 unsigned int dbg;
1609 unsigned char name[128];
1610 int gpr_size;
1611 int gpr_count;
1612 struct list_head gpr_ctl;
1613 struct mutex lock;
1614 struct snd_emu10k1_fx8010_pcm pcm[8];
1615 spinlock_t irq_lock;
1616 struct snd_emu10k1_fx8010_irq *irq_handlers;
1617 };
1618
1619 struct snd_emu10k1_midi {
1620 struct snd_emu10k1 *emu;
1621 struct snd_rawmidi *rmidi;
1622 struct snd_rawmidi_substream *substream_input;
1623 struct snd_rawmidi_substream *substream_output;
1624 unsigned int midi_mode;
1625 spinlock_t input_lock;
1626 spinlock_t output_lock;
1627 spinlock_t open_lock;
1628 int tx_enable, rx_enable;
1629 int port;
1630 int ipr_tx, ipr_rx;
1631 void (*interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1632 };
1633
1634 enum {
1635 EMU_MODEL_SB,
1636 EMU_MODEL_EMU1010,
1637 EMU_MODEL_EMU1010B,
1638 EMU_MODEL_EMU1616,
1639 EMU_MODEL_EMU0404,
1640 };
1641
1642 struct snd_emu_chip_details {
1643 u32 vendor;
1644 u32 device;
1645 u32 subsystem;
1646 unsigned char revision;
1647 unsigned char emu10k1_chip;
1648 unsigned char emu10k2_chip;
1649 unsigned char ca0102_chip;
1650 unsigned char ca0108_chip;
1651 unsigned char ca_cardbus_chip;
1652 unsigned char ca0151_chip;
1653 unsigned char spk71;
1654 unsigned char sblive51;
1655 unsigned char spdif_bug;
1656 unsigned char ac97_chip;
1657 unsigned char ecard;
1658 unsigned char emu_model;
1659 unsigned char spi_dac;
1660 unsigned char i2c_adc;
1661 unsigned char adc_1361t;
1662 unsigned char invert_shared_spdif;
1663 const char *driver;
1664 const char *name;
1665 const char *id;
1666 };
1667
1668 struct snd_emu1010 {
1669 unsigned int output_source[64];
1670 unsigned int input_source[64];
1671 unsigned int adc_pads;
1672 unsigned int dac_pads;
1673 unsigned int internal_clock;
1674 unsigned int optical_in;
1675 unsigned int optical_out;
1676 struct delayed_work firmware_work;
1677 u32 last_reg;
1678 };
1679
1680 struct snd_emu10k1 {
1681 int irq;
1682
1683 unsigned long port;
1684 unsigned int tos_link: 1,
1685 rear_ac97: 1,
1686 enable_ir: 1;
1687 unsigned int support_tlv :1;
1688
1689 const struct snd_emu_chip_details *card_capabilities;
1690 unsigned int audigy;
1691 unsigned int revision;
1692 unsigned int serial;
1693 unsigned short model;
1694 unsigned int card_type;
1695 unsigned int ecard_ctrl;
1696 unsigned int address_mode;
1697 unsigned long dma_mask;
1698 bool iommu_workaround;
1699 unsigned int delay_pcm_irq;
1700 int max_cache_pages;
1701 struct snd_dma_buffer silent_page;
1702 struct snd_dma_buffer ptb_pages;
1703 struct snd_dma_device p16v_dma_dev;
1704 struct snd_dma_buffer p16v_buffer;
1705
1706 struct snd_util_memhdr *memhdr;
1707
1708 struct list_head mapped_link_head;
1709 struct list_head mapped_order_link_head;
1710 void **page_ptr_table;
1711 unsigned long *page_addr_table;
1712 spinlock_t memblk_lock;
1713
1714 unsigned int spdif_bits[3];
1715 unsigned int i2c_capture_source;
1716 u8 i2c_capture_volume[4][2];
1717
1718 struct snd_emu10k1_fx8010 fx8010;
1719 int gpr_base;
1720
1721 struct snd_ac97 *ac97;
1722
1723 struct pci_dev *pci;
1724 struct snd_card *card;
1725 struct snd_pcm *pcm;
1726 struct snd_pcm *pcm_mic;
1727 struct snd_pcm *pcm_efx;
1728 struct snd_pcm *pcm_multi;
1729 struct snd_pcm *pcm_p16v;
1730
1731 spinlock_t synth_lock;
1732 void *synth;
1733 int (*get_synth_voice)(struct snd_emu10k1 *emu);
1734
1735 spinlock_t reg_lock;
1736 spinlock_t emu_lock;
1737 spinlock_t voice_lock;
1738 spinlock_t spi_lock;
1739 spinlock_t i2c_lock;
1740
1741 struct snd_emu10k1_voice voices[NUM_G];
1742 struct snd_emu10k1_voice p16v_voices[4];
1743 struct snd_emu10k1_voice p16v_capture_voice;
1744 int p16v_device_offset;
1745 u32 p16v_capture_source;
1746 u32 p16v_capture_channel;
1747 struct snd_emu1010 emu1010;
1748 struct snd_emu10k1_pcm_mixer pcm_mixer[32];
1749 struct snd_emu10k1_pcm_mixer efx_pcm_mixer[NUM_EFX_PLAYBACK];
1750 struct snd_kcontrol *ctl_send_routing;
1751 struct snd_kcontrol *ctl_send_volume;
1752 struct snd_kcontrol *ctl_attn;
1753 struct snd_kcontrol *ctl_efx_send_routing;
1754 struct snd_kcontrol *ctl_efx_send_volume;
1755 struct snd_kcontrol *ctl_efx_attn;
1756
1757 void (*hwvol_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1758 void (*capture_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1759 void (*capture_mic_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1760 void (*capture_efx_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1761 void (*spdif_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1762 void (*dsp_interrupt)(struct snd_emu10k1 *emu);
1763
1764 struct snd_pcm_substream *pcm_capture_substream;
1765 struct snd_pcm_substream *pcm_capture_mic_substream;
1766 struct snd_pcm_substream *pcm_capture_efx_substream;
1767 struct snd_pcm_substream *pcm_playback_efx_substream;
1768
1769 struct snd_timer *timer;
1770
1771 struct snd_emu10k1_midi midi;
1772 struct snd_emu10k1_midi midi2;
1773
1774 unsigned int efx_voices_mask[2];
1775 unsigned int next_free_voice;
1776
1777 const struct firmware *firmware;
1778 const struct firmware *dock_fw;
1779
1780 #ifdef CONFIG_PM_SLEEP
1781 unsigned int *saved_ptr;
1782 unsigned int *saved_gpr;
1783 unsigned int *tram_val_saved;
1784 unsigned int *tram_addr_saved;
1785 unsigned int *saved_icode;
1786 unsigned int *p16v_saved;
1787 unsigned int saved_a_iocfg, saved_hcfg;
1788 bool suspend;
1789 #endif
1790
1791 };
1792
1793 int snd_emu10k1_create(struct snd_card *card,
1794 struct pci_dev *pci,
1795 unsigned short extin_mask,
1796 unsigned short extout_mask,
1797 long max_cache_bytes,
1798 int enable_ir,
1799 uint subsystem,
1800 struct snd_emu10k1 ** remu);
1801
1802 int snd_emu10k1_pcm(struct snd_emu10k1 *emu, int device);
1803 int snd_emu10k1_pcm_mic(struct snd_emu10k1 *emu, int device);
1804 int snd_emu10k1_pcm_efx(struct snd_emu10k1 *emu, int device);
1805 int snd_p16v_pcm(struct snd_emu10k1 *emu, int device);
1806 int snd_p16v_free(struct snd_emu10k1 * emu);
1807 int snd_p16v_mixer(struct snd_emu10k1 * emu);
1808 int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device);
1809 int snd_emu10k1_fx8010_pcm(struct snd_emu10k1 *emu, int device);
1810 int snd_emu10k1_mixer(struct snd_emu10k1 * emu, int pcm_device, int multi_device);
1811 int snd_emu10k1_timer(struct snd_emu10k1 * emu, int device);
1812 int snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device);
1813
1814 irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id);
1815
1816 void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int voice);
1817 int snd_emu10k1_init_efx(struct snd_emu10k1 *emu);
1818 void snd_emu10k1_free_efx(struct snd_emu10k1 *emu);
1819 int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size);
1820 int snd_emu10k1_done(struct snd_emu10k1 * emu);
1821
1822
1823 unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
1824 void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
1825 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
1826 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
1827 int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data);
1828 int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu, u32 reg, u32 value);
1829 int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, u32 reg, u32 value);
1830 int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, u32 reg, u32 *value);
1831 int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, u32 dst, u32 src);
1832 unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc);
1833 void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb);
1834 void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb);
1835 void snd_emu10k1_voice_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum);
1836 void snd_emu10k1_voice_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum);
1837 void snd_emu10k1_voice_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum);
1838 void snd_emu10k1_voice_half_loop_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum);
1839 void snd_emu10k1_voice_half_loop_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum);
1840 void snd_emu10k1_voice_half_loop_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum);
1841 void snd_emu10k1_voice_set_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum);
1842 void snd_emu10k1_voice_clear_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum);
1843 void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait);
1844 static inline unsigned int snd_emu10k1_wc(struct snd_emu10k1 *emu) { return (inl(emu->port + WC) >> 6) & 0xfffff; }
1845 unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
1846 void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data);
1847 unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate);
1848
1849 #ifdef CONFIG_PM_SLEEP
1850 void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu);
1851 void snd_emu10k1_resume_init(struct snd_emu10k1 *emu);
1852 void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu);
1853 int snd_emu10k1_efx_alloc_pm_buffer(struct snd_emu10k1 *emu);
1854 void snd_emu10k1_efx_free_pm_buffer(struct snd_emu10k1 *emu);
1855 void snd_emu10k1_efx_suspend(struct snd_emu10k1 *emu);
1856 void snd_emu10k1_efx_resume(struct snd_emu10k1 *emu);
1857 int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu);
1858 void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu);
1859 void snd_p16v_suspend(struct snd_emu10k1 *emu);
1860 void snd_p16v_resume(struct snd_emu10k1 *emu);
1861 #endif
1862
1863
1864 struct snd_util_memblk *snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream);
1865 int snd_emu10k1_free_pages(struct snd_emu10k1 *emu, struct snd_util_memblk *blk);
1866 int snd_emu10k1_alloc_pages_maybe_wider(struct snd_emu10k1 *emu, size_t size,
1867 struct snd_dma_buffer *dmab);
1868 struct snd_util_memblk *snd_emu10k1_synth_alloc(struct snd_emu10k1 *emu, unsigned int size);
1869 int snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *blk);
1870 int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, int offset, int size);
1871 int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, int offset, const char __user *data, int size);
1872 int snd_emu10k1_memblk_map(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk);
1873
1874
1875 int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int pair, struct snd_emu10k1_voice **rvoice);
1876 int snd_emu10k1_voice_free(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice);
1877
1878
1879 int snd_emu10k1_midi(struct snd_emu10k1 * emu);
1880 int snd_emu10k1_audigy_midi(struct snd_emu10k1 * emu);
1881
1882
1883 int snd_emu10k1_proc_init(struct snd_emu10k1 * emu);
1884
1885
1886 int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
1887 snd_fx8010_irq_handler_t *handler,
1888 unsigned char gpr_running,
1889 void *private_data,
1890 struct snd_emu10k1_fx8010_irq *irq);
1891 int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
1892 struct snd_emu10k1_fx8010_irq *irq);
1893
1894 #endif