summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-pcm-rpmsg.c
AgeCommit message (Collapse)AuthorFilesLines
2024-05-07ASoC: Constify static snd_pcm_hardwareMark Brown1-1/+1
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: Static 'struct snd_pcm_hardware' is not modified by few drivers and its copy is passed to the core, so it can be made const for increased code safety.
2024-05-06ASoC: fsl: Constify static snd_pcm_hardwareKrzysztof Kozlowski1-1/+1
Static 'struct snd_pcm_hardware' is not modified by the driver and its copy is passed to the core, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240429-n-asoc-const-snd-pcm-hardware-v1-2-c6ce60989834@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-06ASoC: fsl: Use snd_soc_substream_to_rtd() for accessing private_dataKrzysztof Kozlowski1-3/+3
Do not open-code snd_soc_substream_to_rtd(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240430-asoc-snd-substream-clean-v1-6-6f8a8902b479@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25ASoC: fsl: imx-pcm-rpmsg: Register component with rpmsg channel nameChancel Liu1-3/+8
Machine driver uses rpmsg channel name to link this platform component. However if the component is re-registerd card will not find this new created component in snd_soc_try_rebind_card(). Explicitly register this component with rpmsg channel name so that card can always find this component. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Link: https://msgid.link/r/20240311111349.723256-2-chancel.liu@nxp.com Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-25ASoC: fsl: convert not to use asoc_xxx()Kuninori Morimoto1-7/+7
ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874jk0s24t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11ASoC: fsl: imx-pcm-rpmsg: Add SNDRV_PCM_INFO_BATCH flagShengjiu Wang1-0/+1
The rpmsg pcm device is a device which should support double buffering. Found this issue with pipewire. When there is no SNDRV_PCM_INFO_BATCH flag in driver, the pipewire will set headroom to be zero, and because rpmsg pcm device don't support residue report, when the latency setting is small, the "delay" always larger than "target" in alsa-pcm.c, that reading next period data is not scheduled on time. With SNDRV_PCM_INFO_BATCH flag in driver, the pipewire will select a smaller period size for device, then the task of reading next period data will be scheduled on time. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1694414287-13291-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-10ASoC: imx-pcm-rpmsg: Set PCM hardware parameters separatelyChancel Liu1-4/+8
Different PCM devices may have different PCM hardware parameters. It requires PCM hardware parameters set separately if there is more than one rpmsg sound card. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20230625065412.651870-1-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20ASoC: fsl: imx-pcm-rpmsg: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-78-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-14ASoC: imx-pcm-rpmsg: Remove unused variableDeepak R Varma1-4/+2
Variable ret is initialed but is never modified or used except for returning the initial value 0. The value can be directly returned instead and the variable definition can be dropped. Issue identified using returnvar.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma <drv@mailo.com> Link: https://lore.kernel.org/r/Y+p9r5y9DPSJkPVf@ubun2204.myguest.virtualbox.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-10-17ASoC: imx-pcm-rpmsg: Multi-channel support for sound card based on rpmsgChancel Liu1-1/+1
Some sound card based on rpmsg may support multi-channel. The number of channels can be sent to Cortex-M in rpmsg for process. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220930064441.2548505-5-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-10-17ASoC: imx-pcm-rpmsg: Register different platform driversChancel Liu1-2/+6
This patch can register different ASoC platform drivers if there are several rpmsg channels. Thus sound cards based on different rpmsg channels can link to their respective platform drivers. Besides, the name of driver is equal to the name of rpmsg channel. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220930064441.2548505-4-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-04ASoC: fsl: imx-pcm-rpmsg: Use managed buffer allocationTakashi Iwai1-87/+2
As the standard buffer allocation helper supports WC pages now, we can convert imx-pcm-rpmsg driver to use that. This allows us to remove lots of superfluous code. Cc: Nicolin Chen <nicoleotsuka@gmail.com> Cc: Xiubo Li <Xiubo.Lee@gmail.com> Cc: Fabio Estevam <festevam@gmail.com> Cc: Shengjiu Wang <shengjiu.wang@gmail.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210802072815.13551-9-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-05-11Merge series "ASoC: cppcheck fixes of the week" from Pierre-Louis Bossart ↵Mark Brown1-1/+1
<pierre-louis.bossart@linux.intel.com>: While running some checks on a rebased branch, I realized I missed a couple of trivial cases on newer code. Pierre-Louis Bossart (4): ASoC: codecs: mt6359-accdet: remove useless initialization ASoc: codecs: mt6359: remove useless initializations ASoC: codecs: rt1019: clarify expression ASoC: fsl: imx-pcm-rpmsg: remove useless initialization sound/soc/codecs/mt6359-accdet.c | 2 +- sound/soc/codecs/mt6359.c | 2 +- sound/soc/codecs/rt1019.c | 4 ++-- sound/soc/fsl/imx-pcm-rpmsg.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- 2.25.1
2021-05-10ASoC: imx-pcm-rpmsg: Fix warning of incorrect type in assignmentShengjiu Wang1-2/+2
The format in rpmsg is defained as unsigned char, there is warning when convert snd_pcm_format_t to it. sound/soc/fsl/imx-pcm-rpmsg.c:164:43: sparse: warning: incorrect type in assignment (different base types) sound/soc/fsl/imx-pcm-rpmsg.c:164:43: sparse: expected unsigned char format sound/soc/fsl/imx-pcm-rpmsg.c:164:43: sparse: got restricted snd_pcm_format_t [usertype] sound/soc/fsl/imx-pcm-rpmsg.c:167:43: sparse: warning: incorrect type in assignment (different base types) sound/soc/fsl/imx-pcm-rpmsg.c:167:43: sparse: expected unsigned char format sound/soc/fsl/imx-pcm-rpmsg.c:167:43: sparse: got restricted snd_pcm_format_t [usertype] Refine the unused RPMSG_DSD_U16_LE and RPMSG_DSD_U32_LE for these case to fix this sparse warning. Fixes: 3c00eceb2a53 ("ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsg") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1620268240-1005-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10ASoC: fsl: imx-pcm-rpmsg: remove useless initializationPierre-Louis Bossart1-1/+1
cppcheck warning: assigned a value that is never used. [unreadVariable] int written_num = 0; ^ sound/soc/fsl/imx-pcm-rpmsg.c:547:18: style: Variable 'written_num' is Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210426214701.235106-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsgShengjiu Wang1-0/+918
Platform driver based on rpmsg is the interface for sending and receiving rpmsg to and from M core. It will tell the Cortex-M core sound format/rate/channel, where is the data buffer, where is the period size, when to start, when to stop and when suspend or resume happen, each this behavior there is defined rpmsg command. Especially we designed the low power audio case, that is to allocate a large buffer and fill the data, then Cortex-A core can go to sleep mode, Cortex-M core continue to play the sound, when the buffer is consumed, Cortex-M core will trigger the Cortex-A core to wake up. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615516725-4975-6-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>