aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2004-04-24 19:47:33 +0200
committerJaroslav Kysela <perex@suse.cz>2004-04-24 19:47:33 +0200
commit1d2005a96fdfb9f46e981afb67f03938bcd697a1 (patch)
treee7e3a1bddfa7fc8429ace40c8ca7ec5320def05a /sound
parent5c5371da18c4ce971a81855f3633e72cfa11dc95 (diff)
downloadhistory-1d2005a96fdfb9f46e981afb67f03938bcd697a1.tar.gz
ALSA CVS update - Clemens Ladisch <clemens@ladisch.de>
AC97 Codec Core show AC'97 2.3 information in proc file
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/ac97/ac97_proc.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c
index 2080463799a248..ec19ba8e400175 100644
--- a/sound/pci/ac97/ac97_proc.c
+++ b/sound/pci/ac97/ac97_proc.c
@@ -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 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
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 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
}
}
}
+ 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: