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