summaryrefslogtreecommitdiff
path: root/sound/soc/fsl
AgeCommit message (Collapse)AuthorFilesLines
2024-10-22ASoC: fsl_micfil: Add sample rate constraintShengjiu Wang1-0/+38
On some platforms, for example i.MX93, there is only one audio PLL source, so some sample rate can't be supported. If the PLL source is used for 8kHz series rates, then 11kHz series rates can't be supported. So add constraints according to the frequency of available clock sources, then alsa-lib will help to convert the unsupported rate for the driver. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1728884313-6778-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-10-18ASoC: fsl_micfil: Add a flag to distinguish with different volume control typesChancel Liu1-1/+42
On i.MX8MM the register of volume control has positive and negative values. It is different from other platforms like i.MX8MP and i.MX93 which only have positive values. Add a volume_sx flag to use SX_TLV volume control for this kind of platform. Use common TLV volume control for other platforms. Fixes: cdfa92eb90f5 ("ASoC: fsl_micfil: Correct the number of steps on SX controls") Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://patch.msgid.link/20241017071507.2577786-1-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-10-11ASoC: fsl_esai: change dev_warn to dev_dbg in irq handlerShengjiu Wang1-2/+2
Irq handler need to be executed as fast as possible, so the log in irq handler is better to use dev_dbg which needs to be enabled when debugging. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com> Link: https://patch.msgid.link/1728622433-2873-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-10-02ASoC: imx-card: Set card.owner to avoid a warning calltrace if SND=mHui Wang1-0/+1
In most Linux distribution kernels, the SND is set to m, in such a case, when booting the kernel on i.MX8MP EVK board, there is a warning calltrace like below: Call trace: snd_card_init+0x484/0x4cc [snd] snd_card_new+0x70/0xa8 [snd] snd_soc_bind_card+0x310/0xbd0 [snd_soc_core] snd_soc_register_card+0xf0/0x108 [snd_soc_core] devm_snd_soc_register_card+0x4c/0xa4 [snd_soc_core] That is because the card.owner is not set, a warning calltrace is raised in the snd_card_init() due to it. Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver") Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://patch.msgid.link/20241002025659.723544-1-hui.wang@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-10-01ASoC: fsl_sai: Enable 'FIFO continue on error' FCONT bitShengjiu Wang2-1/+5
FCONT=1 means On FIFO error, the SAI will continue from the same word that caused the FIFO error to set after the FIFO warning flag has been cleared. Set FCONT bit in control register to avoid the channel swap issue after SAI xrun. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1727676508-22830-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-14Merge tag 'asoc-v6.12' of ↵Takashi Iwai24-80/+49
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v6.12 This is a very large set of changes, almost all in drivers rather than the core. Even with the addition of several quite large drivers the overall diffstat is negative thanks to the removal of some old Intel board support which has been obsoleted by the AVS driver, helped a bit by some factoring out into helpers (especially around the Soundwire machine drivers for x86). Highlights include: - More simplifications and cleanups throughout the subsystem from Morimoto-san. - Extensive cleanups and refactoring of the Soundwire drivers to make better use of helpers. - Removal of Intel machine support obsoleted by the AVS driver. - Lots of DT schema conversions. - Machine support for many AMD and Intel x86 platforms. - Support for AMD ACP 7.1, Mediatek MT6367 and MT8365, Realtek RTL1320 SoundWire and rev C, and Texas Instruments TAS2563
2024-09-09ASoC: Switch back to struct platform_driver::remove()Uwe Kleine-König21-21/+21
After commit 0edb555a65d1 ("platform: Make platform_driver::remove() return void") .remove() is (again) the right callback to implement for platform drivers. Convert all drivers below sound/soc to use .remove(), with the eventual goal to drop struct platform_driver::remove_new(). As .remove() and .remove_new() have the same prototypes, conversion is done by just changing the structure member name in the driver initializer. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20240909151230.909818-2-u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-22ASoC: remove snd_soc_dai_link_set_capabilities()Kuninori Morimoto1-3/+0
dpcm_xxx flags are no longer needed. We need to use xxx_only flags instead if needed, but snd_soc_dai_link_set_capabilities() user adds dpcm_xxx if playback/capture were available. Thus converting dpcm_xxx to xxx_only is not needed. Just remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://patch.msgid.link/87r0aiaahh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()Fabio Estevam1-10/+4
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240808184944.267686-7-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14ASoC: imx-audmux: Switch to SYSTEM_SLEEP_PM_OPSFabio Estevam1-4/+2
Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM_SLEEP ifdefery from the suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240808184944.267686-6-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14ASoC: fsl_ssi: Switch to SYSTEM_SLEEP_PM_OPSFabio Estevam1-4/+2
Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM_SLEEP ifdefery from the suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240808184944.267686-5-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14ASoC: fsl_spdif: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()Fabio Estevam1-7/+4
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240808184944.267686-4-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14ASoC: fsl_rpmsg: Switch to RUNTIME_PM_OPS()Fabio Estevam1-6/+3
Replace SET_RUNTIME_PM_OPS() with its modern RUNTIME_PM_OPS() alternative. The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240808184944.267686-3-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14ASoC: fsl_mqs: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()Fabio Estevam1-8/+3
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240808184944.267686-2-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()Fabio Estevam1-8/+4
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240808184944.267686-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-09ASoC: Drop snd_soc_*_get_kcontrol_locked()Takashi Iwai1-1/+1
The recent cleanup in ALSA control core made no difference between snd_ctl_find_id_mixer() and snd_ctl_find_id_mixer_locked(), and the latter is to be dropped. The only user of the left API was ASoC, and that's snd_soc_card_get_kcontrol_locked() and snd_soc_component_get_kcontrol_locked(). This patch drops those functions and rewrites those users to call the variant without locked instead. The test of the API became superfluous, hence dropped as well. As all callers of snd_ctl_find_id_mixer_locked() are gone, snd_ctl_find_id_mixer_locked() is finally dropped, too. Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240809104234.8488-4-tiwai@suse.de
2024-08-08ASoC: Merge fixesMark Brown2-6/+16
So we can apply AMD patches that rely on them.
2024-08-02ASoC: fsl: lpc3xxx: Make some symbols staticYue Haibing2-3/+3
These symbols are not used outside of the files, make them static to fix sparse warnings: sound/soc/fsl/lpc3xxx-i2s.c:261:30: warning: symbol 'lpc3xxx_i2s_dai_ops' was not declared. Should it be static? sound/soc/fsl/lpc3xxx-i2s.c:271:27: warning: symbol 'lpc3xxx_i2s_dai_driver' was not declared. Should it be static? sound/soc/fsl/lpc3xxx-pcm.c:55:39: warning: symbol 'lpc3xxx_soc_platform_driver' was not declared. Should it be static? Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Link: https://patch.msgid.link/20240802101044.3302251-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01ALSA/ASoC: use snd_pcm_direction_name()Mark Brown1-2/+1
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: Many drivers are selecting strings "playback" / "capture" by own handling, but we have snd_pcm_direction_name() function for it. This patch use it. One note is that snd_pcm_direction_name() will select "Playback" and "Capture", instead of "playback" / "capture". Almost all drivers are using it as dev_dbg() or dev_err() so no problem. But some other drivers are using it as other purpose. It might be issue (?). For example ASoC debugfs dir name will be changed by this patch.
2024-08-01ASoC: fsl: lpc3xxx-i2s: use snd_pcm_direction_name()Kuninori Morimoto1-2/+1
We already have snd_pcm_direction_name(). Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87jzh3k515.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01ASoC: Use of_property_present()Rob Herring (Arm)1-1/+1
Use of_property_present() to test for property presence rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240731191312.1710417-19-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-31ASoC: fsl: lpc3xxx-i2s: Remove set but not used variable 'savedbitclkrate'Yue Haibing1-3/+1
The variable savedbitclkrate is assigned and never used, so can be removed. sound/soc/fsl/lpc3xxx-i2s.c:42:13: warning: variable ‘savedbitclkrate’ set but not used [-Wunused-but-set-variable] Fixes: 0959de657a10 ("ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs") Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Link: https://patch.msgid.link/20240731022949.135016-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: fsl_micfil: Differentiate register access permission for platformsShengjiu Wang1-4/+14
On i.MX9x platforms, the REG_MICFIL_FSYNC_CTRL, REG_MICFIL_VERID, REG_MICFIL_PARAM are added, but they are not existed on i.MX8x platforms. Use the existed micfil->soc->use_verid to distinguish the access permission for these platforms. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1721897694-6088-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: fsl_micfil: Expand the range of FIFO watermark maskShengjiu Wang2-2/+2
On the i.MX9x platforms, the mask of FIFO watermark is 0x1F, on i.MX8x platforms, the mask of FIFO watermark is 0X7. So use the mask 0x1F for all platforms to make them compatible. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1721897694-6088-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-25ASoC: fsl-asoc-card: Dynamically allocate memory for snd_soc_dai_link_componentsShengjiu Wang1-17/+29
The static snd_soc_dai_link_components cause conflict for multiple instances of this generic driver. For example, when there is wm8962 and SPDIF case enabled together, the contaminated snd_soc_dai_link_components will cause another device probe fail. Fixes: 6d174cc4f224 ("ASoC: fsl-asoc-card: merge spdif support from imx-spdif.c") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1721877773-5229-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: fsl-asoc-card: merge spdif support from imx-spdif.cElinor Montmasson4-116/+84
The imx-spdif machine driver creates audio card to directly use an S/PDIF device. However, it doesn't support interacting with an ASRC. fsl-asoc-card already has the support to create audio card which can use the ASRC. Merge the S/PDIF support from imx-spdif into driver fsl-asoc-card to extend the support of S/PDIF audio card with the use of ASRC devices. fsl-asoc-card uses slightly different DT properties than imx-spdif: * the "spdif-controller" property from imx-spdif is named "audio-cpu" in fsl-asoc-card. * fsl-asoc-card uses codecs explicitly declared in DT with "audio-codec". With an SPDIF, codec drivers spdif_transmitter and spdif_receiver should be used. Driver imx-spdif used instead the dummy codec and a pair of boolean properties, "spdif-in" and "spdif-out". To keep backward compatibility, support for "spdif-controller", "spdif-in" and "spdif-out" is also added to fsl-asoc-card. However, it is recommended to use the new properties if possible. It is better to declare transmitter and/or receiver in DT than using the dummy codec. DTs using compatible "fsl,imx-audio-spdif" are still compatible, and fsl-asoc-card will behave the same as imx-spdif for these DTs. Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240627083104.123357-5-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: fsl-asoc-card: add compatibility to use 2 codecs in dai-linksElinor Montmasson1-118/+161
Adapt the driver to work with configurations using two codecs or more. Modify fsl_asoc_card_probe() to handle use cases where 2 codecs are given in the device tree. This will be needed to add support for the SPDIF. Use cases using one codec will ignore any given codecs other than the first. Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240627083104.123357-4-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: fsl-asoc-card: add second dai link component for codecsElinor Montmasson1-2/+4
Add a second dai link component for codecs that will be used for use cases with 2 codecs. It is needed for future integration of the SPDIF support, which will use spdif_receiver and spdif_transmitter drivers. To prevent deferring in use cases using only one codec, also set by default the number of codecs to 1 for the relevant dai links. Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240627083104.123357-3-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: fsl-asoc-card: add support for dai links with multiple codecsElinor Montmasson1-8/+11
Add support for dai links using multiple codecs for multi-codec use cases. Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240627083104.123357-2-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04ASoC: fsl: fsl_qmc_audio: Add support for non-interleaved mode.Herve Codina1-75/+297
The current fsl_qmc_audio works in interleaved mode. The audio samples are interleaved and all data are sent to (received from) one QMC channel. Using several QMC channels, non interleaved mode can be easily supported. In that case, data related to ch0 are sent to (received from) the first QMC channel, data related to ch1 use the next QMC channel and so on up to the last channel. In terms of constraints and settings, the two modes are slightly different: - Interleaved mode: - The sample size should fit in the number of time-slots available for the QMC channel. - The number of audio channels should fit in the number of time-slots (taking into account the sample size) available for the QMC channel. - Non-interleaved mode: - The number of audio channels is the number of available QMC channels. - Each QMC channel should have the same number of time-slots. - The sample size equals the number of time-slots of one QMC channel. Add support for the non-interleaved mode allowing multiple QMC channel per DAI. The DAI switches in non-interleaved mode when more that one QMC channel is available. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20240701113038.55144-11-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04ASoC: fsl: fsl_qmc_audio: Introduce qmc_dai_constraints_interleaved()Herve Codina1-15/+22
Constraints are set by qmc_dai_startup(). These constraints are specific to the interleaved mode. With the future introduction of support for non-interleaved mode, a new set of constraints will be set. To make the code clear and keep qmc_dai_startup() simple, extract the current interleaved mode constraints settings to a specific function. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20240701113038.55144-7-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04ASoC: fsl: fsl_qmc_audio: Introduce qmc_audio_pcm_{read,write}_submit()Herve Codina1-48/+45
Submitting data to QMC channels is done in several places: transfer completions and DAI start. The operation done is simple and consist in one function call. With the future introduction of support for non-interleaved mode, submitting data will be more complex. To avoid copy/paste of code in several places, introduce qmc_audio_pcm_{read,write}_submit() whose goal is to handle this data submission. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20240701113038.55144-6-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04ASoC: fsl: fsl_qmc_audio: Identify the QMC channel involved in completion ↵Herve Codina1-25/+47
routines The current QMC audio driver uses only one QMC channel per DAI. The context used by QMC channel transfer (read and write) completion routines does not contains any QMC channel and the only one available per DAI is used to schedule the next transfer. This works pretty well with only one QMC channel per DAI. The future support for non-inlerleave mode will use several QMC channel per DAI. In that case, QMC channel transfer completion routines need to identify the QMC channel related to the completion. In order to fill this lack, even if identifying the current QMC channel among several QMC channels is not needed for the current code, add one indirection level and introduce the qmc_dai_chan data structrure. This structure contains the QMC channel involved in the completion and refererences to the runtime context (capture and playback) used by the DAI. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20240701113038.55144-5-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04ASoC: fsl: fsl_qmc_audio: Split channel buffer and PCM pointer handlingHerve Codina1-38/+46
The driver mixes some internal values for channel DMA buffer handling and PCM pointer handling. In the currently supported interleaved mode, this mix does not lead to any issues but in order to prepare the support for the non-interleaved mode, having them clearly separated will ease the support and avoid additional computation to convert values used in channel DMA buffer management in values usable for PCM pointer. Use a specific set of variable for PCM pointer handling and an other set for channel DMA buffer. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20240701113038.55144-4-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04ASoC: fsl: fsl_qmc_audio: Fix issues detected by checkpatchHerve Codina1-34/+31
./scripts/checkpatch.pl --strict --codespell detected several issues when running on the fsl_qmc_audio.c file: - CHECK: spaces preferred around that '*' (ctx:VxV) - CHECK: Alignment should match open parenthesis - CHECK: Comparison to NULL could be written "!prtd" - CHECK: spaces preferred around that '/' (ctx:VxV) - CHECK: Lines should not end with a '(' - CHECK: Please don't use multiple blank lines Some of them are present several times. Fix all of these issues without any functional changes. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20240701113038.55144-3-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04ASoC: fsl: fsl_qmc_audio: Check devm_kasprintf() returned valueHerve Codina1-0/+2
devm_kasprintf() can return a NULL pointer on failure but this returned value is not checked. Fix this lack and check the returned value. Fixes: 075c7125b11c ("ASoC: fsl: Add support for QMC audio") Cc: stable@vger.kernel.org Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20240701113038.55144-2-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03ASoC: fsl_xcvr: Improve suspend/resume flow in fsl_xcvr_trigger()Chancel Liu1-20/+23
In the current flow all interrupts are disabled in runtime suspend phase. However interrupts enablement only exists in fsl_xcvr_prepare(). After resume fsl_xcvr_prepare() may not be called so it will cause all interrupts still disabled even if resume from suspend. Interrupts should be explictily enabled after resume. Also, DPATH reset setting only exists in fsl_xcvr_prepare(). After resume from suspend DPATH should be reset otherwise there'll be channel swap issue. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://patch.msgid.link/20240628094354.780720-1-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01ASoC: fsl: lpc3xxx-i2s: Include bitfield.h for FIELD_PREPNathan Chancellor1-0/+1
bitfield.h is not explicitly included but it is required for FIELD_PREP to be expanded by the preprocessor. If it is not implicitly included, there will be a compiler error (as seen with ARCH=hexagon allmodconfig): sound/soc/fsl/lpc3xxx-i2s.c:169:10: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 169 | tmp |= LPC3XXX_I2S_WW8 | LPC3XXX_I2S_WS_HP(LPC3XXX_I2S_WW8_HP); | ^ sound/soc/fsl/lpc3xxx-i2s.h:42:30: note: expanded from macro 'LPC3XXX_I2S_WW8' 42 | #define LPC3XXX_I2S_WW8 FIELD_PREP(0x3, 0) /* Word width is 8bit */ | ^ sound/soc/fsl/lpc3xxx-i2s.c:205:34: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 205 | LPC3XXX_I2S_DMA1_TX_EN | LPC3XXX_I2S_DMA0_TX_DEPTH(4)); | ^ sound/soc/fsl/lpc3xxx-i2s.h:65:38: note: expanded from macro 'LPC3XXX_I2S_DMA0_TX_DEPTH' 65 | #define LPC3XXX_I2S_DMA0_TX_DEPTH(s) FIELD_PREP(0xF0000, s) /* Set the DMA1 TX Request level */ | ^ sound/soc/fsl/lpc3xxx-i2s.c:210:34: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 210 | LPC3XXX_I2S_DMA0_RX_EN | LPC3XXX_I2S_DMA1_RX_DEPTH(4)); | ^ sound/soc/fsl/lpc3xxx-i2s.h:70:38: note: expanded from macro 'LPC3XXX_I2S_DMA1_RX_DEPTH' 70 | #define LPC3XXX_I2S_DMA1_RX_DEPTH(s) FIELD_PREP(0x700, s) /* Set the DMA1 RX Request level */ | ^ Include bitfield.h explicitly, so that FIELD_PREP is always expanded, clearing up the compiler error. Fixes: 0959de657a10 ("ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/20240701-lpc32xx-asoc-fix-include-for-field_prep-v1-1-0c5d7f71921b@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01ASoC: fsl: lpc3xxx-i2s: Avoid using ret uninitialized in lpc32xx_i2s_probe()Nathan Chancellor1-1/+1
clang points out that ret may be used uninitialized in lpc32xx_i2s_probe() in an error pointer path (which becomes fatal with CONFIG_WERROR): sound/soc/fsl/lpc3xxx-i2s.c:326:47: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] 326 | "failed to init register map: %d\n", ret); | ^~~ sound/soc/fsl/lpc3xxx-i2s.c:310:9: note: initialize the variable 'ret' to silence this warning 310 | int ret; | ^ | = 0 1 error generated. One solution would be a small refactoring of the second parameter in dev_err_probe(), PTR_ERR(i2s_info_p->regs), to be the value of ret in the if statement. However, a nicer solution for debugging purposes, which is the point of this statement, would be to use the '%pe' specifier to symbolically print the error pointer value. Do so, which eliminates the uninitialized use of ret, clearing up the warning. Fixes: 0959de657a10 ("ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/20240701-lpc32xx-asoc-fix-uninitialized-ret-v1-1-985d86189739@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01ASoC: fsl_rpmsg: Add support for i.MX95 platformChancel Liu1-0/+9
Add compatible string and specific soc data to support rpmsg sound card on i.MX95 platform. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://patch.msgid.link/20240626071202.7149-2-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-28ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUsPiotr Wojtaszczyk5-0/+535
This driver was ported from an old version in linux 2.6.27 and adjusted for the new ASoC framework and DMA API. Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com> Link: https://patch.msgid.link/20240627150046.258795-12-piotr.wojtaszczyk@timesys.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26ASoC: imx-audmix: Split capture device for audmixShengjiu Wang1-34/+45
There will be three devices for this sound card, hw:x,0 is the playback device for one SAI, hw:x,1 is the playback device for another SAI, hw:x,2 is the capture device for audmix output. then capture device and playback device can be configured with different master/slave mode. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1718174452-17596-4-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26ASoC: fsl_audmix: Split playback and capture stream to different DAIShengjiu Wang1-10/+6
As audmix requires playback and capture stream in different master/slave mode, so separate playback and capture stream to different DAI. There are three DAIs required, two DAIs for playback one DAI for capture. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1718174452-17596-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26ASoC: fsl_sai: Add separate DAI for transmitter and receiverShengjiu Wang2-41/+104
The transmitter and receiver part of the SAI interface need to be configured with different master/slave mode, especially to work with the audiomix module. +-------+ +-----------+ | SAI1 | --TX--> | | | | <--RX-- | | +-------+ | | | AUDIOMIX | +-------+ | | | SAI2 | --TX--> | | +-------+ +-----------+ The SAI1 TX is in master mode, but SAI1 RX is in slave mode. So add another two DAIs for TX and RX separately. but only defined fsl_sai_set_dai_fmt_tx() and fsl_sai_set_dai_fmt_rx() ops function for current case, in the future, the other ops function for TX and RX can be defined if required. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1718174452-17596-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-21ASoC: Merge up fixesMark Brown2-1/+3
We need some of the AMD fixes as a base for new work.
2024-06-20ASoC: fsl-asoc-card: set priv->pdev before using itElinor Montmasson1-1/+2
priv->pdev pointer was set after being used in fsl_asoc_card_audmux_init(). Move this assignment at the start of the probe function, so sub-functions can correctly use pdev through priv. fsl_asoc_card_audmux_init() dereferences priv->pdev to get access to the dev struct, used with dev_err macros. As priv is zero-initialised, there would be a NULL pointer dereference. Note that if priv->dev is dereferenced before assignment but never used, for example if there is no error to be printed, the driver won't crash probably due to compiler optimisations. Fixes: 708b4351f08c ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support") Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240620132511.4291-2-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-17ASoC: fsl: imx-pcm-fiq: add missing MODULE_DESCRIPTION() macroJeff Johnson1-0/+1
With ARCH=arm, make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/fsl/imx-pcm-fiq.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://msgid.link/r/20240616-md-arm-sound-soc-fsl-v2-1-228772e81a54@quicinc.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-10ASoC: fsl: Remove unused of_gpio.hAndy Shevchenko2-3/+0
of_gpio.h is deprecated and subject to remove. The drivers in question don't use it, simply remove the unused header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240605221446.2624964-3-andriy.shevchenko@linux.intel.com Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-03ASoC: fsl_xcvr: Add support for i.MX95 platformShengjiu Wang3-43/+177
On i.MX95, the XCVR uses a new PLL in the PHY, which is General Purpose (GP) PLL. Add GP PLL configuration support in the driver and add the 'pll_ver' flag to distinguish different PLL on different platforms. The XCVR also use PHY but limited for SPDIF only case Add 'use_phy' flag to distinguish these platforms. When there are 'pll8k' and 'pll11k' clock existing, the clock source of 'phy_clk' can be changed for different sample rate requirement. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Chancel Liu <chancel.liu@nxp.com> Link: https://msgid.link/r/1716972002-2315-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-03ASoC: fsl: add missing MODULE_DESCRIPTION() macroJeff Johnson1-0/+1
make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/fsl/imx-pcm-dma.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://msgid.link/r/20240602-md-snd-fsl-imx-pcm-dma-v1-1-e7efc33c6bf3@quicinc.com Signed-off-by: Mark Brown <broonie@kernel.org>