Update of /cvsroot/alsa/alsa-kernel/pci/ac97
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22831/pci/ac97

Modified Files:
        ac97_proc.c 
Log Message:
show AC'97 2.3 information in proc file

Index: ac97_proc.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_proc.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ac97_proc.c 29 Mar 2004 07:05:00 -0000      1.5
+++ ac97_proc.c 7 Apr 2004 07:21:34 -0000       1.6
@@ -34,6 +34,40 @@
  * proc interface
  */
 
+static void snd_ac97_proc_read_functions(ac97_t *ac97, snd_info_buffer_t *buffer)
+{
+       int header = 0, function;
+       unsigned short info, sense_info;
+       static const char *function_names[12] = {
+               "Master Out", "AUX Out", "Center/LFE Out", "SPDIF Out",
+               "Phone In", "Mic 1", "Mic 2", "Line In", "CD In", "Video In",
+               "Aux In", "Mono Out"
+       };
+       static const char *locations[8] = {
+               "Rear I/O Panel", "Front Panel", "Motherboard", "Dock/External",
+               "reserved", "reserved", "reserved", "NC/unused"
+       };
+
+       for (function = 0; function < 12; ++function) {
+               snd_ac97_write(ac97, AC97_FUNC_SELECT, function << 1);
+               info = snd_ac97_read(ac97, AC97_FUNC_INFO);
+               if (!(info & 0x0001))
+                       continue;
+               if (!header) {
+                       snd_iprintf(buffer, "\n                    Gain     Inverted  
Buffer delay  Location\n");
+                       header = 1;
+               }
+               sense_info = snd_ac97_read(ac97, AC97_SENSE_INFO);
+               snd_iprintf(buffer, "%-17s: %3d.%d dBV    %c      %2d/fs         %s\n",
+                           function_names[function],
+                           (info & 0x8000 ? -1 : 1) * ((info & 0x7000) >> 12) * 3 / 2,
+                           ((info & 0x0800) >> 11) * 5,
+                           info & 0x0400 ? 'X' : '-',
+                           (info & 0x03e0) >> 5,
+                           locations[sense_info >> 13]);
+       }
+}
+
 static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int 
subidx)
 {
        char name[64];
@@ -47,6 +81,21 @@
        if ((ac97->scaps & AC97_SCAP_AUDIO) == 0)
                goto __modem;
 
+       if ((ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_23) {
+               val = snd_ac97_read(ac97, AC97_INT_PAGING);
+               snd_ac97_update_bits(ac97, AC97_INT_PAGING,
+                                    AC97_PAGE_MASK, AC97_PAGE_1);
+               tmp = snd_ac97_read(ac97, AC97_CODEC_CLASS_REV);
+               snd_iprintf(buffer, "Revision         : 0x%02x\n", tmp & 0xff);
+               snd_iprintf(buffer, "Compat. Class    : 0x%02x\n", (tmp >> 8) & 0x1f);
+               snd_iprintf(buffer, "Subsys. Vendor ID: 0x%04x\n",
+                           snd_ac97_read(ac97, AC97_PCI_SVID));
+               snd_iprintf(buffer, "Subsys. ID       : 0x%04x\n\n",
+                           snd_ac97_read(ac97, AC97_PCI_SID));
+               snd_ac97_update_bits(ac97, AC97_INT_PAGING,
+                                    AC97_PAGE_MASK, val & AC97_PAGE_MASK);
+       }
+
        // val = snd_ac97_read(ac97, AC97_RESET);
        val = ac97->caps;
        snd_iprintf(buffer, "Capabilities     :%s%s%s%s%s%s\n",
@@ -185,6 +234,14 @@
                        }
                }
        }
+       if ((ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_23) {
+               val = snd_ac97_read(ac97, AC97_INT_PAGING);
+               snd_ac97_update_bits(ac97, AC97_INT_PAGING,
+                                    AC97_PAGE_MASK, AC97_PAGE_1);
+               snd_ac97_proc_read_functions(ac97, buffer);
+               snd_ac97_update_bits(ac97, AC97_INT_PAGING,
+                                    AC97_PAGE_MASK, val & AC97_PAGE_MASK);
+       }
 
 
       __modem:



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to