From 0c9b57cdacfce10d5e967677a10a010e3f7e4554 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 1 Mar 2019 12:33:45 -0600 Subject: [PATCH 1/2] ASoC: SOF: Intel: make HDA link and NOCODEC mutually incompatible If the HDAudio link is configured but not used, there are multiple issues with syspend/resume. Just make the two options incompatible and move on. Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index 50cb06b160a87d..267b5606c6baa1 100644 --- a/sound/soc/sof/intel/Kconfig +++ b/sound/soc/sof/intel/Kconfig @@ -215,6 +215,7 @@ if SND_SOC_SOF_HDA_COMMON config SND_SOC_SOF_HDA_LINK bool "SOF support for HDA Links(HDA/HDMI)" + depends on SND_SOC_SOF_NOCODEC=n select SND_SOC_SOF_PROBE_WORK_QUEUE help This adds support for HDA links(HDA/HDMI) with Sound Open Firmware From c148f0ce9b5dceb9c230911bfe932871b95cc290 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 1 Mar 2019 12:35:29 -0600 Subject: [PATCH 2/2] ASoC: SOF: Intel: remove support for NOCODEC when HDA link is enabled since we've made the two options mutually incompatible in Kconfig, there is no point in maintaining the code that falls back to nocodec if there is no external HDAudio codec detected. Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/hda.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 19d2c18070fa19..a57374be06e6ff 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -297,35 +297,27 @@ static int hda_init_caps(struct snd_sof_dev *sdev) * If no machine driver is found, then: * * hda machine driver is used if : - * 1. there are HDMI codec and one external HDAudio codec - * 2. only HDMI codec and NOCODEC is not enabled - * - * nocodec machine driver would be used if: - * 1. only HDMI codec and but NOCODEC is enabled - * 2. there is no codec found + * 1. there is one HDMI codec and one external HDAudio codec + * 2. only HDMI codec */ if (!pdata->machine && codec_num <= 2 && HDA_IDISP_CODEC(bus->codec_mask)) { - if (codec_num == 2 || - !IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC)) { - hda_mach = snd_soc_acpi_intel_hda_machines; - pdata->machine = hda_mach; + hda_mach = snd_soc_acpi_intel_hda_machines; + pdata->machine = hda_mach; - /* topology: use the info from hda_machines */ - pdata->tplg_filename = - hda_mach->sof_tplg_filename; + /* topology: use the info from hda_machines */ + pdata->tplg_filename = + hda_mach->sof_tplg_filename; - /* firmware: pick the first in machine list */ - mach = pdata->desc->machines; - pdata->fw_filename = mach->sof_fw_filename; + /* firmware: pick the first in machine list */ + mach = pdata->desc->machines; + pdata->fw_filename = mach->sof_fw_filename; - dev_info(bus->dev, "using HDA machine driver %s now\n", - hda_mach->drv_name); - } + dev_info(bus->dev, "using HDA machine driver %s now\n", + hda_mach->drv_name); /* fixup topology file for HDMI only platforms */ - if (codec_num == 1 && - !IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC)) { + if (codec_num == 1) { /* use local variable for readability */ tplg_filename = pdata->tplg_filename; tplg_filename = fixup_tplg_name(sdev, tplg_filename);