ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate
PATCH 1/2 ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate
So far, CONFIG_SND_HDA_CODEC_* kconfigs have been booleans due to historical reasons. The major reason was that the automatic codec driver probing wouldn't work if user sets a codec driver as a module while the controller driver as a built-in. And, another reason was to avoid exporting symbols of the helper codes when all drivers are built in.
But, this sort of "kindness" rather confuses people in the end, especially makes the config refinement via localmodconfig unhappy. Also, a codec module would still work if you re-bind the controller driver via sysfs (although it's no automatic loading), so there might be a slight use case.
That said, better to let people fallen into a pitfall than being too smart and restrict something. Let's make things straightforward: now all CONFIG_SND_HDA_CODEC_* become tristate, and all symbols exported unconditionally.
--- sound/pci/hda/Kconfig | 115 ++++++++++------------------------------------ sound/pci/hda/Makefile | 50 ++++++-------------- sound/pci/hda/hda_codec.h | 13 ------ 3 files changed, 37 insertions(+), 141 deletions(-)
sound/pci/hda/Kconfig +24 -91
@@ -87,126 +87,72 @@ config SND_HDA_PATCH_LOADER This option turns on hwdep and reconfig features automatically. config SND_HDA_CODEC_REALTEK - bool "Build Realtek HD-audio codec support" - default y + tristate "Build Realtek HD-audio codec support" select SND_HDA_GENERIC help - Say Y here to include Realtek HD-audio codec support in + Say Y or M here to include Realtek HD-audio codec support in snd-hda-intel driver, such as ALC880. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-realtek. - This module is automatically loaded at probing. - config SND_HDA_CODEC_ANALOG - bool "Build Analog Device HD-audio codec support" - default y + tristate "Build Analog Device HD-audio codec support" select SND_HDA_GENERIC help - Say Y here to include Analog Device HD-audio codec support in + Say Y or M here to include Analog Device HD-audio codec support in snd-hda-intel driver, such as AD1986A. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-analog. - This module is automatically loaded at probing. - config SND_HDA_CODEC_SIGMATEL - bool "Build IDT/Sigmatel HD-audio codec support" - default y + tristate "Build IDT/Sigmatel HD-audio codec support" select SND_HDA_GENERIC help - Say Y here to include IDT (Sigmatel) HD-audio codec support in + Say Y or M here to include IDT (Sigmatel) HD-audio codec support in snd-hda-intel driver, such as STAC9200. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-idt. - This module is automatically loaded at probing. - config SND_HDA_CODEC_VIA - bool "Build VIA HD-audio codec support" - default y + tristate "Build VIA HD-audio codec support" select SND_HDA_GENERIC help - Say Y here to include VIA HD-audio codec support in + Say Y or M here to include VIA HD-audio codec support in snd-hda-intel driver, such as VT1708. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-via. - This module is automatically loaded at probing. - config SND_HDA_CODEC_HDMI - bool "Build HDMI/DisplayPort HD-audio codec support" - default y + tristate "Build HDMI/DisplayPort HD-audio codec support" help - Say Y here to include HDMI and DisplayPort HD-audio codec + Say Y or M here to include HDMI and DisplayPort HD-audio codec support in snd-hda-intel driver. This includes all AMD/ATI, Intel and Nvidia HDMI/DisplayPort codecs. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-hdmi. - This module is automatically loaded at probing. - config SND_HDA_I915 bool default y depends on DRM_I915 config SND_HDA_CODEC_CIRRUS - bool "Build Cirrus Logic codec support" - default y + tristate "Build Cirrus Logic codec support" select SND_HDA_GENERIC help - Say Y here to include Cirrus Logic codec support in + Say Y or M here to include Cirrus Logic codec support in snd-hda-intel driver, such as CS4206. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-cirrus. - This module is automatically loaded at probing. - config SND_HDA_CODEC_CONEXANT - bool "Build Conexant HD-audio codec support" - default y + tristate "Build Conexant HD-audio codec support" select SND_HDA_GENERIC help - Say Y here to include Conexant HD-audio codec support in + Say Y or M here to include Conexant HD-audio codec support in snd-hda-intel driver, such as CX20549. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-conexant. - This module is automatically loaded at probing. - config SND_HDA_CODEC_CA0110 - bool "Build Creative CA0110-IBG codec support" - default y + tristate "Build Creative CA0110-IBG codec support" select SND_HDA_GENERIC help - Say Y here to include Creative CA0110-IBG codec support in + Say Y or M here to include Creative CA0110-IBG codec support in snd-hda-intel driver, found on some Creative X-Fi cards. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-ca0110. - This module is automatically loaded at probing. - config SND_HDA_CODEC_CA0132 - bool "Build Creative CA0132 codec support" - default y + tristate "Build Creative CA0132 codec support" help - Say Y here to include Creative CA0132 codec support in + Say Y or M here to include Creative CA0132 codec support in snd-hda-intel driver. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-ca0132. - This module is automatically loaded at probing. - config SND_HDA_CODEC_CA0132_DSP bool "Support new DSP code for CA0132 codec" depends on SND_HDA_CODEC_CA0132
@@ -220,35 +166,22 @@ config SND_HDA_CODEC_CA0132_DSP (ctefx.bin). config SND_HDA_CODEC_CMEDIA - bool "Build C-Media HD-audio codec support" - default y + tristate "Build C-Media HD-audio codec support" select SND_HDA_GENERIC help - Say Y here to include C-Media HD-audio codec support in + Say Y or M here to include C-Media HD-audio codec support in snd-hda-intel driver, such as CMI9880. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-cmedia. - This module is automatically loaded at probing. - config SND_HDA_CODEC_SI3054 - bool "Build Silicon Labs 3054 HD-modem codec support" - default y + tristate "Build Silicon Labs 3054 HD-modem codec support" help - Say Y here to include Silicon Labs 3054 HD-modem codec + Say Y or M here to include Silicon Labs 3054 HD-modem codec (and compatibles) support in snd-hda-intel driver. - When the HD-audio driver is built as a module, the codec - support code is also built as another module, - snd-hda-codec-si3054. - This module is automatically loaded at probing. - config SND_HDA_GENERIC - bool "Enable generic HD-audio codec parser" - default y + tristate "Enable generic HD-audio codec parser" help - Say Y here to enable the generic HD-audio codec parser + Say Y or M here to enable the generic HD-audio codec parser in snd-hda-intel driver. config SND_HDA_POWER_SAVE_DEFAULT
sound/pci/hda/Makefile +13 -37
56 lines not on this page · raw message
sound/pci/hda/hda_codec.h +0 -13
@@ -681,19 +681,6 @@ snd_hda_codec_load_dsp_cleanup(struct hda_codec *codec, struct snd_dma_buffer *dmab) {}#endif -/* -* Codec modularization -*/ - -/* Export symbols only for communication with codec drivers; -* When built in kernel, all HD-audio drivers are supposed to be statically -* linked to the kernel. Thus, the symbols don't have to (or shouldn't) be -* exported unless it's built as a module. -*/ -#ifdef MODULE #define EXPORT_SYMBOL_HDA (sym) EXPORT_SYMBOL_GPL(sym) -#else -#define EXPORT_SYMBOL_HDA (sym) -#endif #endif /* __SOUND_HDA_CODEC_H */
Signature · 1 line
1.8.5
PATCH 2/2 ALSA: hda - Kill EXPORT_SYMBOL_HDA()
Replace all with the standard EXPORT_SYMBOL_GPL().
--- sound/pci/hda/hda_auto_parser.c | 18 ++-- sound/pci/hda/hda_beep.c | 10 +- sound/pci/hda/hda_codec.c | 214 ++++++++++++++++++++-------------------- sound/pci/hda/hda_generic.c | 44 ++++----- sound/pci/hda/hda_hwdep.c | 8 +- sound/pci/hda/hda_jack.c | 30 +++--- sound/pci/hda/patch_hdmi.c | 2 +- 7 files changed, 163 insertions(+), 163 deletions(-)
sound/pci/hda/hda_auto_parser.c +9 -9
@@ -414,7 +414,7 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,return 0 ; } -EXPORT_SYMBOL_HDA (snd_hda_parse_pin_defcfg); +EXPORT_SYMBOL_GPL (snd_hda_parse_pin_defcfg);int snd_hda_get_input_pin_attr (unsigned int def_conf) {
@@ -435,7 +435,7 @@ int snd_hda_get_input_pin_attr(unsigned int def_conf)return INPUT_PIN_ATTR_FRONT ;return INPUT_PIN_ATTR_NORMAL ; } -EXPORT_SYMBOL_HDA (snd_hda_get_input_pin_attr); +EXPORT_SYMBOL_GPL (snd_hda_get_input_pin_attr);/** * hda_get_input_pin_label - Give a label for the given input pin
@@ -547,7 +547,7 @@ const char *hda_get_autocfg_input_label(struct hda_codec *codec, cfg->inputs[input].pin, has_multiple_pins); } -EXPORT_SYMBOL_HDA (hda_get_autocfg_input_label); +EXPORT_SYMBOL_GPL (hda_get_autocfg_input_label);/* return the position of NID in the list, or -1 if not found */ static int find_idx_in_nid_list (hda_nid_t nid,const hda_nid_t *list,int nums)
@@ -721,7 +721,7 @@ int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid,strlcpy (label, name, maxlen);return 1 ; } -EXPORT_SYMBOL_HDA (snd_hda_get_pin_label); +EXPORT_SYMBOL_GPL (snd_hda_get_pin_label);int snd_hda_add_verbs (struct hda_codec *codec,const struct hda_verb *list)
@@ -733,7 +733,7 @@ int snd_hda_add_verbs(struct hda_codec *codec, *v = list;return 0 ; } -EXPORT_SYMBOL_HDA (snd_hda_add_verbs); +EXPORT_SYMBOL_GPL (snd_hda_add_verbs);void snd_hda_apply_verbs (struct hda_codec *codec) {
@@ -743,7 +743,7 @@ void snd_hda_apply_verbs(struct hda_codec *codec)snd_hda_sequence_write (codec, *v); } } -EXPORT_SYMBOL_HDA (snd_hda_apply_verbs); +EXPORT_SYMBOL_GPL (snd_hda_apply_verbs);void snd_hda_apply_pincfgs (struct hda_codec *codec,const struct hda_pintbl *cfg)
@@ -751,7 +751,7 @@ void snd_hda_apply_pincfgs(struct hda_codec *codec,for (; cfg->nid; cfg++)snd_hda_codec_set_pincfg (codec, cfg->nid, cfg->val); } -EXPORT_SYMBOL_HDA (snd_hda_apply_pincfgs); +EXPORT_SYMBOL_GPL (snd_hda_apply_pincfgs);static void set_pin_targets (struct hda_codec *codec,const struct hda_pintbl *cfg)
@@ -822,7 +822,7 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action)if (codec->fixup_list)apply_fixup (codec, codec->fixup_id, action,0 ); } -EXPORT_SYMBOL_HDA (snd_hda_apply_fixup); +EXPORT_SYMBOL_GPL (snd_hda_apply_fixup); void snd_hda_pick_fixup(struct hda_codec *codec, const struct hda_model_fixup *models,
@@ -880,4 +880,4 @@ void snd_hda_pick_fixup(struct hda_codec *codec, codec->fixup_name = name; } } -EXPORT_SYMBOL_HDA (snd_hda_pick_fixup); +EXPORT_SYMBOL_GPL (snd_hda_pick_fixup);
sound/pci/hda/hda_beep.c +5 -5
@@ -194,7 +194,7 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) }return 0 ; } -EXPORT_SYMBOL_HDA (snd_hda_enable_beep_device); +EXPORT_SYMBOL_GPL (snd_hda_enable_beep_device);int snd_hda_attach_beep_device (struct hda_codec *codec,int nid) {
@@ -231,7 +231,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)return 0 ; } -EXPORT_SYMBOL_HDA (snd_hda_attach_beep_device); +EXPORT_SYMBOL_GPL (snd_hda_attach_beep_device);void snd_hda_detach_beep_device (struct hda_codec *codec) {
@@ -243,7 +243,7 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)kfree (beep); } } -EXPORT_SYMBOL_HDA (snd_hda_detach_beep_device); +EXPORT_SYMBOL_GPL (snd_hda_detach_beep_device);static bool ctl_has_mute (struct snd_kcontrol *kcontrol) {
@@ -265,7 +265,7 @@ int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol, }return snd_hda_mixer_amp_switch_get (kcontrol, ucontrol); } -EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_switch_get_beep); +EXPORT_SYMBOL_GPL (snd_hda_mixer_amp_switch_get_beep);int snd_hda_mixer_amp_switch_put_beep (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *ucontrol)
@@ -288,4 +288,4 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol,return 0 ;return snd_hda_mixer_amp_switch_put (kcontrol, ucontrol); } -EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_switch_put_beep); +EXPORT_SYMBOL_GPL (snd_hda_mixer_amp_switch_put_beep);
sound/pci/hda/hda_codec.c +107 -107
856 lines not on this page · raw message
sound/pci/hda/hda_generic.c +22 -22
176 lines not on this page · raw message
sound/pci/hda/hda_hwdep.c +4 -4
@@ -616,7 +616,7 @@ const char *snd_hda_get_hint(struct hda_codec *codec, const char *key)struct hda_hint *hint =get_hint (codec, key);return hint ? hint->val :NULL ; } -EXPORT_SYMBOL_HDA (snd_hda_get_hint); +EXPORT_SYMBOL_GPL (snd_hda_get_hint);int snd_hda_get_bool_hint (struct hda_codec *codec,const char *key) {
@@ -642,7 +642,7 @@ int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key)mutex_unlock (&codec->user_mutex);return ret; } -EXPORT_SYMBOL_HDA (snd_hda_get_bool_hint); +EXPORT_SYMBOL_GPL (snd_hda_get_bool_hint);int snd_hda_get_int_hint (struct hda_codec *codec,const char *key,int *valp) {
@@ -663,7 +663,7 @@ int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp)mutex_unlock (&codec->user_mutex); return ret; } -EXPORT_SYMBOL_HDA (snd_hda_get_int_hint); +EXPORT_SYMBOL_GPL (snd_hda_get_int_hint);#endif /* CONFIG_SND_HDA_RECONFIG */ #ifdef CONFIG_SND_HDA_PATCH_LOADER
@@ -851,5 +851,5 @@ int snd_hda_load_patch(struct hda_bus *bus, size_t fw_size, const void *fw_buf) }return 0 ; } -EXPORT_SYMBOL_HDA (snd_hda_load_patch); +EXPORT_SYMBOL_GPL (snd_hda_load_patch);#endif /* CONFIG_SND_HDA_PATCH_LOADER */
sound/pci/hda/hda_jack.c +15 -15
@@ -34,7 +34,7 @@ bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid)return false;return true; } -EXPORT_SYMBOL_HDA (is_jack_detectable); +EXPORT_SYMBOL_GPL (is_jack_detectable);/* execute pin sense measurement */ static u32 read_pin_sense (struct hda_codec *codec,hda_nid_t nid)
@@ -71,7 +71,7 @@ snd_hda_jack_tbl_get(struct hda_codec *codec, hda_nid_t nid)return jack;return NULL ; } -EXPORT_SYMBOL_HDA (snd_hda_jack_tbl_get); +EXPORT_SYMBOL_GPL (snd_hda_jack_tbl_get);/** * snd_hda_jack_tbl_get_from_tag - query the jack-table entry for the given tag
@@ -89,7 +89,7 @@ snd_hda_jack_tbl_get_from_tag(struct hda_codec *codec, unsigned char tag)return jack;return NULL ; } -EXPORT_SYMBOL_HDA (snd_hda_jack_tbl_get_from_tag); +EXPORT_SYMBOL_GPL (snd_hda_jack_tbl_get_from_tag);/** * snd_hda_jack_tbl_new - create a jack-table entry for the given NID
@@ -108,7 +108,7 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid) jack->tag = codec->jacktbl.used;return jack; } -EXPORT_SYMBOL_HDA (snd_hda_jack_tbl_new); +EXPORT_SYMBOL_GPL (snd_hda_jack_tbl_new);void snd_hda_jack_tbl_clear (struct hda_codec *codec) {
@@ -172,7 +172,7 @@ void snd_hda_jack_set_dirty_all(struct hda_codec *codec)if (jack->nid) jack->jack_dirty =1 ; } -EXPORT_SYMBOL_HDA (snd_hda_jack_set_dirty_all); +EXPORT_SYMBOL_GPL (snd_hda_jack_set_dirty_all);/** * snd_hda_pin_sense - execute pin sense measurement
@@ -191,7 +191,7 @@ u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) }return read_pin_sense (codec, nid); } -EXPORT_SYMBOL_HDA (snd_hda_pin_sense); +EXPORT_SYMBOL_GPL (snd_hda_pin_sense);/** * snd_hda_jack_detect_state - query pin Presence Detect status
@@ -211,7 +211,7 @@ int snd_hda_jack_detect_state(struct hda_codec *codec, hda_nid_t nid)else return HDA_JACK_NOT_PRESENT ; } -EXPORT_SYMBOL_HDA (snd_hda_jack_detect_state); +EXPORT_SYMBOL_GPL (snd_hda_jack_detect_state);/** * snd_hda_jack_detect_enable - enable the jack-detection
@@ -236,14 +236,14 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,AC_VERB_SET_UNSOLICITED_ENABLE , AC_USRSP_EN | jack->tag); } -EXPORT_SYMBOL_HDA (snd_hda_jack_detect_enable_callback); +EXPORT_SYMBOL_GPL (snd_hda_jack_detect_enable_callback);int snd_hda_jack_detect_enable (struct hda_codec *codec,hda_nid_t nid,unsigned char action) {return snd_hda_jack_detect_enable_callback (codec, nid, action,NULL ); } -EXPORT_SYMBOL_HDA (snd_hda_jack_detect_enable); +EXPORT_SYMBOL_GPL (snd_hda_jack_detect_enable);/** * snd_hda_jack_set_gating_jack - Set gating jack.
@@ -264,7 +264,7 @@ int snd_hda_jack_set_gating_jack(struct hda_codec *codec, hda_nid_t gated_nid,return 0 ; } -EXPORT_SYMBOL_HDA (snd_hda_jack_set_gating_jack); +EXPORT_SYMBOL_GPL (snd_hda_jack_set_gating_jack);/** * snd_hda_jack_report_sync - sync the states of all jacks and report if changed
@@ -297,7 +297,7 @@ void snd_hda_jack_report_sync(struct hda_codec *codec)#endif } } -EXPORT_SYMBOL_HDA (snd_hda_jack_report_sync); +EXPORT_SYMBOL_GPL (snd_hda_jack_report_sync);#ifdef CONFIG_SND_HDA_INPUT_JACK /* guess the jack type from the pin-config */
@@ -377,7 +377,7 @@ int snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid, {return __snd_hda_jack_add_kctl (codec, nid, name, idx, false); } -EXPORT_SYMBOL_HDA (snd_hda_jack_add_kctl); +EXPORT_SYMBOL_GPL (snd_hda_jack_add_kctl);/* get the unique index number for the given kctl name */ static int get_unique_index (struct hda_codec *codec,const char *name,int idx)
@@ -493,7 +493,7 @@ int snd_hda_jack_add_kctls(struct hda_codec *codec,return err;return 0 ; } -EXPORT_SYMBOL_HDA (snd_hda_jack_add_kctls); +EXPORT_SYMBOL_GPL (snd_hda_jack_add_kctls);static void call_jack_callback (struct hda_codec *codec,struct hda_jack_tbl *jack)
@@ -521,7 +521,7 @@ void snd_hda_jack_unsol_event(struct hda_codec *codec, unsigned int res)call_jack_callback (codec, event);snd_hda_jack_report_sync (codec); } -EXPORT_SYMBOL_HDA (snd_hda_jack_unsol_event); +EXPORT_SYMBOL_GPL (snd_hda_jack_unsol_event);void snd_hda_jack_poll_all (struct hda_codec *codec) {
@@ -542,5 +542,5 @@ void snd_hda_jack_poll_all(struct hda_codec *codec)if (changes)snd_hda_jack_report_sync (codec); } -EXPORT_SYMBOL_HDA (snd_hda_jack_poll_all); +EXPORT_SYMBOL_GPL (snd_hda_jack_poll_all);
sound/pci/hda/patch_hdmi.c +1 -1
@@ -3213,7 +3213,7 @@ int snd_hda_parse_hdmi_codec(struct hda_codec *codec) {return patch_generic_hdmi (codec); } -EXPORT_SYMBOL_HDA (snd_hda_parse_hdmi_codec); +EXPORT_SYMBOL_GPL (snd_hda_parse_hdmi_codec);/* * patch entries
Signature · 1 line
1.8.5