summaryrefslogtreecommitdiff
path: root/sound/soc
AgeCommit message (Collapse)AuthorFilesLines
2022-09-19ASoC: tas2770: Reinit regcache on resetMartin Povišer1-0/+3
On probe of the ASoC component, the device is reset but the regcache is retained. This means the regcache gets out of sync if the codec is rebound to a sound card for a second time. Fix it by reinitializing the regcache to defaults after the device is reset. Fixes: b0bcbe615756 ("ASoC: tas2770: Fix calling reset in probe") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220919173453.84292-1-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-19ASoC: nau8824: Fix semaphore is released unexpectedlySJLIN02-3/+15
On resuming, we anticipate that the jack is detected before playback or capture. Therefore, we use semaphore to control the jack detection done without any bothering. During booting, the driver launches jack detection and releases the semaphore. However, it doesn't perceive the maniputation of semaphore is not like resuming procedure. This makes the semaphore's count value become to 2. There is more than one thread can enter into the critical section. This may get unexpected situation and make some chaos. Signed-off-by: SJLIN0 <SJLIN0@nuvoton.com> Signed-off-by: Wallace Lin <savagecin@gmail.com> Link: https://lore.kernel.org/r/20220915012800.825196-1-SJLIN0@nuvoton.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-19ASoC: Intel: sof_sdw: add support for Dell SKU 0AFFPierre-Louis Bossart1-0/+10
Yet another SKU that needs a quirk for jack detection and four-speaker support. BugLink: https://github.com/thesofproject/linux/issues/3777 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220919114640.42803-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-13ASoC: imx-card: Fix refcount issue with of_node_putShengjiu Wang1-0/+4
imx_card_parse_of will search all the node with loop, if there is defer probe happen in the middle of loop, the previous released codec node will be released twice, then cause refcount issue. Here assign NULL to pointer of released nodes to fix the issue. Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1663059601-29259-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-12ASoC: rt5640: Fix the issue of the abnormal JD2 statusOder Chiou2-19/+59
The patch fixes the issue of the abnormal JD2 status. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Reported-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/20220912072931.1856-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-25ASoC: fsl_aud2htx: Add error handler for pm_runtime_enableShengjiu Wang1-0/+2
Call pm_runtime_disable() when error happens in probe() Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1661430460-5234-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-25ASoC: fsl_aud2htx: register platform component before registering cpu daiShengjiu Wang1-4/+10
There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. And the behavior of imx_pcm_dma_init() is same as common devm_snd_dmaengine_pcm_register(), so use devm_snd_dmaengine_pcm_register() instead Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1661430460-5234-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: nau8xxx: Implement hw constraint for ratesMark Brown4-113/+156
Merge series from Takashi Iwai <tiwai@suse.de>: This is a series of patches to address the issues on nau8xxx codecs I've stumbled upon while dealing with a bug report for Steam Deck. Most of them are to implement the missing hw constraint for rate restrictions while one patch is to fix the semaphore unbalance in nau8824 driver.
2022-08-23ASoC: SOF: Kconfig: Fix the dependency for client modulesMark Brown1-0/+2
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: There is still a chance to end up with a client driver selected as built in while the core SOF is as module. Fix this by making the client drivers depend on SND_SOC_SOF.
2022-08-23ASoC: SOF: ipc4-topology: fix alh_group_ida max valueBard Liao1-1/+1
group_id is from 0 ~ ALH_MULTI_GTW_COUNT - 1, not 0 ~ ALH_MULTI_GTW_COUNT. Fixes: a150345aa7584 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220822190211.170537-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversionNathan Chancellor1-1/+1
A recent change in clang strengthened its -Wbitfield-constant-conversion to warn when 1 is assigned to a 1-bit signed integer bitfield, as it can only be 0 or -1, not 1: sound/soc/atmel/mchp-spdiftx.c:505:20: error: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-conversion] dev->gclk_enabled = 1; ^ ~ 1 error generated. The actual value of the field is never checked, just that it is not zero, so there is not a real bug here. However, it is simple enough to silence the warning by making the bitfield unsigned, which matches the mchp-spdifrx driver. Fixes: 06ca24e98e6b ("ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller") Link: https://github.com/ClangBuiltLinux/linux/issues/1686 Link: https://github.com/llvm/llvm-project/commit/82afc9b169a67e8b8a1862fb9c41a2cd974d6691 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/r/20220810010809.2024482-1-nathan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: SOF: Kconfig: Make IPC_MESSAGE_INJECTOR depend on SND_SOC_SOFPeter Ujfalusi1-0/+1
Make sure that the IPC_MESSAGE_INJECTOR client can not be built in when SND_SOC_SOF is built as module. Fixes: cac0b0887e530 ("ASoC: SOF: Convert the generic IPC message injector into SOF client") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220823121554.4255-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: SOF: Kconfig: Make IPC_FLOOD_TEST depend on SND_SOC_SOFPeter Ujfalusi1-0/+1
Make sure that the IPC_FLOOD client can not be built in when SND_SOC_SOF is built as module. Fixes: 6e9548cdb30e5 ("ASoC: SOF: Convert the generic IPC flood test into SOF client") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220823121554.4255-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: fsl_mqs: Fix supported clock DAI formatShengjiu Wang1-1/+1
The MQS works as codec DAI, not cpu DAI. It is clock consumer, not clock privider. Fixes: 3b14c15a333b ("ASoC: fsl: Update to use set_fmt_new callback") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1661247308-2650-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: nau8540: Implement hw constraint for ratesTakashi Iwai1-11/+29
nau8540 driver restricts the sample rate with over sampling rate, but currently it barely bails out at hw_params with -EINVAL error (with a kernel message); this doesn't help for user-space to recognize which rate can be actually used. This patch introduces the proper hw constraint for adjusting the available range of the sample rate depending on the OSR setup, as well as some code cleanup, for improving the communication with user-space. Now applications can know the valid rate beforehand and reduces the rate appropriately without errors. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220823081000.2965-6-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: nau8825: Implement hw constraint for ratesTakashi Iwai1-38/+45
nau8825 driver restricts the sample rate with over sampling rate, but currently it barely bails out at hw_params with -EINVAL error (with a kernel message); this doesn't help for user-space to recognize which rate can be actually used. This patch introduces the proper hw constraint for adjusting the available range of the sample rate depending on the OSR setup, as well as some code cleanup, for improving the communication with user-space. Now applications can know the valid rate beforehand and reduces the rate appropriately without errors. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220823081000.2965-5-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: nau8824: Implement hw constraint for ratesTakashi Iwai1-29/+38
nau8824 driver restricts the sample rate with over sampling rate, but currently it barely bails out at hw_params with -EINVAL error (with a kernel message); this doesn't help for user-space to recognize which rate can be actually used. This patch introduces the proper hw constraint for adjusting the available range of the sample rate depending on the OSR setup, as well as some code cleanup, for improving the communication with user-space. Now applications can know the valid rate beforehand and reduces the rate appropriately without errors. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220823081000.2965-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: nau8824: Fix semaphore unbalance at error pathsTakashi Iwai1-7/+10
The semaphore of nau8824 wasn't properly unlocked at some error handling code paths, hence this may result in the unbalance (and potential lock-up). Fix them to handle the semaphore up properly. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220823081000.2965-3-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23ASoC: nau8821: Implement hw constraint for ratesTakashi Iwai1-30/+36
nau8821 driver restricts the sample rate with over sampling rate, but currently it barely bails out at hw_params with -EINVAL error (with a kernel message); this doesn't help for user-space to recognize which rate can be actually used. This patch introduces the proper hw constraint for adjusting the available range of the sample rate depending on the OSR setup, as well as some code cleanup, for improving the communication with user-space. Now applications can know the valid rate beforehand and reduces the rate appropriately without errors. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220823081000.2965-2-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-22ASoC: mediatek: mt8186: fix DMIC record noiseJiaxin Yu1-3/+0
When the first DMIC recording is power down, mtkaif_dmic will be reset. This will cause configuration error in the second DMIC recording. So do not reset mtkaif_dmic except in "MTKAIF_DMIC Switch" kcontrol. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/20220820071925.13557-1-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-18ASoC: SOF: ipc4-topology: fix wrong use of sizeof in ↵Yang Yingliang1-1/+1
sof_ipc4_widget_setup_comp_src() It should be size of the struct sof_ipc4_src, not data pointer pass to sof_update_ipc_object(). Fixes: b85f4fc40d56 ("ASoC: SOF: add ipc4 SRC module support") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220818081751.2407066-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-17ASoC: qcom: sm8250: add missing module ownerSrinivas Kandagatla1-0/+1
Add missing module owner to able to build and load this driver as module. Fixes: aa2e2785545a ("ASoC: qcom: sm8250: add sound card qrb5165-rb5 support") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20220816165229.7971-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-16ASoC: fsl_sai: fix incorrect mclk number in error messagePieterjan Camerlynck1-1/+1
In commit c3ecef21c3f26 ("ASoC: fsl_sai: add sai master mode support") the loop was changed to start iterating from 1 instead of 0. The error message however was not updated, reporting the wrong clock to the user. Signed-off-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220813083353.8959-1-pieterjan.camerlynck@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-15ASoC: cs42l42: Only report button state if there was a button interruptRichard Fitzgerald1-6/+7
Only report a button state change if the interrupt status shows that there was a button event. Previously the code would always drop into the button reporting at the end of interrupt handling if the jack was present. If neither of the button report interrupts were pending it would report all buttons released. This could then lead to a button being reported as released while it is still pressed. Fixes: c5b8ee0879bc ("ASoC: cs42l42: Report jack and button detection") Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220815123138.3810249-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-15Merge remote-tracking branch 'asoc/for-5.20' into asoc-6.0Mark Brown12-76/+116
2022-08-10ASoC: codec: tlv320aic32x4: fix mono playback via I2SPhilipp Zabel1-0/+9
The two commits referenced below break mono playback via I2S DAI because they set BCLK to half the required speed. For PCM transport over I2S, the number of transmitted channels is always 2, even for mono playback. Fixes: dcd79364bff3 ("ASoC: codec: tlv3204: Enable 24 bit audio support") Fixes: 40b37136287b ("ASoC: tlv320aic32x4: Fix bdiv clock rate derivation") Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.kernel.org/r/20220810104156.665452-1-p.zabel@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-10TAS2770 fixesMark Brown2-55/+48
Merge series from Martin Povišer <povik+lin@cutebit.org>: The first two fixes should be straightforward. The latter two clean up what looks to me like a mess in the setting of power levels. However we settle it, we should then do the same changes to TAS2764, which has the same template (and maybe there are other drivers).
2022-08-08ASoC: rt5640: Fix the JD voltage dropping issueOder Chiou1-2/+3
The patch fixes the JD voltage dropping issue in the HDA JD using. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Reported-by: Mohan Kumar D <mkumard@nvidia.com> Link: https://lore.kernel.org/r/20220808052836.25791-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-08ASoC: tas2770: Fix handling of mute/unmuteMartin Povišer2-27/+32
Because the PWR_CTRL field is modeled as the power state of the DAC widget, and at the same time it is used to implement mute/unmute, we need some additional book-keeping to have the right end result no matter the sequence of calls. Without this fix, one can mute an ongoing stream by toggling a speaker pin control. Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220808141246.5749-5-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-08ASoC: tas2770: Drop conflicting set_bias_level power settingMartin Povišer1-33/+0
The driver is setting the PWR_CTRL field in both the set_bias_level callback and on DAPM events of the DAC widget (and also in the mute_stream method). Drop the set_bias_level callback altogether as the power setting it does is in conflict with the other code paths. Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220808141246.5749-4-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-08ASoC: tas2770: Allow mono streamsMartin Povišer1-1/+1
The part is a mono speaker amp, but it can do downmix and switch between left and right channel, so the right channel range is 1 to 2. Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220808141246.5749-3-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-08ASoC: tas2770: Set correct FSYNC polarityMartin Povišer2-1/+22
Fix setting of FSYNC polarity for DAI formats other than I2S. Also add support for polarity inversion. Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220808141246.5749-2-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-06Merge tag 'sound-6.0-rc1' of ↵Linus Torvalds660-3453/+33736
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "As the diffstat shows, we've had lots of developments in a wide range at this time; the majority of changes are about ASoC, including subsystem-wide cleanups, continued SOF / Intel updates and a bunch of new drivers (as usual), while there have been some significant (but almost invisible) improvements in ALSA core side, too. Below are some highlights: Core: - Faster lookups of control elements with Xarray; normal user won't notice, but on the devices with tons of control elements, it can be visibly faster - Support for input validation for controls; this will harden for badly written drivers in general with a slight overhead - Deferred async signal handling for working around the potential deadlocks - Cleanup / refactoring raw MIDI locking code ASoC: - Restructing of the set_fmt() callbacks for making things clearer in situations like CODEC to CODEC links - Clean up and modernizing the DAI naming scheme setups - Merge of more of the Intel AVS driver stack, including some board integrations - New version 4 mechanism for communication with SOF DSPs - Suppoort for dynamically selecting the PLL to use at runtime on i.MX platforms - Improvements for CODEC to CODEC support in the generic cards - Support for AMD Jadeite and various machines, AMD RPL, Intel MetorLake DSPs, Mediatek MT8186 DSPs and MT6366, nVidia Tegra MDDRC, OPE and PEQ, NXP TFA9890, Qualcomm SDM845, WCD9335 and WAS883x, and Texas Instruments TAS2780 HD- and USB-audio: - Continued improvement for CS35L41 (sub)codec support - More quirks for various devices (HP, Lenovo, Dell, Clevo)" * tag 'sound-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (778 commits) ALSA: hda/realtek: Add quirk for HP Spectre x360 15-eb0xxx ALSA: line6: Replace sprintf() with sysfs_emit() ALSA: hda: Replace sprintf() with sysfs_emit() ALSA: pcm: Replace sprintf() with sysfs_emit() ALSA: core: Replace scnprintf() with sysfs_emit() ALSA: control-led: Replace sprintf() with sysfs_emit() ALSA: aoa: Replace sprintf() with sysfs_emit() ALSA: ac97: Replace sprintf() with sysfs_emit() ALSA: hda/realtek: Add quirk for Clevo NV45PZ ALSA: hda/realtek: Add quirk for Lenovo Yoga9 14IAP7 ALSA: control: Use deferred fasync helper ALSA: pcm: Use deferred fasync helper ALSA: timer: Use deferred fasync helper ALSA: core: Add async signal helpers ASoC: q6asm: use kcalloc() instead of kzalloc() ACPI: scan: Add CLSA0101 Laptop Support ALSA: hda: cs35l41: Support CLSA0101 ALSA: hda: cs35l41: Use the CS35L41 HDA internal define ASoC: dt-bindings: use spi-peripheral-props.yaml ASoC: codecs: va-macro: use fsgen as clock ...
2022-08-05ASoC: Intel: fix sof_es8336 probePierre-Louis Bossart1-1/+3
Changes to add HDMI capture support broke the machine driver probe for all other platforms. The commit listed in the Fixes tag added a board_id descriptor but didn't add the default name for the sof_essx8336 machine driver. Add the missing entry and remove the now-useless platform driver alias. Reported-by: Eugene J Markow <ejmarkow@yahoo.com> BugLink: https://github.com/thesofproject/linux/issues/3336 Fixes: 86b1959a2ccb ("ASoC: Intel: sof_es8336: add support for HDMI_In capture") Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220805133332.207932-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-05ASoC: Fix theoretical buffer overflow by snprintf()Mark Brown3-6/+6
Merge series from Takashi Iwai <tiwai@suse.de>: This is a patch series to paper over the theoretical buffer overflow that might be caused by snprintf(). snprintf() is notorious for its behavior and the usage of a safer version, scnprintf(), is recommended.
2022-08-05ASoC: DPCM: Don't pick up BE without substreamTakashi Iwai1-0/+3
When DPCM tries to add valid BE connections at dpcm_add_paths(), it doesn't check whether the picked BE actually supports for the given stream direction. Due to that, when an asymmetric BE stream is present, it picks up wrongly and this may result in a NULL dereference at a later point where the code assumes the existence of a corresponding BE substream. This patch adds the check for the presence of the substream for the target BE for avoiding the problem above. Note that we have already some fix for non-existing BE substream at commit 6246f283d5e0 ("ASoC: dpcm: skip missing substream while applying symmetry"). But the code path we've hit recently is rather happening before the previous fix. So this patch tries to fix at picking up a BE instead of parsing BE lists. Fixes: bbf7d3b1c4f4 ("ASoC: soc-pcm: align BE 'atomicity' with that of the FE") Reported-by: Alex Natalsson <harmoniesworlds@gmail.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/CADs9LoPZH_D+eJ9qjTxSLE5jGyhKsjMN7g2NighZ16biVxsyKw@mail.gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220801170510.26582-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-05ASoC: SOF: ipc3-topology: Fix clang -Wformat warningJustin Stitt1-1/+1
When building with Clang we encounter these warnings: | sound/soc/sof/ipc3-topology.c:2343:4: error: format specifies type | 'unsigned char' but the argument has type 'int' [-Werror,-Wformat] | SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH); | ^~~~~~~~~~~~~~~^~~~~~~~~~~~~~~^~~~~~~~~~~~~ Use correct format specifier `%d` since args are of type int. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Reported-by: Nathan Chancellor <nathan@kernel.org> Suggested-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Justin Stitt <justinstitt@google.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220803204442.2996580-1-justinstitt@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-05ASoC: sh: rz-ssi: Improve error handling in rz_ssi_probe() error pathBiju Das1-11/+15
We usually do cleanup in reverse order of init. Currently in case of error rz_ssi_release_dma_channels() done in the reverse order. This patch improves error handling in rz_ssi_probe() error path. While at it, use "goto cleanup" style to reduce code duplication. Reported-by: Pavel Machek <pavel@denx.de> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20220728092612.38858-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-05ASoC: SOF: Intel: hda: Fix potential buffer overflow by snprintf()Takashi Iwai1-1/+1
snprintf() returns the would-be-filled size when the string overflows the given buffer size, hence using this value may result in the buffer overflow (although it's unrealistic). This patch replaces with a safer version, scnprintf() for papering over such a potential issue. Fixes: 29c8e4398f02 ("ASoC: SOF: Intel: hda: add extended rom status dump to error log") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220801165420.25978-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-05ASoC: SOF: debug: Fix potential buffer overflow by snprintf()Takashi Iwai1-3/+3
snprintf() returns the would-be-filled size when the string overflows the given buffer size, hence using this value may result in the buffer overflow (although it's unrealistic). This patch replaces with a safer version, scnprintf() for papering over such a potential issue. Fixes: 5b10b6298921 ("ASoC: SOF: Add `memory_info` file to debugfs") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220801165420.25978-3-tiwai@suse.de 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-08-04Merge tag 'spdx-6.0-rc1' of ↵Linus Torvalds3-36/+6
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx Pull SPDX updates from Greg KH: "Here is the set of SPDX comment updates for 6.0-rc1. Nothing huge here, just a number of updated SPDX license tags and cleanups based on the review of a number of common patterns in GPLv2 boilerplate text. Also included in here are a few other minor updates, two USB files, and one Documentation file update to get the SPDX lines correct. All of these have been in the linux-next tree for a very long time" * tag 'spdx-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx: (28 commits) Documentation: samsung-s3c24xx: Add blank line after SPDX directive x86/crypto: Remove stray comment terminator treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_406.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_398.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_391.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_390.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_385.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_320.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_319.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_318.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_298.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_292.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_179.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_168.RULE (part 2) treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_168.RULE (part 1) treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_160.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_152.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_149.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_147.RULE treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_133.RULE ...
2022-08-02ASoC: amd: yc: Update DMI table entries for AMD platformssyed sabakareem1-0/+28
Updated DMI entries 21EM, 21EN, 21J5 and 21J6 for AMD platforms P15v Gen 3 and P14s Gen 3. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216267 Signed-off-by: syed saba kareem <Syed.SabaKareem@amd.com> Reported-by: Pananchikkal Renjith <renjith.pananchikkal@amd.com> Link: https://lore.kernel.org/r/20220802062503.159328-1-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-01Merge tag 'asoc-v5.20-2' of ↵Takashi Iwai76-605/+6875
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: More updates for v5.20 More updates that came in since the last pull request I sent, a series of driver specific changes: - Support for AMD RPL, some Intel platforms and Mediatek MT8186.
2022-08-01Merge branch 'for-next' into for-linusTakashi Iwai620-3022/+27028
2022-07-28ASoC: q6asm: use kcalloc() instead of kzalloc()Gustavo A. R. Silva1-1/+1
Use 2-factor multiplication argument form kcalloc() instead of kzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20211006180810.GA913370@embeddedor Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-28ASoC: atmel: one fix and one cleanupMark Brown2-11/+6
Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>: Hi, The series adds one fix for mchp-spdifrx and one cleanups for mchp-spdifrx and mchp-spdifrx drivers. Thank you, Claudiu Beznea Changes in v3: - changed cover letter title s/few/one, s/cleanups/cleanup - fix compilation error and warnings - keep only patch 1/5 and patch 3/5 from previous version as the rest of them were integrated Changes in v2: - s/tag/tab in the title of patch 2/5 Claudiu Beznea (2): ASoC: mchp-spdifrx: disable end of block interrupt on failures ASoC: mchp-spdiftx: remove references to mchp_i2s_caps sound/soc/atmel/mchp-spdifrx.c | 9 ++++++--- sound/soc/atmel/mchp-spdiftx.c | 8 -------- 2 files changed, 6 insertions(+), 11 deletions(-) -- 2.34.1
2022-07-27ASoC: codecs: va-macro: use fsgen as clockSrinivas Kandagatla1-2/+9
VA Macro fsgen clock is supplied to other LPASS Macros using proper clock apis, however the internal user uses the registers directly without clk apis. This approch has race condition where in external users of the clock might cut the clock while VA macro is actively using this. Moving the internal usage to clk apis would provide a proper refcounting and avoid such race conditions. This issue was noticed while headset was pulled out while recording is in progress and shifting record patch to DMIC. Reported-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com> Link: https://lore.kernel.org/r/20220727124749.4604-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-27ASoC: mediatek: mt8186: remove unnecessary judgmentsJiaxin Yu4-127/+1
The afe_priv->dai_priv[] is allocated when platform driver probe(), if it failed, the ASoC platform driver probe() will return fail first. Therefore, this is excessive judgment, and the condition will never be established. Bug report: https://www.spinics.net/lists/alsa-devel/msg145609.html This is a semi-automatic email about new static checker warnings. The patch ae92dcbee8b6: "ASoC: mediatek: mt8186: support tdm in platform driver" from May 23, 2022, leads to the following Smatch complaint: sound/soc/mediatek/mt8186/mt8186-dai-tdm.c:424 mtk_dai_tdm_hw_params() warn: variable dereferenced before check 'tdm_priv' (see line 406) sound/soc/mediatek/mt8186/mt8186-dai-tdm.c 405 struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[tdm_id]; 406 unsigned int tdm_mode = tdm_priv->tdm_mode; ^^^^^^^^^^^^^^^^^^^ Lot's of dereferences 407 unsigned int data_mode = tdm_priv->data_mode; 408 unsigned int rate = params_rate(params); 409 unsigned int channels = params_channels(params); 410 snd_pcm_format_t format = params_format(params); 411 unsigned int bit_width = 412 snd_pcm_format_physical_width(format); 413 unsigned int tdm_channels = (data_mode == TDM_DATA_ONE_PIN) ? 414 get_tdm_ch_per_sdata(tdm_mode, channels) : 2; 415 unsigned int lrck_width = 416 get_tdm_lrck_width(format, tdm_mode); 417 unsigned int tdm_con = 0; 418 bool slave_mode = tdm_priv->slave_mode; 419 bool lrck_inv = tdm_priv->lck_invert; 420 bool bck_inv = tdm_priv->bck_invert; 421 unsigned int tran_rate; 422 unsigned int tran_relatch_rate; 423 424 if (!tdm_priv) { ^^^^^^^^^ Checked too late 425 dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); 426 return -EINVAL; Fixes: ae92dcbee8b6 ("ASoC: mediatek: mt8186: support tdm in platform driver") Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/20220726154220.28141-1-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-27ASoC: mchp-spdiftx: remove references to mchp_i2s_capsClaudiu Beznea1-8/+0
Remove references to struct mchp_i2s_caps as they are not used. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220727090814.2446111-3-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>