[ALSA] hda-codec - Fix orphan Headphone controls in STAC codecs
[safe/jmp/linux-2.6] / sound / pci / ca0106 / ca0106_proc.c
index 1c9cc82..c62b7d1 100644 (file)
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
  */
-#include <sound/driver.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/ac97_codec.h>
 #include <sound/info.h>
 #include <sound/asoundef.h>
+#include <asm/io.h>
 
 #include "ca0106.h"
 
 
+#ifdef CONFIG_PROC_FS
+
 struct snd_ca0106_category_str {
        int val;
        const char *name;
@@ -97,7 +98,7 @@ static struct snd_ca0106_category_str snd_ca0106_con_category[] = {
 };
 
 
-static void snd_ca0106_proc_dump_iec958( snd_info_buffer_t *buffer, u32 value)
+static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 value)
 {
        int i;
        u32 status[4];
@@ -271,10 +272,10 @@ static void snd_ca0106_proc_dump_iec958( snd_info_buffer_t *buffer, u32 value)
        }
 }
 
-static void snd_ca0106_proc_iec958(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_iec958(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
        u32 value;
 
         value = snd_ca0106_ptr_read(emu, SAMPLE_RATE_TRACKER_STATUS, 0);
@@ -293,10 +294,10 @@ static void snd_ca0106_proc_iec958(snd_info_entry_t *entry,
        snd_iprintf(buffer, "\n");
 }
 
-static void snd_ca0106_proc_reg_write32(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
        unsigned long flags;
         char line[64];
         u32 reg, val;
@@ -311,10 +312,10 @@ static void snd_ca0106_proc_reg_write32(snd_info_entry_t *entry,
         }
 }
 
-static void snd_ca0106_proc_reg_read32(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
        unsigned long value;
        unsigned long flags;
        int i;
@@ -327,10 +328,10 @@ static void snd_ca0106_proc_reg_read32(snd_info_entry_t *entry,
        }
 }
 
-static void snd_ca0106_proc_reg_read16(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
         unsigned int value;
        unsigned long flags;
        int i;
@@ -343,10 +344,10 @@ static void snd_ca0106_proc_reg_read16(snd_info_entry_t *entry,
        }
 }
 
-static void snd_ca0106_proc_reg_read8(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
        unsigned int value;
        unsigned long flags;
        int i;
@@ -359,10 +360,10 @@ static void snd_ca0106_proc_reg_read8(snd_info_entry_t *entry,
        }
 }
 
-static void snd_ca0106_proc_reg_read1(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
        unsigned long value;
        int i,j;
 
@@ -377,10 +378,10 @@ static void snd_ca0106_proc_reg_read1(snd_info_entry_t *entry,
        }
 }
 
-static void snd_ca0106_proc_reg_read2(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
        unsigned long value;
        int i,j;
 
@@ -395,10 +396,10 @@ static void snd_ca0106_proc_reg_read2(snd_info_entry_t *entry,
        }
 }
 
-static void snd_ca0106_proc_reg_write(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
         char line[64];
         unsigned int reg, channel_id , val;
         while (!snd_info_get_line(buffer, line, sizeof(line))) {
@@ -409,10 +410,10 @@ static void snd_ca0106_proc_reg_write(snd_info_entry_t *entry,
         }
 }
 
-static void snd_ca0106_proc_i2c_write(snd_info_entry_t *entry, 
-                                      snd_info_buffer_t * buffer)
+static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry, 
+                                      struct snd_info_buffer *buffer)
 {
-       ca0106_t *emu = entry->private_data;
+       struct snd_ca0106 *emu = entry->private_data;
         char line[64];
         unsigned int reg, val;
         while (!snd_info_get_line(buffer, line, sizeof(line))) {
@@ -424,38 +425,34 @@ static void snd_ca0106_proc_i2c_write(snd_info_entry_t *entry,
         }
 }
 
-int __devinit snd_ca0106_proc_init(ca0106_t * emu)
+int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu)
 {
-       snd_info_entry_t *entry;
+       struct snd_info_entry *entry;
        
        if(! snd_card_proc_new(emu->card, "iec958", &entry))
-               snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_iec958);
+               snd_info_set_text_ops(entry, emu, snd_ca0106_proc_iec958);
        if(! snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) {
-               snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read32);
-               entry->c.text.write_size = 64;
+               snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read32);
                entry->c.text.write = snd_ca0106_proc_reg_write32;
                entry->mode |= S_IWUSR;
        }
        if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry))
-               snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read16);
+               snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read16);
        if(! snd_card_proc_new(emu->card, "ca0106_reg8", &entry))
-               snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read8);
+               snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read8);
        if(! snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) {
-               snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read1);
-               entry->c.text.write_size = 64;
+               snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read1);
                entry->c.text.write = snd_ca0106_proc_reg_write;
                entry->mode |= S_IWUSR;
-//             entry->private_data = emu;
        }
        if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
-               snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_i2c_write);
-               entry->c.text.write_size = 64;
                entry->c.text.write = snd_ca0106_proc_i2c_write;
+               entry->private_data = emu;
                entry->mode |= S_IWUSR;
-//             entry->private_data = emu;
        }
        if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry)) 
-               snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read2);
+               snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read2);
        return 0;
 }
 
+#endif /* CONFIG_PROC_FS */