]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[ALSA] Optimize for config without PROC_FS (pci drivers)
authorTakashi Iwai <tiwai@suse.de>
Thu, 1 Dec 2005 09:49:58 +0000 (10:49 +0100)
committerJaroslav Kysela <perex@suse.cz>
Tue, 3 Jan 2006 11:30:08 +0000 (12:30 +0100)
Optimize the code when compiled without CONFIG_PROC_FS for some pci drivers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
16 files changed:
sound/pci/ac97/ac97_codec.c
sound/pci/ac97/ac97_local.h
sound/pci/ac97/ac97_proc.c
sound/pci/ac97/ak4531_codec.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/ca0106/ca0106_main.c
sound/pci/ca0106/ca0106_proc.c
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/cs46xx/cs46xx_lib.h
sound/pci/cs46xx/dsp_spos.c
sound/pci/cs46xx/dsp_spos_scb_lib.c
sound/pci/emu10k1/emu10k1_main.c
sound/pci/emu10k1/emuproc.c
sound/pci/intel8x0.c
sound/pci/intel8x0m.c

index abc83fa85bcd604e27fca56467d3c051e9237954..17c3ddac35ccb0a693718668815c9181eac60424 100644 (file)
@@ -184,42 +184,6 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
 { 0,         0,          NULL,                 NULL,           NULL }
 };
 
-const char *snd_ac97_stereo_enhancements[] =
-{
-  /*   0 */ "No 3D Stereo Enhancement",
-  /*   1 */ "Analog Devices Phat Stereo",
-  /*   2 */ "Creative Stereo Enhancement",
-  /*   3 */ "National Semi 3D Stereo Enhancement",
-  /*   4 */ "YAMAHA Ymersion",
-  /*   5 */ "BBE 3D Stereo Enhancement",
-  /*   6 */ "Crystal Semi 3D Stereo Enhancement",
-  /*   7 */ "Qsound QXpander",
-  /*   8 */ "Spatializer 3D Stereo Enhancement",
-  /*   9 */ "SRS 3D Stereo Enhancement",
-  /*  10 */ "Platform Tech 3D Stereo Enhancement",
-  /*  11 */ "AKM 3D Audio",
-  /*  12 */ "Aureal Stereo Enhancement",
-  /*  13 */ "Aztech 3D Enhancement",
-  /*  14 */ "Binaura 3D Audio Enhancement",
-  /*  15 */ "ESS Technology Stereo Enhancement",
-  /*  16 */ "Harman International VMAx",
-  /*  17 */ "Nvidea/IC Ensemble/KS Waves 3D Stereo Enhancement",
-  /*  18 */ "Philips Incredible Sound",
-  /*  19 */ "Texas Instruments 3D Stereo Enhancement",
-  /*  20 */ "VLSI Technology 3D Stereo Enhancement",
-  /*  21 */ "TriTech 3D Stereo Enhancement",
-  /*  22 */ "Realtek 3D Stereo Enhancement",
-  /*  23 */ "Samsung 3D Stereo Enhancement",
-  /*  24 */ "Wolfson Microelectronics 3D Enhancement",
-  /*  25 */ "Delta Integration 3D Enhancement",
-  /*  26 */ "SigmaTel 3D Enhancement",
-  /*  27 */ "IC Ensemble/KS Waves",
-  /*  28 */ "Rockwell 3D Stereo Enhancement",
-  /*  29 */ "Reserved 29",
-  /*  30 */ "Reserved 30",
-  /*  31 */ "Reserved 31"
-};
-
 
 /*
  *  I/O routines
@@ -1895,10 +1859,12 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
        init_MUTEX(&ac97->reg_mutex);
        init_MUTEX(&ac97->page_mutex);
 
+#ifdef CONFIG_PCI
        if (ac97->pci) {
                pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_VENDOR_ID, &ac97->subsystem_vendor);
                pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_ID, &ac97->subsystem_device);
        }
+#endif
        if (bus->ops->reset) {
                bus->ops->reset(ac97);
                goto __access_ok;
index e98587e027d4d7a481d4ed8f945f197d815a4951..a6244c720a1d8762000bdcdf86fc293b9667efed 100644 (file)
@@ -57,7 +57,6 @@ struct ac97_enum {
   .private_value = (unsigned long)&xenum }
 
 /* ac97_codec.c */
-extern const char *snd_ac97_stereo_enhancements[];
 extern const struct snd_kcontrol_new snd_ac97_controls_3d[];
 extern const struct snd_kcontrol_new snd_ac97_controls_spdif[];
 struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 * ac97);
index 266073201293fa446c423a0589c0f2b1cd1fe28b..7134b3f55fb526658e79d97337335e3b120fb74e 100644 (file)
@@ -68,6 +68,42 @@ static void snd_ac97_proc_read_functions(struct snd_ac97 *ac97, struct snd_info_
        }
 }
 
+static const char *snd_ac97_stereo_enhancements[] =
+{
+  /*   0 */ "No 3D Stereo Enhancement",
+  /*   1 */ "Analog Devices Phat Stereo",
+  /*   2 */ "Creative Stereo Enhancement",
+  /*   3 */ "National Semi 3D Stereo Enhancement",
+  /*   4 */ "YAMAHA Ymersion",
+  /*   5 */ "BBE 3D Stereo Enhancement",
+  /*   6 */ "Crystal Semi 3D Stereo Enhancement",
+  /*   7 */ "Qsound QXpander",
+  /*   8 */ "Spatializer 3D Stereo Enhancement",
+  /*   9 */ "SRS 3D Stereo Enhancement",
+  /*  10 */ "Platform Tech 3D Stereo Enhancement",
+  /*  11 */ "AKM 3D Audio",
+  /*  12 */ "Aureal Stereo Enhancement",
+  /*  13 */ "Aztech 3D Enhancement",
+  /*  14 */ "Binaura 3D Audio Enhancement",
+  /*  15 */ "ESS Technology Stereo Enhancement",
+  /*  16 */ "Harman International VMAx",
+  /*  17 */ "Nvidea/IC Ensemble/KS Waves 3D Stereo Enhancement",
+  /*  18 */ "Philips Incredible Sound",
+  /*  19 */ "Texas Instruments 3D Stereo Enhancement",
+  /*  20 */ "VLSI Technology 3D Stereo Enhancement",
+  /*  21 */ "TriTech 3D Stereo Enhancement",
+  /*  22 */ "Realtek 3D Stereo Enhancement",
+  /*  23 */ "Samsung 3D Stereo Enhancement",
+  /*  24 */ "Wolfson Microelectronics 3D Enhancement",
+  /*  25 */ "Delta Integration 3D Enhancement",
+  /*  26 */ "SigmaTel 3D Enhancement",
+  /*  27 */ "IC Ensemble/KS Waves",
+  /*  28 */ "Rockwell 3D Stereo Enhancement",
+  /*  29 */ "Reserved 29",
+  /*  30 */ "Reserved 30",
+  /*  31 */ "Reserved 31"
+};
+
 static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffer *buffer, int subidx)
 {
        char name[64];
index 3eb885584e9a8fb83292a6513f2ccf93586455d2..dcfb5036ff8bdba9359f017802d3c573bbf62aa8 100644 (file)
@@ -30,7 +30,11 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Universal routines for AK4531 codec");
 MODULE_LICENSE("GPL");
 
+#ifdef CONFIG_PROC_FS
 static void snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak4531);
+#else
+#define snd_ak4531_proc_init(card,ak)
+#endif
 
 /*
  *
@@ -425,8 +429,9 @@ void snd_ak4531_resume(struct snd_ak4531 *ak4531)
 }
 #endif
 
+#ifdef CONFIG_PROC_FS
 /*
-
+ * /proc interface
  */
 
 static void snd_ak4531_proc_read(struct snd_info_entry *entry, 
@@ -448,6 +453,7 @@ static void snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak453
        if (! snd_card_proc_new(card, "ak4531", &entry))
                snd_info_set_text_ops(entry, ak4531, 1024, snd_ak4531_proc_read);
 }
+#endif
 
 EXPORT_SYMBOL(snd_ak4531_mixer);
 #ifdef CONFIG_PM
index a039284c7c54b55b6f725407814385a16c928167..33e0664a1925a1c33682ee490bf92358554e6e72 100644 (file)
@@ -1477,6 +1477,7 @@ static int snd_atiixp_resume(struct pci_dev *pci)
 #endif /* CONFIG_PM */
 
 
+#ifdef CONFIG_PROC_FS
 /*
  * proc interface for register dump
  */
@@ -1498,7 +1499,9 @@ static void __devinit snd_atiixp_proc_init(struct atiixp *chip)
        if (! snd_card_proc_new(chip->card, "atiixp", &entry))
                snd_info_set_text_ops(entry, chip, 1024, snd_atiixp_proc_read);
 }
-
+#else /* !CONFIG_PROC_FS */
+#define snd_atiixp_proc_init(chip)
+#endif
 
 
 /*
index 73f1f2b1a355c855e220675429e7ca4242dee879..8d8fd5a4ed35aef8378311c043fd1f5b4445e87d 100644 (file)
@@ -1156,6 +1156,7 @@ static int snd_atiixp_resume(struct pci_dev *pci)
 #endif /* CONFIG_PM */
 
 
+#ifdef CONFIG_PROC_FS
 /*
  * proc interface for register dump
  */
@@ -1177,7 +1178,9 @@ static void __devinit snd_atiixp_proc_init(struct atiixp_modem *chip)
        if (! snd_card_proc_new(chip->card, "atiixp-modem", &entry))
                snd_info_set_text_ops(entry, chip, 1024, snd_atiixp_proc_read);
 }
-
+#else
+#define snd_atiixp_proc_init(chip)
+#endif
 
 
 /*
index 744f9718372364979cf401b20835c37e86e3c623..5964cdc93f73509550421032a9df0319d6e985ea 100644 (file)
@@ -1456,7 +1456,9 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci,
        }
        snd_printdd(" done.\n");
 
+#ifdef CONFIG_PROC_FS
        snd_ca0106_proc_init(chip);
+#endif
 
        if ((err = snd_card_register(card)) < 0) {
                snd_card_free(card);
index 94b6225993862c8c190e2d49a904476a119cbbe2..63757273bfb73971d4e641b4caf59ec42fb205f3 100644 (file)
@@ -77,6 +77,8 @@
 #include "ca0106.h"
 
 
+#ifdef CONFIG_PROC_FS
+
 struct snd_ca0106_category_str {
        int val;
        const char *name;
@@ -459,3 +461,4 @@ int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu)
        return 0;
 }
 
+#endif /* CONFIG_PROC_FS */
index 0ec0592a6e6f8066a5d338a71a575d6033bde0f4..8fb275d6eb77c6e11b8fdaea63d6392853558446 100644 (file)
@@ -2747,6 +2747,7 @@ int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip) { return -ENOSYS; }
 static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { }
 #endif /* CONFIG_GAMEPORT */
 
+#ifdef CONFIG_PROC_FS
 /*
  *  proc interface
  */
@@ -2800,6 +2801,10 @@ static int snd_cs46xx_proc_done(struct snd_cs46xx *chip)
 #endif
        return 0;
 }
+#else /* !CONFIG_PROC_FS */
+#define snd_cs46xx_proc_init(card, chip)
+#define snd_cs46xx_proc_done(chip)
+#endif
 
 /*
  * stop the h/w
index 8b4a4aeaf85f31736569c1073f955dc572c83b6a..f75750c2bd245c31bbe30a22107c7ea804c52add 100644 (file)
@@ -88,8 +88,13 @@ void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip);
 int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module);
 struct dsp_symbol_entry *cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name,
                                                   int symbol_type);
+#ifdef CONFIG_PROC_FS
 int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip);
 int cs46xx_dsp_proc_done (struct snd_cs46xx *chip);
+#else
+#define cs46xx_dsp_proc_init(card, chip)
+#define cs46xx_dsp_proc_done(chip)
+#endif
 int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip);
 int snd_cs46xx_download (struct snd_cs46xx *chip, u32 *src, unsigned long offset,
                         unsigned long len);
@@ -106,9 +111,14 @@ int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip);
 int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data);
 struct dsp_scb_descriptor * cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name,
                                                   u32 * scb_data, u32 dest);
+#ifdef CONFIG_PROC_FS
 void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb);
 void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
                                        struct dsp_scb_descriptor * scb);
+#else
+#define cs46xx_dsp_proc_free_scb_desc(scb)
+#define cs46xx_dsp_proc_register_scb_desc(chip, scb)
+#endif
 struct dsp_scb_descriptor * cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip);
 struct dsp_scb_descriptor *
 cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip,
index ac98917a1475e28bc310708033f104514b531e95..445a448949e7386fa5553ebdde137433318fc15f 100644 (file)
@@ -439,6 +439,7 @@ cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symb
 }
 
 
+#ifdef CONFIG_PROC_FS
 static struct dsp_symbol_entry *
 cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol_type)
 {
@@ -912,6 +913,7 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
 
        return 0;
 }
+#endif /* CONFIG_PROC_FS */
 
 static int debug_tree;
 static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data,
index 6e865005b2692111c55e6ce79faffa4a58065768..509aa2b63331082b7ea2d956e782e802eefb3be8 100644 (file)
@@ -64,6 +64,7 @@ static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * s
 
 }
 
+#ifdef CONFIG_PROC_FS
 static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
                                           struct snd_info_buffer *buffer)
 {
@@ -106,6 +107,7 @@ static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
        snd_iprintf(buffer,"index [%d] ref_count [%d]\n",scb->index,scb->ref_count);  
        up(&chip->spos_mutex);
 }
+#endif
 
 static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
 {
@@ -220,6 +222,7 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor *
 }
 
 
+#ifdef CONFIG_PROC_FS
 void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb)
 {
        if (scb->proc_info) {
@@ -275,6 +278,7 @@ out:
                scb->proc_info = entry;
        }
 }
+#endif /* CONFIG_PROC_FS */
 
 static struct dsp_scb_descriptor * 
 _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest,
index cc36b748d9a5984081dbfcf8162369ef0f26bb43..175f8aac8de57ff1e01450f7ca52dee7e64d1aad 100644 (file)
@@ -1076,7 +1076,9 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, emu, &ops)) < 0)
                goto error;
 
+#ifdef CONFIG_PROC_FS
        snd_emu10k1_proc_init(emu);
+#endif
 
        snd_card_set_dev(card, &pci->dev);
        *remu = emu;
index b88137f91655ff88fe0a67c7ad6424005528d241..90f1c52703a1d9307f12ea460dd89a208c7034a2 100644 (file)
@@ -32,6 +32,7 @@
 #include <sound/emu10k1.h>
 #include "p16v.h"
 
+#ifdef CONFIG_PROC_FS
 static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
                                          struct snd_info_buffer *buffer,
                                          char *title,
@@ -620,3 +621,4 @@ int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu)
        }
        return 0;
 }
+#endif /* CONFIG_PROC_FS */
index 5bbc8a04753971a3ae975aa94ddeb0ad134f0fb8..d3a4e5e8e0446d62abe2fa80ae4bf3bc47be6314 100644 (file)
@@ -2579,6 +2579,7 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
        printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97_bus->clock);
 }
 
+#ifdef CONFIG_PROC_FS
 static void snd_intel8x0_proc_read(struct snd_info_entry * entry,
                                   struct snd_info_buffer *buffer)
 {
@@ -2612,6 +2613,9 @@ static void __devinit snd_intel8x0_proc_init(struct intel8x0 * chip)
        if (! snd_card_proc_new(chip->card, "intel8x0", &entry))
                snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0_proc_read);
 }
+#else
+#define snd_intel8x0_proc_init(x)
+#endif
 
 static int snd_intel8x0_dev_free(struct snd_device *device)
 {
index 466170e12167082a0011dee676be9ca3e2fbfb86..47e26aaa9ad7d2ae7a09ec1553725a351e636dbf 100644 (file)
@@ -1066,6 +1066,7 @@ static int intel8x0m_resume(struct pci_dev *pci)
 }
 #endif /* CONFIG_PM */
 
+#ifdef CONFIG_PROC_FS
 static void snd_intel8x0m_proc_read(struct snd_info_entry * entry,
                                   struct snd_info_buffer *buffer)
 {
@@ -1093,6 +1094,10 @@ static void __devinit snd_intel8x0m_proc_init(struct intel8x0m * chip)
        if (! snd_card_proc_new(chip->card, "intel8x0m", &entry))
                snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0m_proc_read);
 }
+#else /* !CONFIG_PROC_FS */
+#define snd_intel8x0m_proc_init(chip)
+#endif /* CONFIG_PROC_FS */
+
 
 static int snd_intel8x0_dev_free(struct snd_device *device)
 {