From a8a0463c0bbbdcec1399b66fa49dc81547849b14 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 14 Dec 2018 21:49:11 -0600 Subject: [PATCH 1/5] ASoC: SOF: Add missing headers back, fix cross-compilation Missing linux/io.h and linux/modules.h Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/hda-bus.c | 1 + sound/soc/sof/intel/hda-codec.c | 1 + sound/soc/sof/xtensa/core.c | 1 + 3 files changed, 3 insertions(+) diff --git a/sound/soc/sof/intel/hda-bus.c b/sound/soc/sof/intel/hda-bus.c index cadf559f5a82fd..62cc9921bb5597 100644 --- a/sound/soc/sof/intel/hda-bus.c +++ b/sound/soc/sof/intel/hda-bus.c @@ -7,6 +7,7 @@ // // Authors: Keyon Jie +#include #include #include "../sof-priv.h" #include "hda.h" diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index 8d0fe7b7554efc..3cb5dc05e64a43 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -8,6 +8,7 @@ // Authors: Keyon Jie // +#include #include #include #include diff --git a/sound/soc/sof/xtensa/core.c b/sound/soc/sof/xtensa/core.c index 8bc3b782c16e0f..5be713871c6af6 100644 --- a/sound/soc/sof/xtensa/core.c +++ b/sound/soc/sof/xtensa/core.c @@ -8,6 +8,7 @@ // Author: Pan Xiuli // +#include #include #include #include "../sof-priv.h" From f5d2b1eb7642081d9e99890fc608a13355d295cb Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 14 Dec 2018 21:51:22 -0600 Subject: [PATCH 2/5] ASoC: SOF: acpi: fix cross-compilation issues asm/iosf-mbi.h only exists for X86, add dependency TODO: move is_byt_cr() to common helper Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/sof-acpi-dev.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c index 03d45c5ce2224b..f6dda04444663e 100644 --- a/sound/soc/sof/sof-acpi-dev.c +++ b/sound/soc/sof/sof-acpi-dev.c @@ -8,7 +8,6 @@ // Author: Liam Girdwood // -#include #include #include #include @@ -16,6 +15,9 @@ #include #include #include +#ifdef CONFIG_X86 +#include +#endif #include "ops.h" @@ -69,12 +71,13 @@ static struct sof_dev_desc sof_acpi_baytrail_desc = { .nocodec_tplg_filename = "intel/sof-byt-nocodec.tplg" }; +#ifdef CONFIG_X86 /* TODO: move this to common helper */ static int is_byt_cr(struct device *dev) { u32 bios_status; int status; - if (!IS_ENABLED(CONFIG_IOSF_MBI) || !iosf_mbi_available()) { + if (!iosf_mbi_available()) { dev_info(dev, "IOSF_MBI not enabled - can't determine CPU variant\n"); return -EIO; } @@ -100,6 +103,12 @@ static int is_byt_cr(struct device *dev) dev_info(dev, "BYT-CR not detected\n"); return 0; } +#else +static int is_byt_cr(struct device *dev) +{ + return 0; +} +#endif static struct sof_dev_desc sof_acpi_cherrytrail_desc = { .machines = snd_soc_acpi_intel_cherrytrail_machines, From a7ed8ed0fd2ecbe231305dff0bee28434883c5dc Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 14 Dec 2018 21:53:01 -0600 Subject: [PATCH 3/5] ASoC: SOF: pci: add back missing header linux/pci.h is needed Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/sof-pci-dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c index 65dd7be78655b1..c288c49e34b6e9 100644 --- a/sound/soc/sof/sof-pci-dev.c +++ b/sound/soc/sof/sof-pci-dev.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include From 5aa6c2e0298d793c407df304b2b5cac9f93d6fb5 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 14 Dec 2018 15:38:43 -0600 Subject: [PATCH 4/5] ASoC: SOF: fix Kconfig dependencies The existing module dependencies are handled in the wrong way. We need to select first acpi/pci, then platforms and last the core. Doing otherwise would result in broken configurations where acpi/pci stuff is compiled as built-in and platforms or SOF core as a module. Rebuild Kconfig to use 'select' statements in the right order. The platform selections are now exposed with booleans only. The choice of module or built-in can now happen only at the pci/acpi/spi level, the dependencies will be compiled accordingly. As a result, "make menuconfig" does not expose how dependencies are handled. Corner cases: PCI is required for sof-pci-dev, devm_pci_enable is not defined otherwise. ACPI and SOF_INTEL_TOPLEVEL can be enabled for COMPILE_TEST Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/Kconfig | 82 +++++++++++++---- sound/soc/sof/Makefile | 2 +- sound/soc/sof/intel/Kconfig | 170 +++++++++++++++++++++++++++--------- 3 files changed, 194 insertions(+), 60 deletions(-) diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index bd6ca5b0c342f5..e4ed5582217357 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -1,23 +1,61 @@ +config SND_SOC_SOF_TOPLEVEL + bool "Sound Open Firmware Support" + help + This adds support for Sound Open Firmware (SOF). SOF is a free and + generic open source audio DSP firmware for multiple devices. + Say Y if you have such a device that is supported by SOF. + If unsure select "N". + +if SND_SOC_SOF_TOPLEVEL + config SND_SOC_SOF_PCI - tristate + tristate "SOF PCI enumeration support" + depends on PCI + select SND_SOC_SOF_OPTIONS + select SND_SOC_SOF_INTEL_PCI if SND_SOC_SOF_INTEL_TOPLEVEL + help + This adds support for PCI enumeration. This option is + required to enable Intel Skylake+ devices + Say Y if you need this option + If unsure select "N". config SND_SOC_SOF_ACPI - tristate + tristate "SOF ACPI enumeration support" + depends on ACPI || COMPILE_TEST + select SND_SOC_SOF_OPTIONS + select SND_SOC_SOF_INTEL_ACPI if SND_SOC_SOF_INTEL_TOPLEVEL + select IOSF_MBI if X86 + help + This adds support for ACPI enumeration. This option is required + to enable Intel Haswell/Broadwell/Baytrail/Cherrytrail devices + Say Y if you need this option + If unsure select "N". config SND_SOC_SOF_SPI + tristate "SOF SPI support" + select SPI + select SPI_MASTER + select SND_SOC_SOF_OPTIONS + select SND_SOC_SOF_SPIDSP + help + This adds support for Sound Open Firmware over SPI for Device + Tree based systems. + Say Y if you have such a device. + If unsure select "N". + +config SND_SOC_SOF_SPIDSP tristate + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level -config SND_SOC_SOF - tristate "Sound Open Firmware Support" - select SND_SOC_TOPOLOGY - select SND_SOC_COMPRESS if SND_SOC_SOF_COMPRESS=y +config SND_SOC_SOF_OPTIONS + tristate help - This adds support for Sound Open Firmware (SOF). SOF is a free and - generic open source audio DSP firmware for multiple devices. - Say Y if you have such a device that is supported by SOF. - If unsure select "N". + This option is not user-selectable but automagically handled by + 'select' statements at a higher level -if SND_SOC_SOF +if SND_SOC_SOF_OPTIONS config SND_SOC_SOF_COMPRESS bool "SOF ALSA Compressed API support" @@ -38,17 +76,17 @@ config SND_SOC_SOF_NOCODEC config SND_SOC_SOF_DEBUG bool "SOF debugging features" - depends on SND_SOC_SOF help This option can be used to enable or disable individual SOF firmware and driver debugging options. Say Y if you are debugging SOF FW or drivers. If unsure select "N". +if SND_SOC_SOF_DEBUG + config SND_SOC_SOF_FORCE_NOCODEC_MODE bool "SOF force nocodec Mode" depends on SND_SOC_SOF_NOCODEC - depends on SND_SOC_SOF_DEBUG help This forces SOF to use dummy/nocodec as machine driver, even though there is a codec detected on the real platform. This is @@ -60,7 +98,6 @@ config SND_SOC_SOF_FORCE_NOCODEC_MODE config SND_SOC_SOF_DEBUG_XRUN_STOP bool "SOF stop on XRUN" - depends on SND_SOC_SOF_DEBUG help This option forces PCMs to stop on any XRUN event. This is useful to preserve any trace data ond pipeline status prior to the XRUN. @@ -69,7 +106,6 @@ config SND_SOC_SOF_DEBUG_XRUN_STOP config SND_SOC_SOF_DEBUG_VERBOSE_IPC bool "SOF verbose IPC logs" - depends on SND_SOC_SOF_DEBUG help This option enables more verbose IPC logs, with command types in human-readable form instead of just 32-bit hex dumps. This is useful @@ -78,8 +114,6 @@ config SND_SOC_SOF_DEBUG_VERBOSE_IPC config SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION bool "SOF force to use IPC for position update on SKL+" - depends on SND_SOC_SOF_DEBUG - default n help This option force to handle stream position update IPCs and run pcm elapse to inform ALSA about that, on platforms (e.g. Intel SKL+) that @@ -90,6 +124,20 @@ config SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION DPIB/posbuf is not ready, select "Y". If unsure select "N". +endif ## SND_SOC_SOF_DEBUG + +endif ## SND_SOC_SOF_OPTIONS + +config SND_SOC_SOF + tristate + select SND_SOC_TOPOLOGY + select SND_SOC_COMPRESS if SND_SOC_SOF_COMPRESS=y + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + Due to module dependencies this option needs to be selected + at the lowest level for each platform + source "sound/soc/sof/intel/Kconfig" source "sound/soc/sof/xtensa/Kconfig" diff --git a/sound/soc/sof/Makefile b/sound/soc/sof/Makefile index 035ee0c7268394..b3d6defe6c39e6 100644 --- a/sound/soc/sof/Makefile +++ b/sound/soc/sof/Makefile @@ -21,5 +21,5 @@ obj-$(CONFIG_SND_SOC_SOF_SPI) += sof-spi-dev.o obj-$(CONFIG_SND_SOC_SOF_SPIDSP) += snd-sof-spi.o -obj-$(CONFIG_SND_SOC_SOF_INTEL) += intel/ +obj-$(CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL) += intel/ obj-$(CONFIG_SND_SOC_SOF_XTENSA) += xtensa/ diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index acc31134481fcf..cf751377e4e76c 100644 --- a/sound/soc/sof/intel/Kconfig +++ b/sound/soc/sof/intel/Kconfig @@ -1,114 +1,192 @@ -config SND_SOC_SOF_SPIDSP - tristate "SOF support over the SPI bus" - depends on SPI - select SND_SOC_SOF_SPI - help - This adds support for Sound Open Firmware over SPI for Device - Tree based systems. - 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_DMA_SGBUF - select SND_SOC_INTEL_MACH - select SND_SOC_SOF_XTENSA +config SND_SOC_SOF_INTEL_TOPLEVEL + bool "SOF support for Intel audio DSPs" + depends on SND_DMA_SGBUF || COMPILE_TEST 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 +if SND_SOC_SOF_INTEL_TOPLEVEL -config SND_SOC_SOF_BAYTRAIL - tristate "SOF support for Baytrail, Braswell and Cherrytrail" - select SND_SOC_SOF_ACPI +config SND_SOC_SOF_INTEL_ACPI + tristate + select SND_SOC_SOF_BAYTRAIL if SND_SOC_SOF_BAYTRAIL_SUPPORT + select SND_SOC_SOF_HASWELL if SND_SOC_SOF_HASWELL_SUPPORT + select SND_SOC_SOF_BROADWELL if SND_SOC_SOF_BROADWELL_SUPPORT + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_INTEL_PCI + tristate + select SND_SOC_SOF_APOLLOLAKE if SND_SOC_SOF_APOLLOLAKE_SUPPORT + select SND_SOC_SOF_GEMINILAKE if SND_SOC_SOF_GEMINILAKE_SUPPORT + select SND_SOC_SOF_CANNONLAKE if SND_SOC_SOF_CANNONLAKE_SUPPORT + select SND_SOC_SOF_KABYLAKE if SND_SOC_SOF_KABYLAKE_SUPPORT + select SND_SOC_SOF_SKYLAKE if SND_SOC_SOF_SKYLAKE_SUPPORT + select SND_SOC_SOF_ICELAKE if SND_SOC_SOF_ICELAKE_SUPPORT + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_INTEL_COMMON + tristate select SND_SOC_ACPI_INTEL_MATCH + select SND_SOC_SOF_XTENSA + select SND_SOC_SOF + select SND_SOC_INTEL_MACH + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +if SND_SOC_SOF_INTEL_ACPI + +config SND_SOC_SOF_BAYTRAIL_SUPPORT + bool "SOF support for Baytrail, Braswell and Cherrytrail" help This adds support for Sound Open Firmware for Intel(R) platforms using the Baytrail, Braswell or Cherrytrail processors. Say Y if you have such a device. If unsure select "N". -config SND_SOC_SOF_HASWELL - tristate "SOF support for Haswell" - select SND_SOC_SOF_ACPI - select SND_SOC_ACPI_INTEL_MATCH +config SND_SOC_SOF_BAYTRAIL + tristate + select SND_SOC_INTEL_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_HASWELL_SUPPORT + bool "SOF support for Haswell" help This adds support for Sound Open Firmware for Intel(R) platforms using the Haswell processors. Say Y if you have such a device. If unsure select "N". -config SND_SOC_SOF_BROADWELL - tristate "SOF support for Broadwell" - select SND_SOC_SOF_ACPI - select SND_SOC_ACPI_INTEL_MATCH +config SND_SOC_SOF_HASWELL + tristate + select SND_SOC_SOF_INTEL_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_BROADWELL_SUPPORT + bool "SOF support for Broadwell" help This adds support for Sound Open Firmware for Intel(R) platforms using the Broadwell processors. Say Y if you have such a device. If unsure select "N". -config SND_SOC_SOF_APOLLOLAKE - tristate "SOF support for Apollolake" - select SND_SOC_SOF_HDA_COMMON +config SND_SOC_SOF_BROADWELL + tristate + select SND_SOC_SOF_INTEL_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +endif ## SND_SOC_SOF_INTEL_ACPI + +if SND_SOC_SOF_INTEL_PCI + +config SND_SOC_SOF_APOLLOLAKE_SUPPORT + bool "SOF support for Apollolake" help This adds support for Sound Open Firmware for Intel(R) platforms using the Apollolake processors. Say Y if you have such a device. If unsure select "N". -config SND_SOC_SOF_GEMINILAKE - tristate "SOF support for GeminiLake" +config SND_SOC_SOF_APOLLOLAKE + tristate select SND_SOC_SOF_HDA_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_GEMINILAKE_SUPPORT + bool "SOF support for GeminiLake" help This adds support for Sound Open Firmware for Intel(R) platforms using the Geminilake processors. Say Y if you have such a device. If unsure select "N". -config SND_SOC_SOF_CANNONLAKE - tristate "SOF support for Cannonlake" +config SND_SOC_SOF_GEMINILAKE + tristate select SND_SOC_SOF_HDA_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_CANNONLAKE_SUPPORT + bool "SOF support for Cannonlake" help This adds support for Sound Open Firmware for Intel(R) platforms using the Cannonlake processors. Say Y if you have such a device. If unsure select "N". -config SND_SOC_SOF_KABYLAKE - tristate "SOF support for Kabylake" +config SND_SOC_SOF_CANNONLAKE + tristate select SND_SOC_SOF_HDA_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_KABYLAKE_SUPPORT + bool "SOF support for Kabylake" help This adds support for Sound Open Firmware for Intel(R) platforms using the Kabylake processors. Say Y if you have such a device. If unsure select "N". -config SND_SOC_SOF_SKYLAKE - tristate "SOF support for Skylake" +config SND_SOC_SOF_KABYLAKE + tristate select SND_SOC_SOF_HDA_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_SKYLAKE_SUPPORT + bool "SOF support for Skylake" help This adds support for Sound Open Firmware for Intel(R) platforms using the Skylake processors. Say Y if you have such a device. If unsure select "N". -config SND_SOC_SOF_ICELAKE - tristate "SOF support for Icelake" +config SND_SOC_SOF_SKYLAKE + tristate select SND_SOC_SOF_HDA_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_ICELAKE_SUPPORT + bool "SOF support for Icelake" help This adds support for Sound Open Firmware for Intel(R) platforms using the Icelake processors. Say Y if you have such a device. If unsure select "N". +config SND_SOC_SOF_ICELAKE + tristate + select SND_SOC_SOF_HDA_COMMON + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + config SND_SOC_SOF_HDA_COMMON tristate - select SND_SOC_SOF_PCI - select SND_SOC_ACPI_INTEL_MATCH + select SND_SOC_SOF_INTEL_COMMON select SND_SOC_SOF_HDA_LINK_BASELINE + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level if SND_SOC_SOF_HDA_COMMON @@ -134,10 +212,18 @@ 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 + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level 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 + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +endif ## SND_SOC_SOF_INTEL_PCI endif ## SND_SOC_SOF_INTEL From 2ad71b9a54d53664d21c505d227b6c839cc1b125 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 14 Dec 2018 15:51:18 -0600 Subject: [PATCH 5/5] ASoC: Intel: Fix if statements for SOF in Kconfigs s/SND_SOF_SOC_INTEL/SND_SOC_SOF_INTEL_TOPLEVEL Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/Kconfig | 4 ++-- sound/soc/intel/boards/Kconfig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig index a8e33188b30ad3..d4d7ef5daf4bc0 100644 --- a/sound/soc/intel/Kconfig +++ b/sound/soc/intel/Kconfig @@ -139,7 +139,7 @@ endif ## SND_SOC_INTEL_SKYLAKE endif ## SND_SOC_INTEL_SST_TOPLEVEL -if SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL +if SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL_TOPLEVEL config SND_SOC_ACPI_INTEL_MATCH tristate @@ -147,7 +147,7 @@ config SND_SOC_ACPI_INTEL_MATCH # this option controls the compilation of ACPI matching tables and # helpers and is not meant to be selected by the user. -endif ## SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL +endif ## SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL_TOPLEVEL # ASoC codec drivers diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 2582146bf97651..3490bfd6af2869 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -1,6 +1,6 @@ menuconfig SND_SOC_INTEL_MACH bool "Intel Machine drivers" - depends on SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL + depends on SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL_TOPLEVEL help Intel ASoC Machine Drivers. If you have a Intel machine that has an audio controller with a DSP and I2S or DMIC port, then