aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-29ASoC: soc-component: fix undefined reference to __ffssi2Srinivas Kandagatla1-1/+2
microblaze-linux-gcc (GCC) 9.3.0 complains about missing __ffssi2 symbol while using __builtin_ffs at runtime. This is because arch/h8300 is compiled with -fno-builtin option. so fallback and use kernel ffs() instead to all the arch builds happy! Fixes: 1da0b9899abd ("ASoC: soc-component: add snd_soc_component_read/write_field()") Reported-by: kernel test robot <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-28Merge series "ASoC: SOF: use common code for DSP core pm" from Kai Vehmanen ↵Mark Brown7-27/+25
<[email protected]>: Series to refactor the DSP core management: - move tracking of powered up DSP cores to common SOF code - add logic filter unnecessary power actions - modify existing implementations to use common code whenever DSP cores are powered, so the state in common code stays in sync Bard Liao (5): ASoC: SOF: Intel: hda: use snd_sof_dsp_core_power_up/down API ASoC: SOF: Intel: hda-loader: keep init cores alive ASoC: SOF: update dsp core power status in common APIs ASoC: SOF: Filter out unneeded core power up/downs ASoC: SOF: intel: hda-loader: use snd_sof_dsp_core_power_down/up APIs sound/soc/sof/intel/hda-dsp.c | 2 +- sound/soc/sof/intel/hda-loader.c | 9 +++++---- sound/soc/sof/intel/hda.c | 2 +- sound/soc/sof/loader.c | 6 ------ sound/soc/sof/ops.h | 24 ++++++++++++++++++------ sound/soc/sof/pm.c | 1 - sound/soc/sof/topology.c | 8 -------- 7 files changed, 25 insertions(+), 27 deletions(-) base-commit: e32df142359fb6f4d27977b7652549f0844aa62f -- 2.29.2
2021-01-28ASoC: Intel: remove duplicate MODULE_LICENSE/DESCRIPTION tagsKai Vehmanen14-42/+0
The snd-soc-acpi-intel-match has duplicate module tags for all platforms separately. Remove all but one and save some storage space and cleanup modinfo output. Signed-off-by: Kai Vehmanen <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-28ASoC: SOF: intel: hda-loader: use snd_sof_dsp_core_power_down/up APIsBard Liao1-3/+3
To manage enabled_cores_mask flag, we should always use snd_sof_dsp_ core_power_down/up APIs to power up/down dsp cores. The APIs do a little bit more than the original functions, but it is harmless. Suggested-by: Ranjani Sridharan <[email protected]> Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-28ASoC: SOF: Filter out unneeded core power up/downsBard Liao1-2/+4
Exclude cores that are already powered on/off correctly. This allows to simplify dsp_power_up/down() implementations and avoid unexpected error. Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-28ASoC: SOF: update dsp core power status in common APIsBard Liao4-21/+16
Only manage enabled_cores_mask in common snd_sof_dsp_core_power_up/down APIs to ensure it stays in sync with actual DSP core state. Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-28ASoC: SOF: Intel: hda-loader: keep init cores aliveBard Liao1-2/+3
init_core_mask should be the available cores mask after fw boot. So we should keep not core 0 but init cores alive. Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-28ASoC: SOF: Intel: hda: use snd_sof_dsp_core_power_up/down APIBard Liao3-3/+3
To implement common logic in SOF core, core power up/down flows should use common SOF API and not directly use low-level platform specific helper functions. Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-28ASoC: SOF: Intel: hda: cancel D0i3 work during runtime suspendRanjani Sridharan1-0/+4
Cancel the D0i3 work during runtime suspend as no streams are active at this point anyway. Fixes: 63e51fd33fef ("ASoC: SOF: Intel: cnl: Implement feature to support DSP D0i3 in S0") Signed-off-by: Ranjani Sridharan <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-28ASoC: qcom: lpass-cpu: Remove bit clock state checkSrinivasa Rao Mandadapu3-18/+8
No need of BCLK state maintenance from driver side as clock_enable and clk_disable API's maintaing state counter. One of the major issue was spotted when Headset jack inserted while playback continues, due to same PCM device node opens twice for playaback/capture and closes once for capture and playback continues. It can resolve the errors in such scenarios. Fixes: b1824968221c ("ASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state") Signed-off-by: Srinivasa Rao Mandadapu <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: Intel: adl: remove sof_fw_filename setting in ADL snd_soc_acpi_machLibin Yang1-1/+0
ADL will use sof-adl-s.ri if it is ADL-S platform. So let's use the default_fw_filename in pdata->desc for the ADL FW filename. Signed-off-by: Libin Yang <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: max98373: Fixes a typo in max98373_feedback_getJudy Hsiao1-1/+1
The snd_soc_put_volsw in max98373_feedback_get is a typo, change it to snd_soc_get_volsw. Fixes: 349dd23931d1 ("ASoC: max98373: don't access volatile registers in bias level off") Signed-off-by: Judy Hsiao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27Merge series "ASoC: SOF: Intel: hda: Enable DMI L1 for power savings" from ↵Mark Brown6-22/+46
Ranjani Sridharan <[email protected]>: This series includes 2 patches that enable DMI L1 for D0I3-compatible streams and trace DMA stream to maximise power savings on Intel HDA platforms. v2 changes: FIx compilation error when probes feature is enabled in SOF Kconfig. Ranjani Sridharan (2): ASoC: SOF: Intel: hda: enable DMI L1 for D0i3-compatible streams ASoC: SOF: Intel: hda: Enable DMI L1 for trace sound/soc/sof/intel/hda-compress.c | 2 +- sound/soc/sof/intel/hda-loader.c | 2 +- sound/soc/sof/intel/hda-pcm.c | 16 ++++++++++++- sound/soc/sof/intel/hda-stream.c | 38 +++++++++++++++++------------- sound/soc/sof/intel/hda-trace.c | 4 ++-- sound/soc/sof/intel/hda.h | 6 ++++- 6 files changed, 46 insertions(+), 22 deletions(-) -- 2.25.1
2021-01-27ASoC: q6asm: fix 'physical' typosBjorn Helgaas1-1/+1
Fix misspellings of "physical". Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: codecs: lpass-wsa-macro: make use of snd_soc_component_read_field()Srinivas Kandagatla1-23/+20
Make use of snd_soc_component_read_field() to make the code more readable! Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: soc-component: add snd_soc_component_read/write_field()Srinivas Kandagatla2-0/+59
It's often the case that we would write or read a particular field in register. With the current soc_component apis, reading a particular field in register would involve first read the register and then perform shift operations. Ex: to read from a field mask of 0xf0 val = snd_soc_component_read(component, reg); field = ((val & 0xf0) >> 0x4); This is sometimes prone to errors and code become less readable! With this new api we could just do field = snd_soc_component_read_field(component, reg, 0xf0); this makes it bit simple, easy to write and less error prone! This also applies to writing! There are various places in kernel which provides such field interfaces however soc_component seems to be missing this. This patch is inspired by FIELD_GET/FIELD_PREP macros in include/linux/bitfield.h Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: SOF: Intel: hda: Enable DMI L1 for traceRanjani Sridharan1-1/+2
Enabling DMI L1 for capture streams could result in xruns during pause/release. As pause/release is not a valid scenario for trace, we can safely enable DMI L1 for it. Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Signed-off-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: SOF: Intel: hda: enable DMI L1 for D0i3-compatible streamsRanjani Sridharan6-22/+45
DMI L1 entry is currently disabled whenever any capture stream is opened to prevent xruns during pause/release. But, in order to maximise power savings for the wake-on-voice usecase, DMI L1 entry should be enabled for D0i3-compatible capture streams. Introduce a new field, flags in struct sof_intel_hda_stream that stores whether a stream is dmi_l1_compatible. All playback streams, and D0i3-compatible capture streams are DMI L1 compatible. Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Signed-off-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: SOF: add a pointer to download repo in case FW request failsKai Vehmanen2-0/+4
The SOF firmware and topology files are not distributed via linux-firmware. To help debugging cases where correct firmware is not installed, print a pointer to the official upstream repository for Sound Open Firmware releases. BugLink: https://github.com/thesofproject/sof/issues/3665 Reported-by: Bruce Perens <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Marc Herbert <[email protected]> Reviewed-by: Liam Girdwood <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: Intel: tgl: remove sof_fw_filename set for tgl_3_in_1_defaultLibin Yang1-7/+0
tgl_3_in_1_default link topology may be used by both TGL-LP and TGL-H. Let's remove the sof_fw_filename setting in struct snd_soc_acpi_mach and use the default_fw_filename setting in struct sof_dev_desc. Signed-off-by: Libin Yang <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Tested-by: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: SOF: allow soundwire use desc->default_fw_filenameLibin Yang1-1/+4
The old code always uses sof_fw_filename in struct snd_soc_acpi_mach as the firmware name. However, firmware name should depend on the platform instead of the machine. For example, different machines may use the same soundwire link topology, but they are using the different firmware. In this case, it's hard to determine in struct snd_soc_acpi_mach which firmware it should use. Signed-off-by: Libin Yang <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Tested-by: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-27ASoC: siu: Fix build error by a wrong const prefixTakashi Iwai2-2/+2
A const prefix was put wrongly in the middle at the code refactoring commit 932eaf7c7904 ("ASoC: sh: siu_pcm: remove snd_pcm_ops"), which leads to a build error as: sound/soc/sh/siu_pcm.c:546:8: error: expected '{' before 'const' Also, another inconsistency is that the declaration of siu_component misses the const prefix. This patch corrects both failures. Fixes: 932eaf7c7904 ("ASoC: sh: siu_pcm: remove snd_pcm_ops") Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25ASoC: tegra: ahub: Reset hardware properlyDmitry Osipenko2-4/+33
Assert hardware resets before clocks are enabled and then de-assert them after clocks are enabled. This brings hardware into a predictable state. Tested-by: Peter Geis <[email protected]> # Ouya T30 audio works Tested-by: Matt Merhar <[email protected]> # Ouya T30 boot-tested Tested-by: Dmitry Osipenko <[email protected]> # Nexus7 T30 audio works Tested-by: Nicolas Chauvet <[email protected]> # TK1 boot-tested Signed-off-by: Dmitry Osipenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25ASoC: tegra: ahub: Use clk_bulk helpersDmitry Osipenko2-25/+9
Use clk_bulk helpers to make code cleaner. Tested-by: Peter Geis <[email protected]> # Ouya T30 audio works Tested-by: Matt Merhar <[email protected]> # Ouya T30 boot-tested Tested-by: Dmitry Osipenko <[email protected]> # Nexus7 T30 audio works Tested-by: Nicolas Chauvet <[email protected]> # TK1 boot-tested Acked-by: Thierry Reding <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25ASoC: tegra: ahub: Add missing resetsDmitry Osipenko1-0/+2
AHUB driver misses D_AUDIO and APBIF resets. CPU hangs on trying to access hardware if resets aren't de-asserted. This problem is currently masked by the tegra-clk driver which implicitly de-asserts the resets when the corresponding clocks are enabled. Soon the implicit de-assertion will be gone from the tegra-clk driver, thus we need to fix the AHUB driver. Add the missing resets to the driver. Tested-by: Peter Geis <[email protected]> # Ouya T30 audio works Tested-by: Matt Merhar <[email protected]> # Ouya T30 boot-tested Tested-by: Dmitry Osipenko <[email protected]> # Nexus7 T30 audio works Tested-by: Nicolas Chauvet <[email protected]> # TK1 boot-tested Signed-off-by: Dmitry Osipenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25Merge series "ASoC: SOF: partial fix to Kconfig issues" from Pierre-Louis ↵Mark Brown3-10/+14
Bossart <[email protected]>: We've had several reports of broken dependencies. The 'right' fix is to revisit the module dependencies as suggested by Arnd Bergmann. This is WIP at https://github.com/thesofproject/linux/pull/2683. Since this is taking longer than expected, I am only sharing quick fixes for now. Pierre-Louis Bossart (2): ASoC: SOF: Intel: soundwire: fix select/depend unmet dependencies ASoC: SOF: SND_INTEL_DSP_CONFIG dependency sound/soc/sof/intel/Kconfig | 3 ++- sound/soc/sof/sof-acpi-dev.c | 11 ++++++----- sound/soc/sof/sof-pci-dev.c | 10 ++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) -- 2.25.1
2021-01-25ASoC: Intel: sof_sdw: set proper flags for Dell TGL-H SKU 0A5ELibin Yang1-0/+10
Add flag "SOF_RT711_JD_SRC_JD2", flag "SOF_RT715_DAI_ID_FIX" and "SOF_SDW_FOUR_SPK" to the Dell TGL-H based SKU "0A5E". Signed-off-by: Libin Yang <[email protected]> Co-developed-by: Hui Wang <[email protected]> Signed-off-by: Hui Wang <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25ASoC: qcom: lpass: Fix out-of-bounds DAI ID lookupStephan Gerhold1-1/+1
The "dai_id" given into LPAIF_INTFDMA_REG(...) is already the real DAI ID, not an index into v->dai_driver. Looking it up again seems entirely redundant. For IPQ806x (and SC7180 since commit 09a4f6f5d21c ("ASoC: dt-bindings: lpass: Fix and common up lpass dai ids") this is now often an out-of-bounds read because the indexes in the "dai_driver" array no longer match the actual DAI ID. Cc: Srinivasa Rao Mandadapu <[email protected]> Cc: Srinivas Kandagatla <[email protected]> Fixes: 7cb37b7bd0d3 ("ASoC: qcom: Add support for lpass hdmi driver") Signed-off-by: Stephan Gerhold <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25ASoC: mediatek: mt8192-mt6359: add format constraints for RT5682Tzung-Bi Shih1-0/+49
MT8192 determines the I2S clock rates according to the sampling rates. There is only 1 set of I2S in between MT8192 and RT5682. If playing and capturing via RT5682 in different sampling rates, the I2S data will be corrupted. Adds format constraints to the corresponding DAI links to make sure the sampling rates are symmetric. Fixes: 18b13ff23fab ("ASoC: mediatek: mt8192: add machine driver with mt6359, rt1015 and rt5682") Signed-off-by: Tzung-Bi Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25ASoC: ak4458: correct reset polarityEliot Blennerhassett1-15/+7
Reset (aka power off) happens when the reset gpio is made active. Change function name to ak4458_reset to match devicetree property "reset-gpios" Signed-off-by: Eliot Blennerhassett <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25ASoC: SOF: SND_INTEL_DSP_CONFIG dependencyPierre-Louis Bossart2-9/+12
The sof-pci-dev driver fails to link when built into the kernel and CONFIG_SND_INTEL_DSP_CONFIG is set to =m: arm-linux-gnueabi-ld: sound/soc/sof/sof-pci-dev.o: in function `sof_pci_probe': sof-pci-dev.c:(.text+0x1c): undefined reference to `snd_intel_dsp_driver_probe' As a temporary fix, use IS_REACHABLE to prevent the problem from happening. A more complete solution is to move this code to Intel-specific parts, restructure the drivers and Kconfig as discussed with Arnd Bergmann and Takashi Iwai. Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code") Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-25ASoC: SOF: Intel: soundwire: fix select/depend unmet dependenciesPierre-Louis Bossart1-1/+2
The LKP bot reports the following issue: WARNING: unmet direct dependencies detected for SOUNDWIRE_INTEL Depends on [m]: SOUNDWIRE [=m] && ACPI [=y] && SND_SOC [=y] Selected by [y]: - SND_SOC_SOF_INTEL_SOUNDWIRE [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_INTEL_TOPLEVEL [=y] && SND_SOC_SOF_INTEL_PCI [=y] This comes from having tristates being configured independently, when in practice the CONFIG_SOUNDWIRE needs to be aligned with the SOF choices: when the SOF code is compiled as built-in, the CONFIG_SOUNDWIRE also needs to be 'y'. The easiest fix is to replace the 'depends' with a 'select' and have a single user selection to activate SoundWire on Intel platforms. This still allows regmap to be compiled independently as a module. This is just a temporary fix, the select/depend usage will be revisited and the SOF Kconfig re-organized, as suggested by Arnd Bergman. Reported-by: kernel test robot <[email protected]> Fixes: a115ab9b8b93e ('ASoC: SOF: Intel: add build support for SoundWire') Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: Intel: Skylake: Zero snd_ctl_elem_valueRicardo Ribalda1-1/+1
Clear struct snd_ctl_elem_value before calling ->put() to avoid any data leak. Signed-off-by: Ricardo Ribalda <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_completeRicardo Ribalda1-6/+7
If dobj->control is not initialized we end up in an OOPs during skl_tplg_complete: [ 26.553358] BUG: kernel NULL pointer dereference, address: 0000000000000078 [ 26.561151] #PF: supervisor read access in kernel mode [ 26.566897] #PF: error_code(0x0000) - not-present page [ 26.572642] PGD 0 P4D 0 [ 26.575479] Oops: 0000 [#1] PREEMPT SMP PTI [ 26.580158] CPU: 2 PID: 2082 Comm: udevd Tainted: G C 5.4.81 #4 [ 26.588232] Hardware name: HP Soraka/Soraka, BIOS Google_Soraka.10431.106.0 12/03/2019 [ 26.597082] RIP: 0010:skl_tplg_complete+0x70/0x144 [snd_soc_skl] Fixes: 2d744ecf2b98 ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHL") Signed-off-by: Ricardo Ribalda <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Tested-by: Lukasz Majczak <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21Merge series "Add sanity checks for topology API calls" from Amadeusz ↵Mark Brown1-7/+15
Sławiński<[email protected]>: Topology API exposes just 2 function calls, to load and unload topology. This adds sanity checks to make sure that it behaves well when some of parameters are set incoorectly or not needed. This makes developer live easier by failing early instead of proceeding on and then failing in unexpected ways. As loading and unloading topology usually happens one the overhead of additional checks should be negligible. Amadeusz Sławiński (2): ASoC: topology: Ensure that needed parameters are set ASoC: topology: Check if ops is set before dereference sound/soc/soc-topology.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) -- 2.25.1
2021-01-21Merge series "ASoC: sync parameter naming : rate / sample_bits" from ↵Mark Brown116-283/+253
Kuninori Morimoto <[email protected]>: Hi Mark snd_pcm_runtime / snd_soc_dai / snd_soc_dai_driver / snd_soc_dai_link have related parameter which is similar but not same naming. struct snd_pcm_runtime { ... (A) unsigned int rate; ... (B) unsigned int sample_bits; ... }; struct snd_soc_dai { ... (A) unsigned int rate; (B) unsigned int sample_bits; ... }; struct snd_soc_dai_driver { ... (A) unsigned int symmetric_rates:1; (B) unsigned int symmetric_samplebits:1; ... }; struct snd_soc_dai_link { ... (A) unsigned int symmetric_rates:1; (B) unsigned int symmetric_samplebits:1; ... }; Because it is similar but not same naming rule, code can be verbose / can't share macro. This patch-set sync naming rule to struct snd_pcm_runtime base. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Kuninori Morimoto (44): ASoC: soc-pcm: revert soc_pcm_apply_symmetry() ASoC: sync parameter naming : rate / sample_bits ASoC: adi: sync parameter naming (rate/sample_bits) ASoC: atmel: sync parameter naming (rate/sample_bits) ASoC: au1x: sync parameter naming (rate/sample_bits) ASoC: bcm: sync parameter naming (rate/sample_bits) ASoC: cirrus: sync parameter naming (rate/sample_bits) ASoC: tegra: sync parameter naming (rate/sample_bits) ASoC: rockchip: sync parameter naming (rate/sample_bits) ASoC: samsung: sync parameter naming (rate/sample_bits) ASoC: sh: sync parameter naming (rate/sample_bits) ASoC: ti: sync parameter naming (rate/sample_bits) ASoC: pxa: sync parameter naming (rate/sample_bits) ASoC: mediatek: sync parameter naming (rate/sample_bits) ASoC: fsl: sync parameter naming (rate/sample_bits) ASoC: wm*: sync parameter naming (rate/sample_bits) ASoC: tlv*: sync parameter naming (rate/sample_bits) ASoC: rt*: sync parameter naming (rate/sample_bits) ASoC: nau*: sync parameter naming (rate/sample_bits) ASoC: tas*: sync parameter naming (rate/sample_bits) ASoC: da*: sync parameter naming (rate/sample_bits) ASoC: es*: sync parameter naming (rate/sample_bits) ASoC: max*: sync parameter naming (rate/sample_bits) ASoC: cs*: sync parameter naming (rate/sample_bits) ASoC: tscs*: sync parameter naming (rate/sample_bits) ASoC: ak*: sync parameter naming (rate/sample_bits) ASoC: adau*: sync parameter naming (rate/sample_bits) ASoC: jz4740: sync parameter naming (rate/sample_bits) ASoC: sunxi: sync parameter naming (rate/sample_bits) ASoC: zl38060: sync parameter naming (rate/sample_bits) ASoC: ssm2602: sync parameter naming (rate/sample_bits) ASoC: sgtl5000: sync parameter naming (rate/sample_bits) ASoC: mc13783: sync parameter naming (rate/sample_bits) ASoC: mt6660: sync parameter naming (rate/sample_bits) ASoC: lochnagar-sc: sync parameter naming (rate/sample_bits) ASoC: ab8500: sync parameter naming (rate/sample_bits) ASoC: alc5632: sync parameter naming (rate/sample_bits) ASoC: cx2072x: sync parameter naming (rate/sample_bits) ASoC: inno_rk3036: sync parameter naming (rate/sample_bits) ASoC: lm49453: sync parameter naming (rate/sample_bits) ASoC: ml26124: sync parameter naming (rate/sample_bits) ASoC: soc-dai.h: remove symmetric_rates/samplebits ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry() ASoC: soc-pcm: cleanup soc_pcm_params_symmetry() include/sound/soc-dai.h | 4 +- include/sound/soc.h | 4 +- sound/soc/adi/axi-i2s.c | 2 +- sound/soc/atmel/atmel-i2s.c | 2 +- sound/soc/atmel/mchp-i2s-mcc.c | 4 +- sound/soc/au1x/i2sc.c | 2 +- sound/soc/bcm/bcm2835-i2s.c | 4 +- sound/soc/bcm/bcm63xx-i2s-whistler.c | 2 +- sound/soc/cirrus/ep93xx-i2s.c | 2 +- sound/soc/codecs/ab8500-codec.c | 4 +- sound/soc/codecs/adau1372.c | 2 +- sound/soc/codecs/adau1373.c | 6 +- sound/soc/codecs/adau1701.c | 2 +- sound/soc/codecs/ak4554.c | 2 +- sound/soc/codecs/ak4613.c | 2 +- sound/soc/codecs/ak4641.c | 4 +- sound/soc/codecs/ak4642.c | 2 +- sound/soc/codecs/alc5632.c | 2 +- sound/soc/codecs/cs35l32.c | 2 +- sound/soc/codecs/cs35l33.c | 2 +- sound/soc/codecs/cs35l34.c | 2 +- sound/soc/codecs/cs35l35.c | 2 +- sound/soc/codecs/cs35l36.c | 2 +- sound/soc/codecs/cs4234.c | 2 +- sound/soc/codecs/cs4271.c | 2 +- sound/soc/codecs/cs42l73.c | 6 +- sound/soc/codecs/cs43130.c | 6 +- sound/soc/codecs/cs4341.c | 2 +- sound/soc/codecs/cs4349.c | 2 +- sound/soc/codecs/cs47l15.c | 12 ++-- sound/soc/codecs/cs47l24.c | 12 ++-- sound/soc/codecs/cs47l35.c | 12 ++-- sound/soc/codecs/cs47l85.c | 16 ++--- sound/soc/codecs/cs47l90.c | 16 ++--- sound/soc/codecs/cs47l92.c | 12 ++-- sound/soc/codecs/cs53l30.c | 2 +- sound/soc/codecs/cx2072x.c | 2 +- sound/soc/codecs/da7210.c | 2 +- sound/soc/codecs/da7213.c | 2 +- sound/soc/codecs/da7218.c | 4 +- sound/soc/codecs/da7219.c | 4 +- sound/soc/codecs/da9055.c | 2 +- sound/soc/codecs/es8316.c | 2 +- sound/soc/codecs/es8328.c | 2 +- sound/soc/codecs/inno_rk3036.c | 2 +- sound/soc/codecs/jz4740.c | 2 +- sound/soc/codecs/lm49453.c | 2 +- sound/soc/codecs/lochnagar-sc.c | 12 ++-- sound/soc/codecs/max9860.c | 2 +- sound/soc/codecs/max9867.c | 2 +- sound/soc/codecs/mc13783.c | 2 +- sound/soc/codecs/ml26124.c | 2 +- sound/soc/codecs/mt6660.c | 4 +- sound/soc/codecs/nau8810.c | 2 +- sound/soc/codecs/nau8822.c | 2 +- sound/soc/codecs/rt274.c | 2 +- sound/soc/codecs/rt286.c | 4 +- sound/soc/codecs/rt298.c | 4 +- sound/soc/codecs/rt5670.c | 4 +- sound/soc/codecs/sgtl5000.c | 2 +- sound/soc/codecs/ssm2602.c | 4 +- sound/soc/codecs/tas2764.c | 2 +- sound/soc/codecs/tas2770.c | 2 +- sound/soc/codecs/tlv320adcx140.c | 2 +- sound/soc/codecs/tlv320aic31xx.c | 4 +- sound/soc/codecs/tlv320aic32x4.c | 2 +- sound/soc/codecs/tlv320aic3x.c | 2 +- sound/soc/codecs/tscs42xx.c | 4 +- sound/soc/codecs/tscs454.c | 12 ++-- sound/soc/codecs/wm5102.c | 12 ++-- sound/soc/codecs/wm5110.c | 12 ++-- sound/soc/codecs/wm8510.c | 2 +- sound/soc/codecs/wm8731.c | 2 +- sound/soc/codecs/wm8770.c | 2 +- sound/soc/codecs/wm8804.c | 2 +- sound/soc/codecs/wm8903.c | 2 +- sound/soc/codecs/wm8904.c | 2 +- sound/soc/codecs/wm8940.c | 2 +- sound/soc/codecs/wm8960.c | 2 +- sound/soc/codecs/wm8962.c | 2 +- sound/soc/codecs/wm8974.c | 2 +- sound/soc/codecs/wm8978.c | 2 +- sound/soc/codecs/wm8983.c | 2 +- sound/soc/codecs/wm8985.c | 2 +- sound/soc/codecs/wm8988.c | 2 +- sound/soc/codecs/wm8993.c | 2 +- sound/soc/codecs/wm8994.c | 4 +- sound/soc/codecs/wm8997.c | 8 +-- sound/soc/codecs/wm8998.c | 12 ++-- sound/soc/codecs/wm9713.c | 2 +- sound/soc/codecs/zl38060.c | 4 +- sound/soc/fsl/fsl_esai.c | 4 +- sound/soc/fsl/fsl_sai.c | 8 +-- sound/soc/fsl/fsl_ssi.c | 4 +- sound/soc/jz4740/jz4740-i2s.c | 2 +- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 10 +-- sound/soc/mediatek/mt6797/mt6797-dai-pcm.c | 8 +-- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 2 +- sound/soc/mediatek/mt8183/mt8183-dai-pcm.c | 8 +-- sound/soc/mediatek/mt8192/mt8192-dai-pcm.c | 8 +-- sound/soc/pxa/pxa2xx-i2s.c | 2 +- sound/soc/rockchip/rockchip_i2s.c | 4 +- sound/soc/rockchip/rockchip_pdm.c | 2 +- sound/soc/samsung/i2s.c | 2 +- sound/soc/samsung/pcm.c | 2 +- sound/soc/sh/rcar/core.c | 4 +- sound/soc/soc-pcm.c | 80 +++++++--------------- sound/soc/soc-topology.c | 8 +-- sound/soc/sunxi/sun4i-i2s.c | 2 +- sound/soc/sunxi/sun8i-codec.c | 12 ++-- sound/soc/tegra/tegra186_dspk.c | 2 +- sound/soc/tegra/tegra20_i2s.c | 2 +- sound/soc/tegra/tegra210_dmic.c | 2 +- sound/soc/tegra/tegra210_i2s.c | 2 +- sound/soc/tegra/tegra30_i2s.c | 2 +- sound/soc/ti/davinci-mcasp.c | 2 +- 116 files changed, 253 insertions(+), 283 deletions(-) -- 2.25.1
2021-01-21Merge series "Add KUNIT tests for ASoC topology" from Amadeusz ↵Mark Brown3-0/+865
Sławiński<[email protected]>: This series adds unit tests for ASoC topology. First fix problems found when developing and running test cases and then add tests implementation. Tests themselves are quite simple and just call snd_soc_tplg_component_load() with various parameters and check the result. Tests themselves are described in more detail in commits adding them. Goal is to expand the amount of test cases in following patches. Prerequisity for this patchset are 2 patches which have already been sent: https://lore.kernel.org/alsa-devel/[email protected]/T/#t Description on how typical test case itself works: In order to load topology we need to have 3 things: card, codec component & platform component. In typical test case we register card and platform component and bind to dummy codec. There are of course execeptions, when we want to test behaviour of topology API when component or card is missing. Note that this is bit different from typical scenario (in SOF and skylake drivers) where card is registered by machine driver and component by platform driver, as we register both when setting up test. If you check the test case most of them have similar architecture of: 1. /* run test */ ret = snd_soc_register_card(&kunit_comp->card); if (ret != 0 && ret != -EPROBE_DEFER) KUNIT_FAIL(test, "Failed to register card"); 2. ret = snd_soc_component_initialize(&kunit_comp->comp, &test_component, test_dev); KUNIT_EXPECT_EQ(test, 0, ret); 3. ret = snd_soc_add_component(&kunit_comp->comp, NULL, 0); KUNIT_EXPECT_EQ(test, 0, ret); Ad. 1. First we register card, which in most tests returns -EPROBE_DEFER (from snd_soc_bind_card()), as platform component is not yet created. I test for both 0 and -EPROBE_DEFER, as it makes it easier to reshuffle this code around if needed and there is one test case which does it in different order. Ad. 2. Then we initialize platform component with structure pointing at proper probe function, which calls snd_soc_tplg_component_load() with test parameters and checks expected result. Ad. 3. And then in follow up we call snd_soc_add_component() which creates platform component for us and calls snd_soc_try_rebind_card() which if everything is bound properly calls previously set probe function. Amadeusz Sławiński (5): ASoC: topology: Properly unregister DAI on removal Revert "ASoC: soc-devres: add devm_snd_soc_register_dai()" ASoC: topology: KUnit: Add KUnit tests passing various arguments to snd_soc_tplg_component_load ASoC: topology: KUnit: Add KUnit tests passing empty topology with variants to snd_soc_tplg_component_load ASoC: topology: KUnit: Add KUnit tests passing topology with PCM to snd_soc_tplg_component_load include/sound/soc.h | 4 - sound/soc/Kconfig | 17 + sound/soc/Makefile | 5 + sound/soc/soc-devres.c | 37 -- sound/soc/soc-topology-test.c | 843 ++++++++++++++++++++++++++++++++++ sound/soc/soc-topology.c | 9 +- 6 files changed, 870 insertions(+), 45 deletions(-) create mode 100644 sound/soc/soc-topology-test.c -- 2.25.1
2021-01-21ASoC: rt5682: remove connection with LDO2 in DAPM graphShuming Fan1-2/+0
The application circuit shall provide MICVDD power. In default, the codec driver doesn't need to enable LDO2. In case, a board wants to use VBAT for micbias, it should add a DAPM route which IN1P connects with LDO2 in the machine driver. e.g. { "IN1P", NULL, "LDO2" }, Signed-off-by: Shuming Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: soc-pcm: cleanup soc_pcm_params_symmetry()Kuninori Morimoto1-45/+15
soc_pcm_params_symmetry() checks rate/channel/sample_bits state. These are very similar but different, thus, it needs to have very verbose code. This patch use macro for it and make code more simple. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()Kuninori Morimoto1-47/+20
soc_pcm_apply_symmetry() want to call snd_pcm_hw_constraint_single() for rate/channel/sample_bits, but, it needs many condition checks. These are very similar but different, thus, it needs to have very verbose code. This patch use macro for it and make code more simple. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: soc-dai.h: remove symmetric_rates/samplebitsKuninori Morimoto2-11/+0
All drivers are using new name. Let's remove old one. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: ml26124: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-1/+1
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: lm49453: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-1/+1
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: inno_rk3036: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-1/+1
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: cx2072x: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-1/+1
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: alc5632: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-1/+1
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: ab8500: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-2/+2
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: lochnagar-sc: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-6/+6
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: mt6660: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-2/+2
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-01-21ASoC: mc13783: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-1/+1
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>