Commit adf1b3d2 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] Optimize for config without PROC_FS (pci drivers)



Optimize the code when compiled without CONFIG_PROC_FS for some pci drivers.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8cb7b63f
Loading
Loading
Loading
Loading
+2 −36
Original line number Diff line number Diff line
@@ -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;
+0 −1
Original line number Diff line number Diff line
@@ -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);
+36 −0
Original line number Diff line number Diff line
@@ -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];
+7 −1
Original line number Diff line number Diff line
@@ -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
+4 −1
Original line number Diff line number Diff line
@@ -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


/*
Loading