]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/ac97/ac97_proc.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
[linux-2.6-omap-h63xx.git] / sound / pci / ac97 / ac97_proc.c
index 2118df50b9d6123fa8f9fd2d244309cd549715b8..060ea59d5f02f02e74c06b28c68a5c37fb0a7446 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  *  Universal interface for Audio Codec '97
  *
  *  For more details look to AC '97 component specification revision 2.2
@@ -22,7 +22,6 @@
  *
  */
 
-#include <sound/driver.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
 
@@ -236,10 +235,14 @@ static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffe
                val = snd_ac97_read(ac97, AC97_PCM_MIC_ADC_RATE);
                snd_iprintf(buffer, "PCM MIC ADC      : %iHz\n", val);
        }
-       if ((ext & AC97_EI_SPDIF) || (ac97->flags & AC97_CS_SPDIF)) {
+       if ((ext & AC97_EI_SPDIF) || (ac97->flags & AC97_CS_SPDIF) ||
+           (ac97->id == AC97_ID_YMF743)) {
                if (ac97->flags & AC97_CS_SPDIF)
                        val = snd_ac97_read(ac97, AC97_CSR_SPDIF);
-               else
+               else if (ac97->id == AC97_ID_YMF743) {
+                       val = snd_ac97_read(ac97, AC97_YMF7X3_DIT_CTRL);
+                       val = 0x2000 | (val & 0xff00) >> 4 | (val & 0x38) >> 2;
+               } else
                        val = snd_ac97_read(ac97, AC97_SPDIF);
 
                snd_iprintf(buffer, "SPDIF Control    :%s%s%s%s Category=0x%x Generation=%i%s%s%s\n",
@@ -457,14 +460,10 @@ void snd_ac97_proc_init(struct snd_ac97 * ac97)
 
 void snd_ac97_proc_done(struct snd_ac97 * ac97)
 {
-       if (ac97->proc_regs) {
-               snd_info_unregister(ac97->proc_regs);
-               ac97->proc_regs = NULL;
-       }
-       if (ac97->proc) {
-               snd_info_unregister(ac97->proc);
-               ac97->proc = NULL;
-       }
+       snd_info_free_entry(ac97->proc_regs);
+       ac97->proc_regs = NULL;
+       snd_info_free_entry(ac97->proc);
+       ac97->proc = NULL;
 }
 
 void snd_ac97_bus_proc_init(struct snd_ac97_bus * bus)
@@ -485,8 +484,6 @@ void snd_ac97_bus_proc_init(struct snd_ac97_bus * bus)
 
 void snd_ac97_bus_proc_done(struct snd_ac97_bus * bus)
 {
-       if (bus->proc) {
-               snd_info_unregister(bus->proc);
-               bus->proc = NULL;
-       }
+       snd_info_free_entry(bus->proc);
+       bus->proc = NULL;
 }