vserver 2.0 rc7
[linux-2.6.git] / sound / pci / emu10k1 / emuproc.c
index a65fce3..d990d5e 100644 (file)
@@ -140,38 +140,38 @@ static void snd_emu10k1_proc_read(snd_info_entry_t *entry,
                /* 29 */ "???",
                /* 30 */ "???",
                /* 31 */ "???",
-               /* 32 */ "???",
-               /* 33 */ "???",
-               /* 34 */ "???",
-               /* 35 */ "???",
-               /* 36 */ "???",
-               /* 37 */ "???",
-               /* 38 */ "???",
-               /* 39 */ "???",
-               /* 40 */ "???",
-               /* 41 */ "???",
-               /* 42 */ "???",
-               /* 43 */ "???",
-               /* 44 */ "???",
-               /* 45 */ "???",
-               /* 46 */ "???",
-               /* 47 */ "???",
-               /* 48 */ "???",
-               /* 49 */ "???",
-               /* 50 */ "???",
-               /* 51 */ "???",
-               /* 52 */ "???",
-               /* 53 */ "???",
-               /* 54 */ "???",
-               /* 55 */ "???",
-               /* 56 */ "???",
-               /* 57 */ "???",
-               /* 58 */ "???",
-               /* 59 */ "???",
-               /* 60 */ "???",
-               /* 61 */ "???",
-               /* 62 */ "???",
-               /* 33 */ "???"
+               /* 32 */ "FXBUS2_0",
+               /* 33 */ "FXBUS2_1",
+               /* 34 */ "FXBUS2_2",
+               /* 35 */ "FXBUS2_3",
+               /* 36 */ "FXBUS2_4",
+               /* 37 */ "FXBUS2_5",
+               /* 38 */ "FXBUS2_6",
+               /* 39 */ "FXBUS2_7",
+               /* 40 */ "FXBUS2_8",
+               /* 41 */ "FXBUS2_9",
+               /* 42 */ "FXBUS2_10",
+               /* 43 */ "FXBUS2_11",
+               /* 44 */ "FXBUS2_12",
+               /* 45 */ "FXBUS2_13",
+               /* 46 */ "FXBUS2_14",
+               /* 47 */ "FXBUS2_15",
+               /* 48 */ "FXBUS2_16",
+               /* 49 */ "FXBUS2_17",
+               /* 50 */ "FXBUS2_18",
+               /* 51 */ "FXBUS2_19",
+               /* 52 */ "FXBUS2_20",
+               /* 53 */ "FXBUS2_21",
+               /* 54 */ "FXBUS2_22",
+               /* 55 */ "FXBUS2_23",
+               /* 56 */ "FXBUS2_24",
+               /* 57 */ "FXBUS2_25",
+               /* 58 */ "FXBUS2_26",
+               /* 59 */ "FXBUS2_27",
+               /* 60 */ "FXBUS2_28",
+               /* 61 */ "FXBUS2_29",
+               /* 62 */ "FXBUS2_30",
+               /* 63 */ "FXBUS2_31"
        };
 
        emu10k1_t *emu = entry->private_data;
@@ -184,7 +184,7 @@ static void snd_emu10k1_proc_read(snd_info_entry_t *entry,
        snd_iprintf(buffer, "Card                  : %s\n",
                    emu->audigy ? "Audigy" : (emu->APS ? "EMU APS" : "Creative"));
        snd_iprintf(buffer, "Internal TRAM (words) : 0x%x\n", emu->fx8010.itram_size);
-       snd_iprintf(buffer, "External TRAM (words) : 0x%x\n", (int)emu->fx8010.etram_pages.bytes);
+       snd_iprintf(buffer, "External TRAM (words) : 0x%x\n", (int)emu->fx8010.etram_pages.bytes / 2);
        snd_iprintf(buffer, "\n");
        snd_iprintf(buffer, "Effect Send Routing   :\n");
        for (idx = 0; idx < NUM_G; idx++) {
@@ -221,7 +221,7 @@ static void snd_emu10k1_proc_read(snd_info_entry_t *entry,
                        snd_iprintf(buffer, "  Output %02i [%s]\n", idx, outputs[idx]);
        }
        snd_iprintf(buffer, "\nAll FX Outputs        :\n");
-       for (idx = 0; idx < 32; idx++)
+       for (idx = 0; idx < (emu->audigy ? 64 : 32); idx++)
                snd_iprintf(buffer, "  Output %02i [%s]\n", idx, outputs[idx]);
        snd_emu10k1_proc_spdif_status(emu, buffer, "S/PDIF Output 0", SPCS0, -1);
        snd_emu10k1_proc_spdif_status(emu, buffer, "S/PDIF Output 1", SPCS1, -1);
@@ -322,6 +322,26 @@ static long snd_emu10k1_fx8010_read(snd_info_entry_t *entry, void *file_private_
        return 0;
 }
 
+static void snd_emu10k1_proc_voices_read(snd_info_entry_t *entry, 
+                                 snd_info_buffer_t * buffer)
+{
+       emu10k1_t *emu = entry->private_data;
+       emu10k1_voice_t *voice;
+       int idx;
+       
+       snd_iprintf(buffer, "ch\tuse\tpcm\tefx\tsynth\tmidi\n");
+       for (idx = 0; idx < NUM_G; idx++) {
+               voice = &emu->voices[idx];
+               snd_iprintf(buffer, "%i\t%i\t%i\t%i\t%i\t%i\n",
+                       idx,
+                       voice->use,
+                       voice->pcm,
+                       voice->efx,
+                       voice->synth,
+                       voice->midi);
+       }
+}
+
 #ifdef CONFIG_SND_DEBUG
 static void snd_emu_proc_io_reg_read(snd_info_entry_t *entry,
                                     snd_info_buffer_t * buffer)
@@ -393,7 +413,7 @@ static void snd_ptr_write(emu10k1_t *emu,
 
 
 static void snd_emu_proc_ptr_reg_read(snd_info_entry_t *entry,
-                                     snd_info_buffer_t * buffer, int iobase, int offset, int length)
+                                     snd_info_buffer_t * buffer, int iobase, int offset, int length, int voices)
 {
        emu10k1_t *emu = entry->private_data;
        unsigned long value;
@@ -405,7 +425,7 @@ static void snd_emu_proc_ptr_reg_read(snd_info_entry_t *entry,
        snd_iprintf(buffer, "Registers 0x%x\n", iobase);
        for(i = offset; i < offset+length; i++) {
                snd_iprintf(buffer, "%02X: ",i);
-               for (j = 0; j < 4; j++) {
+               for (j = 0; j < voices; j++) {
                        if(iobase == 0)
                                value = snd_ptr_read(emu, 0, i, j);
                        else
@@ -446,25 +466,25 @@ static void snd_emu_proc_ptr_reg_write20(snd_info_entry_t *entry,
 static void snd_emu_proc_ptr_reg_read00a(snd_info_entry_t *entry,
                                         snd_info_buffer_t * buffer)
 {
-       snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0, 0x40);
+       snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0, 0x40, 64);
 }
 
 static void snd_emu_proc_ptr_reg_read00b(snd_info_entry_t *entry,
                                         snd_info_buffer_t * buffer)
 {
-       snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0x40, 0x40);
+       snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0x40, 0x40, 64);
 }
 
 static void snd_emu_proc_ptr_reg_read20a(snd_info_entry_t *entry,
                                         snd_info_buffer_t * buffer)
 {
-       snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0, 0x40);
+       snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0, 0x40, 4);
 }
 
 static void snd_emu_proc_ptr_reg_read20b(snd_info_entry_t *entry,
                                         snd_info_buffer_t * buffer)
 {
-       snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x40, 0x40);
+       snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x40, 0x40, 4);
 }
 #endif
 
@@ -482,22 +502,22 @@ int __devinit snd_emu10k1_proc_init(emu10k1_t * emu)
                entry->c.text.write = snd_emu_proc_io_reg_write;
        }
        if (! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
-               snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_ptr_reg_read00a);
+               snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read00a);
                entry->c.text.write_size = 64;
                entry->c.text.write = snd_emu_proc_ptr_reg_write00;
        }
        if (! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
-               snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_ptr_reg_read00b);
+               snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read00b);
                entry->c.text.write_size = 64;
                entry->c.text.write = snd_emu_proc_ptr_reg_write00;
        }
        if (! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
-               snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_ptr_reg_read20a);
+               snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read20a);
                entry->c.text.write_size = 64;
                entry->c.text.write = snd_emu_proc_ptr_reg_write20;
        }
        if (! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
-               snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_ptr_reg_read20b);
+               snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read20b);
                entry->c.text.write_size = 64;
                entry->c.text.write = snd_emu_proc_ptr_reg_write20;
        }
@@ -506,6 +526,9 @@ int __devinit snd_emu10k1_proc_init(emu10k1_t * emu)
        if (! snd_card_proc_new(emu->card, "emu10k1", &entry))
                snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_read);
 
+       if (! snd_card_proc_new(emu->card, "voices", &entry))
+               snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_voices_read);
+
        if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
                entry->content = SNDRV_INFO_CONTENT_DATA;
                entry->private_data = emu;