aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index ec4536c8d8d4..dafcf82139e2 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -932,7 +932,7 @@ int snd_hda_bus_new(struct snd_card *card,
932} 932}
933EXPORT_SYMBOL_GPL(snd_hda_bus_new); 933EXPORT_SYMBOL_GPL(snd_hda_bus_new);
934 934
935#ifdef CONFIG_SND_HDA_GENERIC 935#if IS_ENABLED(CONFIG_SND_HDA_GENERIC)
936#define is_generic_config(codec) \ 936#define is_generic_config(codec) \
937 (codec->modelname && !strcmp(codec->modelname, "generic")) 937 (codec->modelname && !strcmp(codec->modelname, "generic"))
938#else 938#else
@@ -1339,23 +1339,15 @@ get_hda_cvt_setup(struct hda_codec *codec, hda_nid_t nid)
1339/* 1339/*
1340 * Dynamic symbol binding for the codec parsers 1340 * Dynamic symbol binding for the codec parsers
1341 */ 1341 */
1342#ifdef MODULE
1343#define load_parser_sym(sym) ((int (*)(struct hda_codec *))symbol_request(sym))
1344#define unload_parser_addr(addr) symbol_put_addr(addr)
1345#else
1346#define load_parser_sym(sym) (sym)
1347#define unload_parser_addr(addr) do {} while (0)
1348#endif
1349 1342
1350#define load_parser(codec, sym) \ 1343#define load_parser(codec, sym) \
1351 ((codec)->parser = load_parser_sym(sym)) 1344 ((codec)->parser = (int (*)(struct hda_codec *))symbol_request(sym))
1352 1345
1353static void unload_parser(struct hda_codec *codec) 1346static void unload_parser(struct hda_codec *codec)
1354{ 1347{
1355 if (codec->parser) { 1348 if (codec->parser)
1356 unload_parser_addr(codec->parser); 1349 symbol_put_addr(codec->parser);
1357 codec->parser = NULL; 1350 codec->parser = NULL;
1358 }
1359} 1351}
1360 1352
1361/* 1353/*
@@ -1570,7 +1562,7 @@ int snd_hda_codec_update_widgets(struct hda_codec *codec)
1570EXPORT_SYMBOL_GPL(snd_hda_codec_update_widgets); 1562EXPORT_SYMBOL_GPL(snd_hda_codec_update_widgets);
1571 1563
1572 1564
1573#ifdef CONFIG_SND_HDA_CODEC_HDMI 1565#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI)
1574/* if all audio out widgets are digital, let's assume the codec as a HDMI/DP */ 1566/* if all audio out widgets are digital, let's assume the codec as a HDMI/DP */
1575static bool is_likely_hdmi_codec(struct hda_codec *codec) 1567static bool is_likely_hdmi_codec(struct hda_codec *codec)
1576{ 1568{
@@ -1620,12 +1612,20 @@ int snd_hda_codec_configure(struct hda_codec *codec)
1620 patch = codec->preset->patch; 1612 patch = codec->preset->patch;
1621 if (!patch) { 1613 if (!patch) {
1622 unload_parser(codec); /* to be sure */ 1614 unload_parser(codec); /* to be sure */
1623 if (is_likely_hdmi_codec(codec)) 1615 if (is_likely_hdmi_codec(codec)) {
1616#if IS_MODULE(CONFIG_SND_HDA_CODEC_HDMI)
1624 patch = load_parser(codec, snd_hda_parse_hdmi_codec); 1617 patch = load_parser(codec, snd_hda_parse_hdmi_codec);
1625#ifdef CONFIG_SND_HDA_GENERIC 1618#elif IS_BUILTIN(CONFIG_SND_HDA_CODEC_HDMI)
1626 if (!patch) 1619 patch = snd_hda_parse_hdmi_codec;
1620#endif
1621 }
1622 if (!patch) {
1623#if IS_MODULE(CONFIG_SND_HDA_GENERIC)
1627 patch = load_parser(codec, snd_hda_parse_generic_codec); 1624 patch = load_parser(codec, snd_hda_parse_generic_codec);
1625#elif IS_BUILTIN(CONFIG_SND_HDA_GENERIC)
1626 patch = snd_hda_parse_generic_codec;
1628#endif 1627#endif
1628 }
1629 if (!patch) { 1629 if (!patch) {
1630 printk(KERN_ERR "hda-codec: No codec parser is available\n"); 1630 printk(KERN_ERR "hda-codec: No codec parser is available\n");
1631 return -ENODEV; 1631 return -ENODEV;