1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31#include <linux/slab.h>
32#include <linux/init.h>
33#include <sound/core.h>
34#include <sound/emu10k1.h>
35#include "p16v.h"
36
37#ifdef CONFIG_PROC_FS
38static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
39 struct snd_info_buffer *buffer,
40 char *title,
41 int status_reg,
42 int rate_reg)
43{
44 static char *clkaccy[4] = { "1000ppm", "50ppm", "variable", "unknown" };
45 static int samplerate[16] = { 44100, 1, 48000, 32000, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
46 static char *channel[16] = { "unspec", "left", "right", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" };
47 static char *emphasis[8] = { "none", "50/15 usec 2 channel", "2", "3", "4", "5", "6", "7" };
48 unsigned int status, rate = 0;
49
50 status = snd_emu10k1_ptr_read(emu, status_reg, 0);
51
52 snd_iprintf(buffer, "\n%s\n", title);
53
54 if (status != 0xffffffff) {
55 snd_iprintf(buffer, "Professional Mode : %s\n", (status & SPCS_PROFESSIONAL) ? "yes" : "no");
56 snd_iprintf(buffer, "Not Audio Data : %s\n", (status & SPCS_NOTAUDIODATA) ? "yes" : "no");
57 snd_iprintf(buffer, "Copyright : %s\n", (status & SPCS_COPYRIGHT) ? "yes" : "no");
58 snd_iprintf(buffer, "Emphasis : %s\n", emphasis[(status & SPCS_EMPHASISMASK) >> 3]);
59 snd_iprintf(buffer, "Mode : %i\n", (status & SPCS_MODEMASK) >> 6);
60 snd_iprintf(buffer, "Category Code : 0x%x\n", (status & SPCS_CATEGORYCODEMASK) >> 8);
61 snd_iprintf(buffer, "Generation Status : %s\n", status & SPCS_GENERATIONSTATUS ? "original" : "copy");
62 snd_iprintf(buffer, "Source Mask : %i\n", (status & SPCS_SOURCENUMMASK) >> 16);
63 snd_iprintf(buffer, "Channel Number : %s\n", channel[(status & SPCS_CHANNELNUMMASK) >> 20]);
64 snd_iprintf(buffer, "Sample Rate : %iHz\n", samplerate[(status & SPCS_SAMPLERATEMASK) >> 24]);
65 snd_iprintf(buffer, "Clock Accuracy : %s\n", clkaccy[(status & SPCS_CLKACCYMASK) >> 28]);
66
67 if (rate_reg > 0) {
68 rate = snd_emu10k1_ptr_read(emu, rate_reg, 0);
69 snd_iprintf(buffer, "S/PDIF Valid : %s\n", rate & SRCS_SPDIFVALID ? "on" : "off");
70 snd_iprintf(buffer, "S/PDIF Locked : %s\n", rate & SRCS_SPDIFLOCKED ? "on" : "off");
71 snd_iprintf(buffer, "Rate Locked : %s\n", rate & SRCS_RATELOCKED ? "on" : "off");
72
73 snd_iprintf(buffer, "Estimated Sample Rate : %d\n", ((rate & 0xFFFFF ) * 375) >> 11);
74 }
75 } else {
76 snd_iprintf(buffer, "No signal detected.\n");
77 }
78
79}
80
81static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
82 struct snd_info_buffer *buffer)
83{
84
85 static char *creative_outs[32] = {
86 "AC97 Left",
87 "AC97 Right",
88 "Optical IEC958 Left",
89 "Optical IEC958 Right",
90 "Center",
91 "LFE",
92 "Headphone Left",
93 "Headphone Right",
94 "Surround Left",
95 "Surround Right",
96 "PCM Capture Left",
97 "PCM Capture Right",
98 "MIC Capture",
99 "AC97 Surround Left",
100 "AC97 Surround Right",
101 "???",
102 "???",
103 "Analog Center",
104 "Analog LFE",
105 "???",
106 "???",
107 "???",
108 "???",
109 "???",
110 "???",
111 "???",
112 "???",
113 "???",
114 "???",
115 "???",
116 "???",
117 "???"
118 };
119
120 static char *audigy_outs[64] = {
121 "Digital Front Left",
122 "Digital Front Right",
123 "Digital Center",
124 "Digital LEF",
125 "Headphone Left",
126 "Headphone Right",
127 "Digital Rear Left",
128 "Digital Rear Right",
129 "Front Left",
130 "Front Right",
131 "Center",
132 "LFE",
133 "???",
134 "???",
135 "Rear Left",
136 "Rear Right",
137 "AC97 Front Left",
138 "AC97 Front Right",
139 "ADC Caputre Left",
140 "ADC Capture Right",
141 "???",
142 "???",
143 "???",
144 "???",
145 "???",
146 "???",
147 "???",
148 "???",
149 "???",
150 "???",
151 "???",
152 "???",
153 "FXBUS2_0",
154 "FXBUS2_1",
155 "FXBUS2_2",
156 "FXBUS2_3",
157 "FXBUS2_4",
158 "FXBUS2_5",
159 "FXBUS2_6",
160 "FXBUS2_7",
161 "FXBUS2_8",
162 "FXBUS2_9",
163 "FXBUS2_10",
164 "FXBUS2_11",
165 "FXBUS2_12",
166 "FXBUS2_13",
167 "FXBUS2_14",
168 "FXBUS2_15",
169 "FXBUS2_16",
170 "FXBUS2_17",
171 "FXBUS2_18",
172 "FXBUS2_19",
173 "FXBUS2_20",
174 "FXBUS2_21",
175 "FXBUS2_22",
176 "FXBUS2_23",
177 "FXBUS2_24",
178 "FXBUS2_25",
179 "FXBUS2_26",
180 "FXBUS2_27",
181 "FXBUS2_28",
182 "FXBUS2_29",
183 "FXBUS2_30",
184 "FXBUS2_31"
185 };
186
187 struct snd_emu10k1 *emu = entry->private_data;
188 unsigned int val, val1;
189 int nefx = emu->audigy ? 64 : 32;
190 char **outputs = emu->audigy ? audigy_outs : creative_outs;
191 int idx;
192
193 snd_iprintf(buffer, "EMU10K1\n\n");
194 snd_iprintf(buffer, "Card : %s\n",
195 emu->audigy ? "Audigy" : (emu->card_capabilities->ecard ? "EMU APS" : "Creative"));
196 snd_iprintf(buffer, "Internal TRAM (words) : 0x%x\n", emu->fx8010.itram_size);
197 snd_iprintf(buffer, "External TRAM (words) : 0x%x\n", (int)emu->fx8010.etram_pages.bytes / 2);
198 snd_iprintf(buffer, "\n");
199 snd_iprintf(buffer, "Effect Send Routing :\n");
200 for (idx = 0; idx < NUM_G; idx++) {
201 val = emu->audigy ?
202 snd_emu10k1_ptr_read(emu, A_FXRT1, idx) :
203 snd_emu10k1_ptr_read(emu, FXRT, idx);
204 val1 = emu->audigy ?
205 snd_emu10k1_ptr_read(emu, A_FXRT2, idx) :
206 0;
207 if (emu->audigy) {
208 snd_iprintf(buffer, "Ch%i: A=%i, B=%i, C=%i, D=%i, ",
209 idx,
210 val & 0x3f,
211 (val >> 8) & 0x3f,
212 (val >> 16) & 0x3f,
213 (val >> 24) & 0x3f);
214 snd_iprintf(buffer, "E=%i, F=%i, G=%i, H=%i\n",
215 val1 & 0x3f,
216 (val1 >> 8) & 0x3f,
217 (val1 >> 16) & 0x3f,
218 (val1 >> 24) & 0x3f);
219 } else {
220 snd_iprintf(buffer, "Ch%i: A=%i, B=%i, C=%i, D=%i\n",
221 idx,
222 (val >> 16) & 0x0f,
223 (val >> 20) & 0x0f,
224 (val >> 24) & 0x0f,
225 (val >> 28) & 0x0f);
226 }
227 }
228 snd_iprintf(buffer, "\nCaptured FX Outputs :\n");
229 for (idx = 0; idx < nefx; idx++) {
230 if (emu->efx_voices_mask[idx/32] & (1 << (idx%32)))
231 snd_iprintf(buffer, " Output %02i [%s]\n", idx, outputs[idx]);
232 }
233 snd_iprintf(buffer, "\nAll FX Outputs :\n");
234 for (idx = 0; idx < (emu->audigy ? 64 : 32); idx++)
235 snd_iprintf(buffer, " Output %02i [%s]\n", idx, outputs[idx]);
236}
237
238static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
239 struct snd_info_buffer *buffer)
240{
241 struct snd_emu10k1 *emu = entry->private_data;
242 u32 value;
243 u32 value2;
244 unsigned long flags;
245 u32 rate;
246
247 if (emu->card_capabilities->emu_model) {
248 spin_lock_irqsave(&emu->emu_lock, flags);
249 snd_emu1010_fpga_read(emu, 0x38, &value);
250 spin_unlock_irqrestore(&emu->emu_lock, flags);
251 if ((value & 0x1) == 0) {
252 spin_lock_irqsave(&emu->emu_lock, flags);
253 snd_emu1010_fpga_read(emu, 0x2a, &value);
254 snd_emu1010_fpga_read(emu, 0x2b, &value2);
255 spin_unlock_irqrestore(&emu->emu_lock, flags);
256 rate = 0x1770000 / (((value << 5) | value2)+1);
257 snd_iprintf(buffer, "ADAT Locked : %u\n", rate);
258 } else {
259 snd_iprintf(buffer, "ADAT Unlocked\n");
260 }
261 spin_lock_irqsave(&emu->emu_lock, flags);
262 snd_emu1010_fpga_read(emu, 0x20, &value);
263 spin_unlock_irqrestore(&emu->emu_lock, flags);
264 if ((value & 0x4) == 0) {
265 spin_lock_irqsave(&emu->emu_lock, flags);
266 snd_emu1010_fpga_read(emu, 0x28, &value);
267 snd_emu1010_fpga_read(emu, 0x29, &value2);
268 spin_unlock_irqrestore(&emu->emu_lock, flags);
269 rate = 0x1770000 / (((value << 5) | value2)+1);
270 snd_iprintf(buffer, "SPDIF Locked : %d\n", rate);
271 } else {
272 snd_iprintf(buffer, "SPDIF Unlocked\n");
273 }
274 } else {
275 snd_emu10k1_proc_spdif_status(emu, buffer, "CD-ROM S/PDIF In", CDCS, CDSRCS);
276 snd_emu10k1_proc_spdif_status(emu, buffer, "Optical or Coax S/PDIF In", GPSCS, GPSRCS);
277 }
278#if 0
279 val = snd_emu10k1_ptr_read(emu, ZVSRCS, 0);
280 snd_iprintf(buffer, "\nZoomed Video\n");
281 snd_iprintf(buffer, "Rate Locked : %s\n", val & SRCS_RATELOCKED ? "on" : "off");
282 snd_iprintf(buffer, "Estimated Sample Rate : 0x%x\n", val & SRCS_ESTSAMPLERATE);
283#endif
284}
285
286static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry,
287 struct snd_info_buffer *buffer)
288{
289 static int samplerate[8] = { 44100, 48000, 96000, 192000, 4, 5, 6, 7 };
290 struct snd_emu10k1 *emu = entry->private_data;
291 unsigned int val, tmp, n;
292 val = snd_emu10k1_ptr20_read(emu, CAPTURE_RATE_STATUS, 0);
293 tmp = (val >> 16) & 0x8;
294 for (n = 0; n < 4; n++) {
295 tmp = val >> (16 + (n*4));
296 if (tmp & 0x8) snd_iprintf(buffer, "Channel %d: Rate=%d\n", n, samplerate[tmp & 0x7]);
297 else snd_iprintf(buffer, "Channel %d: No input\n", n);
298 }
299}
300
301static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
302 struct snd_info_buffer *buffer)
303{
304 u32 pc;
305 struct snd_emu10k1 *emu = entry->private_data;
306
307 snd_iprintf(buffer, "FX8010 Instruction List '%s'\n", emu->fx8010.name);
308 snd_iprintf(buffer, " Code dump :\n");
309 for (pc = 0; pc < (emu->audigy ? 1024 : 512); pc++) {
310 u32 low, high;
311
312 low = snd_emu10k1_efx_read(emu, pc * 2);
313 high = snd_emu10k1_efx_read(emu, pc * 2 + 1);
314 if (emu->audigy)
315 snd_iprintf(buffer, " OP(0x%02x, 0x%03x, 0x%03x, 0x%03x, 0x%03x) /* 0x%04x: 0x%08x%08x */\n",
316 (high >> 24) & 0x0f,
317 (high >> 12) & 0x7ff,
318 (high >> 0) & 0x7ff,
319 (low >> 12) & 0x7ff,
320 (low >> 0) & 0x7ff,
321 pc,
322 high, low);
323 else
324 snd_iprintf(buffer, " OP(0x%02x, 0x%03x, 0x%03x, 0x%03x, 0x%03x) /* 0x%04x: 0x%08x%08x */\n",
325 (high >> 20) & 0x0f,
326 (high >> 10) & 0x3ff,
327 (high >> 0) & 0x3ff,
328 (low >> 10) & 0x3ff,
329 (low >> 0) & 0x3ff,
330 pc,
331 high, low);
332 }
333}
334
335#define TOTAL_SIZE_GPR (0x100*4)
336#define A_TOTAL_SIZE_GPR (0x200*4)
337#define TOTAL_SIZE_TANKMEM_DATA (0xa0*4)
338#define TOTAL_SIZE_TANKMEM_ADDR (0xa0*4)
339#define A_TOTAL_SIZE_TANKMEM_DATA (0x100*4)
340#define A_TOTAL_SIZE_TANKMEM_ADDR (0x100*4)
341#define TOTAL_SIZE_CODE (0x200*8)
342#define A_TOTAL_SIZE_CODE (0x400*8)
343
344static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
345 void *file_private_data,
346 struct file *file, char __user *buf,
347 unsigned long count, unsigned long pos)
348{
349 long size;
350 struct snd_emu10k1 *emu = entry->private_data;
351 unsigned int offset;
352 int tram_addr = 0;
353
354 if (!strcmp(entry->name, "fx8010_tram_addr")) {
355 offset = TANKMEMADDRREGBASE;
356 tram_addr = 1;
357 } else if (!strcmp(entry->name, "fx8010_tram_data")) {
358 offset = TANKMEMDATAREGBASE;
359 } else if (!strcmp(entry->name, "fx8010_code")) {
360 offset = emu->audigy ? A_MICROCODEBASE : MICROCODEBASE;
361 } else {
362 offset = emu->audigy ? A_FXGPREGBASE : FXGPREGBASE;
363 }
364 size = count;
365 if (pos + size > entry->size)
366 size = (long)entry->size - pos;
367 if (size > 0) {
368 unsigned int *tmp;
369 long res;
370 unsigned int idx;
371 if ((tmp = kmalloc(size + 8, GFP_KERNEL)) == NULL)
372 return -ENOMEM;
373 for (idx = 0; idx < ((pos & 3) + size + 3) >> 2; idx++)
374 if (tram_addr && emu->audigy) {
375 tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0) >> 11;
376 tmp[idx] |= snd_emu10k1_ptr_read(emu, 0x100 + idx + (pos >> 2), 0) << 20;
377 } else
378 tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0);
379 if (copy_to_user(buf, ((char *)tmp) + (pos & 3), size))
380 res = -EFAULT;
381 else {
382 res = size;
383 }
384 kfree(tmp);
385 return res;
386 }
387 return 0;
388}
389
390static void snd_emu10k1_proc_voices_read(struct snd_info_entry *entry,
391 struct snd_info_buffer *buffer)
392{
393 struct snd_emu10k1 *emu = entry->private_data;
394 struct snd_emu10k1_voice *voice;
395 int idx;
396
397 snd_iprintf(buffer, "ch\tuse\tpcm\tefx\tsynth\tmidi\n");
398 for (idx = 0; idx < NUM_G; idx++) {
399 voice = &emu->voices[idx];
400 snd_iprintf(buffer, "%i\t%i\t%i\t%i\t%i\t%i\n",
401 idx,
402 voice->use,
403 voice->pcm,
404 voice->efx,
405 voice->synth,
406 voice->midi);
407 }
408}
409
410#ifdef CONFIG_SND_DEBUG
411static void snd_emu_proc_emu1010_reg_read(struct snd_info_entry *entry,
412 struct snd_info_buffer *buffer)
413{
414 struct snd_emu10k1 *emu = entry->private_data;
415 u32 value;
416 unsigned long flags;
417 int i;
418 snd_iprintf(buffer, "EMU1010 Registers:\n\n");
419
420 for(i = 0; i < 0x40; i+=1) {
421 spin_lock_irqsave(&emu->emu_lock, flags);
422 snd_emu1010_fpga_read(emu, i, &value);
423 spin_unlock_irqrestore(&emu->emu_lock, flags);
424 snd_iprintf(buffer, "%02X: %08X, %02X\n", i, value, (value >> 8) & 0x7f);
425 }
426}
427
428static void snd_emu_proc_io_reg_read(struct snd_info_entry *entry,
429 struct snd_info_buffer *buffer)
430{
431 struct snd_emu10k1 *emu = entry->private_data;
432 unsigned long value;
433 unsigned long flags;
434 int i;
435 snd_iprintf(buffer, "IO Registers:\n\n");
436 for(i = 0; i < 0x40; i+=4) {
437 spin_lock_irqsave(&emu->emu_lock, flags);
438 value = inl(emu->port + i);
439 spin_unlock_irqrestore(&emu->emu_lock, flags);
440 snd_iprintf(buffer, "%02X: %08lX\n", i, value);
441 }
442}
443
444static void snd_emu_proc_io_reg_write(struct snd_info_entry *entry,
445 struct snd_info_buffer *buffer)
446{
447 struct snd_emu10k1 *emu = entry->private_data;
448 unsigned long flags;
449 char line[64];
450 u32 reg, val;
451 while (!snd_info_get_line(buffer, line, sizeof(line))) {
452 if (sscanf(line, "%x %x", ®, &val) != 2)
453 continue;
454 if ((reg < 0x40) && (reg >= 0) && (val <= 0xffffffff) ) {
455 spin_lock_irqsave(&emu->emu_lock, flags);
456 outl(val, emu->port + (reg & 0xfffffffc));
457 spin_unlock_irqrestore(&emu->emu_lock, flags);
458 }
459 }
460}
461
462static unsigned int snd_ptr_read(struct snd_emu10k1 * emu,
463 unsigned int iobase,
464 unsigned int reg,
465 unsigned int chn)
466{
467 unsigned long flags;
468 unsigned int regptr, val;
469
470 regptr = (reg << 16) | chn;
471
472 spin_lock_irqsave(&emu->emu_lock, flags);
473 outl(regptr, emu->port + iobase + PTR);
474 val = inl(emu->port + iobase + DATA);
475 spin_unlock_irqrestore(&emu->emu_lock, flags);
476 return val;
477}
478
479static void snd_ptr_write(struct snd_emu10k1 *emu,
480 unsigned int iobase,
481 unsigned int reg,
482 unsigned int chn,
483 unsigned int data)
484{
485 unsigned int regptr;
486 unsigned long flags;
487
488 regptr = (reg << 16) | chn;
489
490 spin_lock_irqsave(&emu->emu_lock, flags);
491 outl(regptr, emu->port + iobase + PTR);
492 outl(data, emu->port + iobase + DATA);
493 spin_unlock_irqrestore(&emu->emu_lock, flags);
494}
495
496
497static void snd_emu_proc_ptr_reg_read(struct snd_info_entry *entry,
498 struct snd_info_buffer *buffer, int iobase, int offset, int length, int voices)
499{
500 struct snd_emu10k1 *emu = entry->private_data;
501 unsigned long value;
502 int i,j;
503 if (offset+length > 0xa0) {
504 snd_iprintf(buffer, "Input values out of range\n");
505 return;
506 }
507 snd_iprintf(buffer, "Registers 0x%x\n", iobase);
508 for(i = offset; i < offset+length; i++) {
509 snd_iprintf(buffer, "%02X: ",i);
510 for (j = 0; j < voices; j++) {
511 if(iobase == 0)
512 value = snd_ptr_read(emu, 0, i, j);
513 else
514 value = snd_ptr_read(emu, 0x20, i, j);
515 snd_iprintf(buffer, "%08lX ", value);
516 }
517 snd_iprintf(buffer, "\n");
518 }
519}
520
521static void snd_emu_proc_ptr_reg_write(struct snd_info_entry *entry,
522 struct snd_info_buffer *buffer, int iobase)
523{
524 struct snd_emu10k1 *emu = entry->private_data;
525 char line[64];
526 unsigned int reg, channel_id , val;
527 while (!snd_info_get_line(buffer, line, sizeof(line))) {
528 if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3)
529 continue;
530 if ((reg < 0xa0) && (reg >= 0) && (val <= 0xffffffff) && (channel_id >= 0) && (channel_id <= 3) )
531 snd_ptr_write(emu, iobase, reg, channel_id, val);
532 }
533}
534
535static void snd_emu_proc_ptr_reg_write00(struct snd_info_entry *entry,
536 struct snd_info_buffer *buffer)
537{
538 snd_emu_proc_ptr_reg_write(entry, buffer, 0);
539}
540
541static void snd_emu_proc_ptr_reg_write20(struct snd_info_entry *entry,
542 struct snd_info_buffer *buffer)
543{
544 snd_emu_proc_ptr_reg_write(entry, buffer, 0x20);
545}
546
547
548static void snd_emu_proc_ptr_reg_read00a(struct snd_info_entry *entry,
549 struct snd_info_buffer *buffer)
550{
551 snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0, 0x40, 64);
552}
553
554static void snd_emu_proc_ptr_reg_read00b(struct snd_info_entry *entry,
555 struct snd_info_buffer *buffer)
556{
557 snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0x40, 0x40, 64);
558}
559
560static void snd_emu_proc_ptr_reg_read20a(struct snd_info_entry *entry,
561 struct snd_info_buffer *buffer)
562{
563 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0, 0x40, 4);
564}
565
566static void snd_emu_proc_ptr_reg_read20b(struct snd_info_entry *entry,
567 struct snd_info_buffer *buffer)
568{
569 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x40, 0x40, 4);
570}
571
572static void snd_emu_proc_ptr_reg_read20c(struct snd_info_entry *entry,
573 struct snd_info_buffer * buffer)
574{
575 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x80, 0x20, 4);
576}
577#endif
578
579static struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = {
580 .read = snd_emu10k1_fx8010_read,
581};
582
583int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu)
584{
585 struct snd_info_entry *entry;
586#ifdef CONFIG_SND_DEBUG
587 if (emu->card_capabilities->emu_model) {
588 if (! snd_card_proc_new(emu->card, "emu1010_regs", &entry))
589 snd_info_set_text_ops(entry, emu, snd_emu_proc_emu1010_reg_read);
590 }
591 if (! snd_card_proc_new(emu->card, "io_regs", &entry)) {
592 snd_info_set_text_ops(entry, emu, snd_emu_proc_io_reg_read);
593 entry->c.text.write = snd_emu_proc_io_reg_write;
594 entry->mode |= S_IWUSR;
595 }
596 if (! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
597 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00a);
598 entry->c.text.write = snd_emu_proc_ptr_reg_write00;
599 entry->mode |= S_IWUSR;
600 }
601 if (! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
602 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00b);
603 entry->c.text.write = snd_emu_proc_ptr_reg_write00;
604 entry->mode |= S_IWUSR;
605 }
606 if (! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
607 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20a);
608 entry->c.text.write = snd_emu_proc_ptr_reg_write20;
609 entry->mode |= S_IWUSR;
610 }
611 if (! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
612 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20b);
613 entry->c.text.write = snd_emu_proc_ptr_reg_write20;
614 entry->mode |= S_IWUSR;
615 }
616 if (! snd_card_proc_new(emu->card, "ptr_regs20c", &entry)) {
617 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20c);
618 entry->c.text.write = snd_emu_proc_ptr_reg_write20;
619 entry->mode |= S_IWUSR;
620 }
621#endif
622
623 if (! snd_card_proc_new(emu->card, "emu10k1", &entry))
624 snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_read);
625
626 if (emu->card_capabilities->emu10k2_chip) {
627 if (! snd_card_proc_new(emu->card, "spdif-in", &entry))
628 snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_spdif_read);
629 }
630 if (emu->card_capabilities->ca0151_chip) {
631 if (! snd_card_proc_new(emu->card, "capture-rates", &entry))
632 snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_rates_read);
633 }
634
635 if (! snd_card_proc_new(emu->card, "voices", &entry))
636 snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_voices_read);
637
638 if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
639 entry->content = SNDRV_INFO_CONTENT_DATA;
640 entry->private_data = emu;
641 entry->mode = S_IFREG | S_IRUGO ;
642 entry->size = emu->audigy ? A_TOTAL_SIZE_GPR : TOTAL_SIZE_GPR;
643 entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
644 }
645 if (! snd_card_proc_new(emu->card, "fx8010_tram_data", &entry)) {
646 entry->content = SNDRV_INFO_CONTENT_DATA;
647 entry->private_data = emu;
648 entry->mode = S_IFREG | S_IRUGO ;
649 entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_DATA : TOTAL_SIZE_TANKMEM_DATA ;
650 entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
651 }
652 if (! snd_card_proc_new(emu->card, "fx8010_tram_addr", &entry)) {
653 entry->content = SNDRV_INFO_CONTENT_DATA;
654 entry->private_data = emu;
655 entry->mode = S_IFREG | S_IRUGO ;
656 entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_ADDR : TOTAL_SIZE_TANKMEM_ADDR ;
657 entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
658 }
659 if (! snd_card_proc_new(emu->card, "fx8010_code", &entry)) {
660 entry->content = SNDRV_INFO_CONTENT_DATA;
661 entry->private_data = emu;
662 entry->mode = S_IFREG | S_IRUGO ;
663 entry->size = emu->audigy ? A_TOTAL_SIZE_CODE : TOTAL_SIZE_CODE;
664 entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
665 }
666 if (! snd_card_proc_new(emu->card, "fx8010_acode", &entry)) {
667 entry->content = SNDRV_INFO_CONTENT_TEXT;
668 entry->private_data = emu;
669 entry->mode = S_IFREG | S_IRUGO ;
670 entry->c.text.read = snd_emu10k1_proc_acode_read;
671 }
672 return 0;
673}
674#endif
675