From 4bd1adb85a09c249ddb4610e8412bf0f4484a371 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 27 Oct 2022 15:35:40 -0400 Subject: ASoC: SOF: introduce new DEBUG_NOCODEC mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing NOCODEC mode enforces a build-time mutual exclusion with the HDaudio link support, mostly to avoid any dependency on the snd_hdac library and references to HDAudio codec/i915 stuff. This is very useful to track dependencies and test a minimal configuration, but very painful for developers and CI: a recompilation and reinstall of the kernel modules is required. This patch suggests an alternate middle ground where the selection of the machine driver and all codec-related actions are bypassed at run-time, contingent on a kernel module parameter being set. For example setting BIT(10) with 'options snd_sof sof_debug=0x401' is enough to switch from an HDaudio card to a nocodec one. This new DEBUG_NOCODEC mode is not suitable for distributions and end-users. It's not even recommended on all platforms, i.e. the NOCODEC mode is known not to work on specific devices where the BIOS did not configure support for I2S/DMIC interfaces. The usual development devices such as Chromebooks, Up boards and Intel RVP are the only recommended platforms where this mode can be supported. Note that the dynamic switch between HDaudio and nocodec may not always possible depending on hardware layout, pin-mux options, and BIOS settings. The audio subsustems on Intel platforms has to support 4 types of interfaces and pin-mux can be complicated. Reviewers might ask: why didn't we do this earlier? The main reason is that all the codec-related configurations were not cleanly separated out in the sof/intel directory. With all the cleanups done recently, adding this opt-in behavior is relatively straightforward. Tested on UpExtreme (WHL) and UpExtreme i11 (TGL). Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20221027193540.259520-22-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/sof/Kconfig | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'sound/soc/sof/Kconfig') diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index 37f7df5fde17..0b9beb74b0f6 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -97,13 +97,13 @@ config SND_SOC_SOF_NOCODEC tristate config SND_SOC_SOF_NOCODEC_SUPPORT - bool "SOF nocodec mode support" + bool "SOF nocodec static mode support" help This adds support for a dummy/nocodec machine driver fallback option if no known codec is detected. This is typically only enabled for developers or devices where the sound card is controlled externally. - This option is mutually exclusive with the Intel HDAudio support. + This option is mutually exclusive at build time with the Intel HDAudio support. Selecting it may have negative impacts and prevent e.g. microphone functionality from being enabled on Intel CoffeeLake and later platforms. @@ -136,6 +136,19 @@ config SND_SOC_SOF_DEBUG if SND_SOC_SOF_DEBUG +config SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT + bool "SOF nocodec debug mode support" + depends on !SND_SOC_SOF_NOCODEC_SUPPORT + help + This adds support for a dummy/nocodec machine driver fallback + option. + Unlike the SND_SOC_SOF_NOCODEC_SUPPORT, this option is NOT + mutually exclusive at build with the Intel HDAudio support. The + selection will be done depending on command line or modprobe.d settings + Distributions should not select this option! + Say Y if you need this nocodec debug fallback option. + If unsure select "N". + config SND_SOC_SOF_FORCE_NOCODEC_MODE bool "SOF force nocodec Mode" depends on SND_SOC_SOF_NOCODEC_SUPPORT @@ -239,6 +252,7 @@ config SND_SOC_SOF tristate select SND_SOC_TOPOLOGY select SND_SOC_SOF_NOCODEC if SND_SOC_SOF_NOCODEC_SUPPORT + select SND_SOC_SOF_NOCODEC if SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT help This option is not user-selectable but automagically handled by 'select' statements at a higher level. -- cgit v1.2.3