summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/avs
AgeCommit message (Collapse)AuthorFilesLines
2022-10-03Merge tag 'asoc-v6.1' of ↵Takashi Iwai1-0/+1
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.1 This has been a very quiet release for the core but quite a busy one for drivers with a big crop of new drivers and lots of feature additions and fixes to existing ones: - A new string helper parse_int_array_user(). - Improvements to the SOF IPC4 code, especially around trace. - Support for AMD Rembrant DSPs, AMD Pink Sardine ACP 6.2, Apple Silcon systems, Everest ES8326, Intel Sky Lake and Kaby Lake, MediaTek MT8186 support, NXP i.MX8ULP DSPs, Qualcomm SC8280XP, SM8250 and SM8450 and Texas Instruments SRC4392 There is a conflict with the conversion of I2C remove functions to void in the cs42l42 driver which is fairly straightforward to resolve but should be highlighted to Linus.
2022-09-20ALSA: hda: Use hdac_ext prefix in snd_hdac_stream_free_all() for clarityPierre-Louis Bossart1-2/+2
Make sure there's no ambiguity on layering with the appropriate prefix added. Pure rename, no functionality changed. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20220919121041.43463-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-09-19ASoC: soc-core.c: setup rtd->pmdown_time at soc_new_pcm_runtime()Kuninori Morimoto1-0/+1
Almost all default rtd->xxx are setup at soc_new_pcm_runtime() which is sub-function of snd_soc_add_pcm_runtime() (A). But "rtd->pmdown_time" is setup at soc_init_pcm_runtime() (B). It is very random timing setup. This patch setup it at (A), same as other rtd->xxx. static int snd_soc_bind_card(...) { ... for_each_card_prelinks(...) { (A) ret = snd_soc_add_pcm_runtime(...); ... } ... for_each_card_rtds(...) { (B) ret = soc_init_pcm_runtime(...); ... } ... } One note is that current topology/intel are directly calling snd_soc_add_pcm_runtime() (A) without calling soc_init_pcm_runtime() (B). This means, its "rtd->pmdown_time settings" was 0, but will have default value by this patch. "rtd->pmdown_time settings" will be used at snd_soc_runtime_ignore_pmdown_time(). This patch adds "ignore_pmdown_time" to these driver to keep compatibility. bool snd_soc_runtime_ignore_pmdown_time(...) { ... => if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time) return true; ... } Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875yhxmjjd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-05ASoC: Intel: avs: Fix potential buffer overflow by snprintf()Takashi Iwai1-2/+2
snprintf() returns the would-be-filled size when the string overflows the given buffer size, hence using this value may result in a buffer overflow (although it's unrealistic). This patch replaces it with a safer version, scnprintf() for papering over such a potential issue. Fixes: f1b3b320bd65 ("ASoC: Intel: avs: Generic soc component driver") Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220801165420.25978-2-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-22ASoC: Intel: avs: Use lookup table to create modulesAmadeusz Sławiński1-25/+29
As reported by Nathan, when building avs driver using clang with: CONFIG_COMPILE_TEST=y CONFIG_FORTIFY_SOURCE=y CONFIG_KASAN=y CONFIG_PCI=y CONFIG_SOUND=y CONFIG_SND=y CONFIG_SND_SOC=y CONFIG_SND_SOC_INTEL_AVS=y there are reports of too big stack use, like: sound/soc/intel/avs/path.c:815:18: error: stack frame size (2176) exceeds limit (2048) in 'avs_path_create' [-Werror,-Wframe-larger-than] struct avs_path *avs_path_create(struct avs_dev *adev, u32 dma_id, ^ 1 error generated. This is apparently caused by inlining many calls to guid_equal which inlines fortified memcpy, using 2 size_t variables. Instead of hardcoding many calls to guid_equal, use lookup table with one call, this improves stack usage. Link: https://lore.kernel.org/alsa-devel/YtlzY9aYdbS4Y3+l@dev-arch.thelio-3990X/T/ Link: https://github.com/ClangBuiltLinux/linux/issues/1642 Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reported-by: Nathan Chancellor <nathan@kernel.org> Build-tested-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220722111959.2588597-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Update AVS_FW_INIT_TIMEOUT_US declarationCezary Rojewski1-1/+1
To reduce the number of places to update if timeouts would have to change, modify the constant declaration. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-13-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Lower UNLOAD_MULTIPLE_MODULES IPC timeoutCezary Rojewski1-1/+1
Module unloading operation performs memory unmapping and the weight of the opration does not different from any other standard IPC. There is no dependency on secondary task like in module loading scenario where larger message timeout is recommended. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-12-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Replace hardcodes with SD_CTL_STREAM_RESETCezary Rojewski1-6/+6
Improve readability of CLDMA reset operation by making use of already defined SD_CTL_STREAM_RESET. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-11-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Recognize FW_CFG_RESERVEDCezary Rojewski1-0/+1
If exposed by firmware, count RESERVED parameter as known one to avoid dumping noise in kernel logs. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Use helper function to set up DMAAmadeusz Sławiński1-6/+2
dma_set_mask() and dma_set_coherent_mask() can be performed with one call to dma_set_mask_and_coherent(), which slightly reduces amount of code on our side. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Set max DMA segment sizeAmadeusz Sławiński1-0/+1
Apparently it is possible for code to allocate large buffers which may cause warnings as reported in [1]. This was fixed for HDA, SOF and skylake in patchset [2], fix it also for avs driver. [1] https://github.com/thesofproject/linux/issues/3430 [2] https://lore.kernel.org/all/20220215132756.31236-1-tiwai@suse.de/ Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Block IPC channel on suspendCezary Rojewski1-0/+1
To allow for driver's filesystem interfaces e.g.: debugfs, to be touched even when the device is asleep, mark IPC-channel as blocked when the device is suspended. This causes any invocation of said interfaces that do not toggle PM themselves to gracefully fail with "Operation not permitted" message. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Shield LARGE_CONFIG_GETs against zero payload_sizeCezary Rojewski1-0/+9
Some LARGE_CONFIG_GETs are never expected to return payload of size 0. Check for such situation and collapse if met. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Copy only as many RX bytes as necessaryCezary Rojewski2-4/+3
There is no need to copy number of bytes specified by IPC message caller if DSP firmware returned lower number. In consequence, LARGE_CONFIG_GET handler is simplified. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Relax DSP core transition timingsCezary Rojewski1-2/+9
To avoid any false positives when checking CPA after setting SPA, do a short wait. For stall operation, give HW more time to propagate the change before moving on. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Assign I2S gateway when parsing topologyCezary Rojewski1-0/+27
For formatted port - ssp%d - descriptions to have an effect, copier module templates need to be updated with specified port value. This value is later propagated to the firmware when module instances are being instantiated. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08ASoC: Intel: avs: Register HDAudio ext-bus operationsCezary Rojewski1-1/+2
With ASoC representation of HDAudio codec added, update bus initiazation to complete it. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-06ASoC: Intel: avs: Fix i2s_test card name initializationCezary Rojewski1-1/+1
Update printf formatting as 'ssp_port' argument is of type 'int', not 'long int'. Fixes: e39acc4cfd92 ("ASoC: Intel: avs: Add I2S-test machine board") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220706062952.251704-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05ASoC: Intel: avs: correct config reference for I2S test boardLukas Bulwahn1-1/+1
Commit e39acc4cfd92 ("ASoC: Intel: avs: Add I2S-test machine board") adds the config "SND_SOC_INTEL_AVS_MACH_I2S_TEST", but in the Makefile refers to config "SND_SOC_INTEL_AVS_MACH_i2s_TEST" (notice the uppercase and lowercase difference). Adjust the Makefile to refer to the actual existing config. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Acked-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20220705103238.7484-1-lukas.bulwahn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-27ASoC: Intel: avs: Remove now redundant non_legacy_dai_naming flagCharles Keepax1-2/+0
The ASoC core has now been changed to default to the non-legacy DAI naming, as such drivers using the new scheme no longer need to specify the non_legacy_dai_naming flag. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220623125250.2355471-82-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-14ASoC: Merge fixesMark Brown1-2/+2
Required for more changes for the ops.
2022-06-10ASoC: Intel: avs: Fix parsing UUIDs in topologyAmadeusz Sławiński1-2/+2
Use correct type for parsing UUIDs, this eliminates warning present, when compiling with W=1. Fixes: 34ae2cd53673 ("ASoC: Intel: avs: Add topology parsing infrastructure") Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220610124257.4160658-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add da7219 machine boardCezary Rojewski3-0/+294
To support AVS-da7219 configuration add machine board connecting AVS platform component driver with da7219 codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-15-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add max98373 machine boardAmadeusz Sławiński3-0/+251
To support AVS-max98373 configuration add machine board connecting AVS platform component driver with max98373 codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-14-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add max98357a machine boardCezary Rojewski3-0/+166
To support AVS-max98357a configuration add machine board connecting AVS platform component driver with max98357a codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-13-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add ssm4567 machine boardCezary Rojewski3-0/+284
To support AVS-ssm4567 configuration add machine board connecting AVS platform component driver with ssm4567 codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-12-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add nau8825 machine boardCezary Rojewski3-0/+366
To support AVS-nau8825 configuration add machine board connecting AVS platform component driver with nau8825 codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-11-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add rt5682 machine boardCezary Rojewski3-0/+352
To support AVS-rt5682 configuration add machine board connecting AVS platform component driver with rt5682 codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add rt298 machine boardCezary Rojewski3-0/+293
To support AVS-rt298 configuration add machine board connecting AVS platform component driver with rt298 codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add rt286 machine boardCezary Rojewski3-0/+293
To support AVS-rt286 configuration add machine board connecting AVS platform component driver with rt286 codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add rt274 machine boardCezary Rojewski3-0/+322
To support AVS-rt274 configuration add machine board connecting AVS platform component driver with rt274 codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add I2S-test machine boardCezary Rojewski3-0/+188
Allow for testing audio streaming over I2S interface through SSP loopback. No actual codec is needed here as board is intended for SSP loopback scenarios only. One playback and one capture endpoint is exposed per SSP port. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add DMIC machine boardCezary Rojewski3-0/+103
Support AVS-DMIC configuration by implementing board connecting AVS platform component with DMIC codec one. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: avs: Add HDAudio machine boardCezary Rojewski4-0/+317
Connect AVS driver with ASoC HDAudio codec with help of this machine board. Similarly to its platform and codec components, DAI links and routes are being created dynamically so single board can be used across all HDAudio codec types. Card makes use of "binder" BE DAI Link so HDAudio codec driver can be listed as one of its components. This allows for BE DAIs to be created dynamically, based on HDAudio codec capabilities. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220511162403.3987658-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-30ASoC: Intel: avs: Fix build error on arc, m68k and sparcUwe Kleine-König1-1/+2
On some platforms (i.e. arc, m68k and sparc) __fls returns an int (while on most platforms it returns an unsigned long). This triggers a format warning on these few platforms as the driver uses %ld to print a warning. So explicitly cast the return value to unsigned long to make the warning go away (and so fix allmodconfig build on the affected architectures). Fixes: beed983621fb ("ASoC: Intel: avs: Machine board registration") Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220529141250.1979827-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: APL-based platforms supportCezary Rojewski7-1/+295
Define handlers specific to cAVS 1.5+ platforms, that is, APL and similar platforms. These differ from SKL-alike ones in terms of AudioDSP firmware generation and thus the '+' suffix. Introduciton of IMR, removal of CLDMA, D0IX support and monolithic-ation of library/module code are most impactful but are not the only changes brought with this newer generation. Some generic and 1.5 operations are being re-used to reduce code size. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-16-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: SKL-based platforms supportCezary Rojewski6-0/+170
Define handlers specific to cAVS 1.5 platforms, that is SKL, KBL, AML and all other variants based on this very version of AudioDSP architecture. Most are specific to SKL-alike platforms with only skl_log_buffer_offset() being exposed and used later by younger equivalents. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-15-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Power managementCezary Rojewski1-0/+101
To preserve power during sleep operations, handle suspend (S3), hibernation (S4) and runtime (RTD3) transitions. As flow for all of is shared, define common handlers to reduce code size. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-14-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: PCI driver implementationCezary Rojewski4-3/+496
HD-Audio bus is a PCI device. Add all functions necessary to probe such device along with its removal sequence. Behaviour implemented for all standard operations is similar to existing solutions: sound/pci/hda and sound/soc/intel/skylake. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-13-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Machine board registrationCezary Rojewski3-1/+505
AVS driver operates with granular audio card division in mind. Super-card approach (e.g.: I2S, DMIC and HDA DAIs combined) is deprecated in favour of individual cards - one per each device. This provides necessary dynamism, especially for configurations with number of codecs present and makes it easier to survive auxiliary devices failures - one card failing to probe does not prevent others from succeeding. All boards spawned by AVS are unregistered on ->remove(). This includes dummy codecs such as DMIC. As all machine boards found in sound/soc/intel/boards are irreversibly tied to 'super-card' approach, new boards are going to be introduced. This temporarily increases number of boards available under /intel directory until skylake-driver becomes deprecated and removed. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-12-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Replace link_mask usage with i2s_link_maskPiotr Maziarz1-6/+6
'link_mask' field is intended for SoundWire, I2S should use 'i2s_link_mask' instead. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-11-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Event tracingCezary Rojewski5-3/+228
Define tracing macros for easy avs debug. These cover all IPC message types: requests, replies and notifications as well as DSP-core operations and d0ix toggling. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: D0ix power state supportCezary Rojewski4-3/+150
Audio DSP device supports D0 substates in form of D0ix, allowing for preserving more power even when device is still considered active (D0). When entered, certain domains which are not being currently used become power gated. Entering and leaving D0ix is a complex process and differs between firmware generations. Conditions that disallow D0i3 and require immediate D0i0 transition include but may not be limited to: IPC traffic, firmware tracing and SRAM I/O. To make D0ix toggling sane, delay D0i3 transition and refresh the timer each time an IPC is requested. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Prepare for firmware tracingCezary Rojewski6-0/+113
Firmware provides its own debug functionality. While coredump is one of these, traces are the main area of interest. kfifo is enlisted to cache log data that is being pumped to driver through SRAM. Separate DSP operations are declared as actual feature implementation differs between firmware generations. As log gathering involves usage of IPCs, add all necessary: ENABLE_LOGS and SYSTEM_TIME. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Coredump and recovery flowCezary Rojewski3-2/+104
In rare occasions, under stress conditions or hardware malfunction, DSP firmware may fail. Software is notified about such situation with EXCEPTION_CAUGHT notification. IPC timeout is also counted as critical device failure. More often than not, driver can recover from such situations by performing full reset: killing and restarting ADSP. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: HDA PCM BE operationsCezary Rojewski2-0/+350
HDA streaming in DSP world means enlisting HDAudio links as BE interfaces. Another difference when compared to its DMIC and I2S friends is lack of NHLT blob usage - no additional hardware configuration is needed. Similarly to I2S component, HDA populates its DAIs dynamically, here by the means of codec->pcm_list_head. Allows for cutting the number of soc components required to support the interface. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: non-HDA PCM BE operationsCezary Rojewski2-1/+225
DMIC and I2S interfaces differ in DMA operations from the HDAudio interface. With that in mind, implement all DAI operations to handle non-HDA BE interfaces. To prevent code duplication in newly added code, I2S platform registering is dynamic - makes use of specified port_mask and TDMs array to populate as many DAIs as required. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Generic PCM FE operationsCezary Rojewski2-2/+338
Each stream in AVS is represented by FE and BE domain. FE path stands for HOST part of the stream while BE stands for LINK (hardware) one. While BE portion is interface specific, FE is not. Handle all standard DAI operations to implement FE part of the stream. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Generic soc component driverCezary Rojewski2-1/+276
Prepare for concrete PCM operations over HDA, DMIC and I2S interfaces by providing generic soc component implementation. Interface-specific components re-use this code as majority of flow is shared. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17ASoC: Intel: avs: Account for libraries when booting basefwCezary Rojewski2-0/+83
Not all modules are part of base firmware. Some are part of loadable libraries. These need to be loaded after base firmware reports ready status through FW_READY notification. Their loading process is similar to the base firmware's one. Request the binary file, verify and strip the manifest and load the actual code into DSP memory with help of CLDMA or HD-Audio render stream, depending on audio device generation. List of libraries needed for loading is obtained through the topology - vendor sections specifying the name of firmware files to request. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>