diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 08166bf048ec51..72b170640e162d 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -222,7 +222,7 @@ config SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH endif ## SND_SOC_INTEL_SKYLAKE -if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_APOLLOLAKE +if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_APOLLOLAKE && SND_SOC_SOF_HDA_LINK config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH tristate "Broxton with DA7219 and MAX98357A in I2S Mode" @@ -251,6 +251,10 @@ config SND_SOC_INTEL_BXT_RT298_MACH Say Y or m if you have such a device. This is a recommended option. If unsure select "N". +endif + +if SND_SOC_SOF_APOLLOLAKE + config SND_SOC_INTEL_BXT_PCM512x_MACH tristate "Broxton with TI PCM512x codec" depends on MFD_INTEL_LPSS && I2C && ACPI @@ -271,6 +275,10 @@ config SND_SOC_INTEL_BXT_WM8804_MACH Say Y or m if you have such a device. This is a recommended option. If unsure select "N". +endif + +if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_APOLLOLAKE + config SND_SOC_INTEL_BXT_TDF8532_MACH tristate "ASoC Audio driver for BXT with TDF8532 in I2S mode" depends on X86 && ACPI && I2C @@ -341,7 +349,7 @@ config SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH endif ## SND_SOC_INTEL_SKYLAKE -if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_HDA +if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_HDA_AUDIO_CODEC config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH tristate "SKL/KBL/BXT/APL with HDA Codecs" @@ -355,7 +363,7 @@ config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH endif ## SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_HDA -if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_GEMINILAKE +if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_GEMINILAKE && SND_SOC_SOF_HDA_LINK config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH tristate "GLK with RT5682 and MAX98357A in I2S Mode" @@ -373,7 +381,7 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH endif ## SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_GEMINILAKE -if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_CANNONLAKE +if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_CANNONLAKE && SND_SOC_SOF_HDA_LINK config SND_SOC_INTEL_CNL_RT274_MACH tristate "Cannonlake with RT274 I2S mode" diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index d41d60b037426e..87e4eb507abdaf 100644 --- a/sound/soc/sof/intel/Kconfig +++ b/sound/soc/sof/intel/Kconfig @@ -1,14 +1,3 @@ -config SND_SOC_SOF_INTEL - tristate "SOF support for Intel audio DSPs" - depends on SND_SOC_SOF - depends on SND_DMA_SGBUF - select SND_SOC_INTEL_MACH - select SND_SOC_SOF_XTENSA - help - This adds support for Sound Open Firmware for Intel(R) platforms. - Say Y if you have such a device. - If unsure select "N". - config SND_SOC_SOF_SPIDSP tristate "SOF support over the SPI bus" depends on SND_SOC_SOF @@ -20,6 +9,17 @@ config SND_SOC_SOF_SPIDSP Say Y if you have such a device. If unsure select "N". +config SND_SOC_SOF_INTEL + tristate "SOF support for Intel audio DSPs" + depends on SND_SOC_SOF + depends on SND_DMA_SGBUF + select SND_SOC_INTEL_MACH + select SND_SOC_SOF_XTENSA + help + This adds support for Sound Open Firmware for Intel(R) platforms. + Say Y if you have such a device. + If unsure select "N". + if SND_SOC_SOF_INTEL config SND_SOC_SOF_BAYTRAIL @@ -111,17 +111,37 @@ config SND_SOC_SOF_HDA_COMMON tristate select SND_SOC_SOF_PCI select SND_SOC_ACPI_INTEL_MATCH + select SND_SOC_SOF_HDA_LINK_BASELINE -config SND_SOC_SOF_HDA - tristate "SOF support for HDA Links(HDA/HDMI)" - depends on SND_SOC_SOF_HDA_COMMON - select SND_HDA_EXT_CORE - select SND_SOC_HDAC_HDA - select SND_SOC_HDAC_HDMI +if SND_SOC_SOF_HDA_COMMON + +config SND_SOC_SOF_HDA_LINK + bool "SOF support for HDA Links(HDA/HDMI)" help This adds support for HDA links(HDA/HDMI) with Sound Open Firmware for Intel(R) platforms. Say Y if you want to enble HDA links with SOF. If unsure select "N". +if SND_SOC_SOF_HDA_LINK +config SND_SOC_SOF_HDA_AUDIO_CODEC + bool "SOF support for HDAudio codecs" + help + This adds support for HDAudio codecs with Sound Open Firmware + for Intel(R) platforms. + Say Y if you want to enble HDAudio codecs with SOF. + If unsure select "N". +endif ## SND_SOC_SOF_HDA_LINK + +endif ## SND_SOC_SOF_HDA_COMMON + +config SND_SOC_SOF_HDA_LINK_BASELINE + tristate + select SND_SOC_SOF_HDA if SND_SOC_SOF_HDA_LINK + +config SND_SOC_SOF_HDA + tristate + select SND_HDA_EXT_CORE if SND_SOC_SOF_HDA_LINK + select SND_SOC_HDAC_HDA if SND_SOC_SOF_HDA_AUDIO_CODEC + endif ## SND_SOC_SOF_INTEL diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index cc4a537d0e8a6f..9040293c38f018 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -23,13 +23,15 @@ #include #include #include - +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) #include "../../codecs/hdac_hda.h" +#endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */ #include "../sof-priv.h" #include "../ops.h" #include "hda.h" +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) #define IDISP_VID_INTEL 0x80860000 /* load the legacy HDA codec driver */ @@ -47,12 +49,16 @@ static void hda_codec_load_module(struct hda_codec *codec) static void hda_codec_load_module(struct hda_codec *codec) {} #endif +#endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */ + /* probe individual codec */ static int hda_codec_probe(struct snd_sof_dev *sdev, int address) { struct hda_bus *hbus = sof_to_hbus(sdev); struct hdac_device *hdev; +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) struct hdac_hda_priv *hda_priv; +#endif u32 hda_cmd = (address << 28) | (AC_NODE_ROOT << 20) | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; u32 resp = -1; @@ -67,6 +73,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address) dev_dbg(sdev->dev, "HDA codec #%d probed OK: response: %x\n", address, resp); +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) hda_priv = devm_kzalloc(&hbus->pci->dev, sizeof(*hda_priv), GFP_KERNEL); if (!hda_priv) @@ -86,6 +93,16 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address) } return 0; +#else + hdev = devm_kzalloc(&hbus->pci->dev, sizeof(*hdev), + GFP_KERNEL); + if (!hdev) + return -ENOMEM; + + ret = snd_hdac_ext_bus_device_init(&hbus->core, address, hdev); + + return ret; +#endif } /* Codec initialization */ diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index e0ba5c75f3a8f0..d90134cf3b36e8 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -36,7 +36,9 @@ #include "../sof-priv.h" #include "../ops.h" #include "hda.h" +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) #include "../../codecs/hdac_hda.h" +#endif /* platform specific devices */ #include "shim.h" @@ -397,7 +399,7 @@ static int hda_init(struct snd_sof_dev *sdev) bus = sof_to_bus(sdev); /* HDA bus init */ -#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDA) +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) ext_ops = snd_soc_hdac_hda_get_ops(); #endif sof_hda_bus_init(bus, &pci->dev, ext_ops);