From 456b2f56e71a1b243afe739614d52c9a6d39cd75 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Sun, 18 Nov 2018 17:31:11 -0600 Subject: [PATCH 1/3] ASoC: SOF: intel: move SPI up This shouldn't be here anyways Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/Kconfig | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index d41d60b037426e..50e03bfa8648d9 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 From 9e9282714c12c5611c62d11d6fca9a2f579c01f3 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Sun, 18 Nov 2018 18:26:34 -0600 Subject: [PATCH 2/3] ASoC: SOF: Intel: make SOF_SOC_HDA optional, fix Kconfig Make sure we can build without any code related to HDaudio links and codecs. Also make sure that when we do, the same option is used for SND_SOC_SOF_HDA and for HDAC_HDA due to code dependencies. Compiled-tested only for now. Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/Kconfig | 32 ++++++++++++++++++++++++++------ sound/soc/sof/intel/hda-codec.c | 19 ++++++++++++++++++- sound/soc/sof/intel/hda.c | 4 +++- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index 50e03bfa8648d9..87e4eb507abdaf 100644 --- a/sound/soc/sof/intel/Kconfig +++ b/sound/soc/sof/intel/Kconfig @@ -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); From f21e2f487e1ff95ec3d48ca98e383acd7c667260 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 19 Nov 2018 15:31:15 -0600 Subject: [PATCH 3/3] ASoC: intel: boards: clarify Kconfigs for SOF Only include boards with HDMI support if SOF has enabled HDA_LINK support. Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/Kconfig | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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"