summaryrefslogtreecommitdiffstats
path: root/sound/soc/sprd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: Switch back to struct platform_driver::remove()Uwe Kleine-König2024-09-091-1/+1
| | | | | | | | | | | | | | | 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>
* ASoC: sprd: Use *-y instead of *-objs in MakefileTakashi Iwai2024-05-081-1/+1
| | | | | | | | | | | | *-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240507155540.24815-27-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Simplify memory allocation in sprd_platform_compr_dma_config()Christophe JAILLET2023-12-191-3/+3
| | | | | | | | | | | | 'sg' is freed at the end sprd_platform_compr_dma_config() both in the normal and in the error handling path. There is no need to use the devm_kcalloc()/devm_kfree(), kcalloc()/kfree() is enough. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://msgid.link/r/d16f22ae0627249a9fc658927832590cd88c544e.1702960856.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: convert not to use asoc_xxx()Kuninori Morimoto2023-09-252-4/+4
| | | | | | | | | 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/87tts0qnj5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: sprd-mcdt: Convert to platform remove callback returning voidUwe Kleine-König2023-03-201-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-136-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Use managed buffer allocationTakashi Iwai2021-08-041-64/+3
| | | | | | | | | | This patch simplifies the buffer pre-allocation code of sprd driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210802072815.13551-16-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: sprd: Use devm_platform_get_and_ioremap_resource()Yang Yingliang2021-06-171-2/+1
| | | | | | | | | Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210617033237.605808-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Switch to use list_entry_is_head() helperAndy Shevchenko2020-12-281-5/+5
| | | | | | | | | | Since we got list_entry_is_head() helper in the generic header, we may switch driver to use it. This eliminates the need in additional variable. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20201208111805.6989-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: various vendors: delete repeated words in commentsRandy Dunlap2020-08-181-1/+1
| | | | | | | | | | | Drop the repeated words {related, we, is, the} in comments. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: alsa-devel@alsa-project.org Link: https://lore.kernel.org/r/20200808012209.10880-1-rdunlap@infradead.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: use asoc_substream_to_rtd()Kuninori Morimoto2020-07-231-1/+1
| | | | | | | | | Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y2nfyoes.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: use snd_compress_opsKuninori Morimoto2020-04-213-28/+25
| | | | | | | | | | We can use snd_compress_ops. Let's switch to use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87mu76vdiv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointerKuninori Morimoto2020-03-272-3/+3
| | | | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/87blonir4j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Allow the MCDT driver to build into modulesBaolin Wang2020-03-052-2/+2
| | | | | | | | | | Change the config to 'tristate' for MCDT driver to allow it to build into modules, as well as changing to use IS_ENABLED() to validate if need supply dummy functions when building the MCDT driver as a module. Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Link: https://lore.kernel.org/r/9306f2b99641136653ae4fe6cf9e859b7f698f77.1583387748.git.baolin.wang7@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Drop superfluous ioctl PCM opsTakashi Iwai2019-12-111-1/+0
| | | | | | | | | | | | | ASoC PCM core deals the empty ioctl field now as default. Let's kill the redundant lines. Cc: Orson Zhai <orsonzhai@gmail.com> Cc: Baolin Wang <baolin.wang7@gmail.com> Cc: Chunyan Zhang <zhang.lyra@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Baolin Wang <baolin.wang7@gmail.com> Link: https://lore.kernel.org/r/20191210145406.21419-18-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: sprd-pcm-dma: remove snd_pcm_opsKuninori Morimoto2019-10-081-42/+32
| | | | | | | | | snd_pcm_ops is no longer needed. Let's use component driver callback. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874l0raf0c.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Remove dev_err() usage after platform_get_irq()Stephen Boyd2019-08-021-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20190730181557.90391-50-swboyd@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
* treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2019-05-211-0/+1
| | | | | | | | | | | | | | Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ASoC: sprd: Add reserved DMA memory supportBaolin Wang2019-05-061-0/+7
| | | | | | | | | | | | | | | | For Spreadtrum audio platform driver, it need allocate a larger DMA buffer dynamically to copy audio data between userspace and kernel space, but that will increase the risk of memory allocation failure especially the system is under heavy load situation. To make sure the audio can work in this scenario, we usually reserve one region of memory to be used as a shared pool of DMA buffers for the platform component. So add of_reserved_mem_device_init_by_idx() function to initialize the shared pool of DMA buffers to be used by the platform component. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Fix to use list_for_each_entry_safe() when delete itemsWei Yongjun2019-05-021-3/+3
| | | | | | | | | | | Since we will remove items off the list using list_del() we need to use a safe version of the list_for_each_entry() macro aptly named list_for_each_entry_safe(). Fixes: d7bff893e04f ("ASoC: sprd: Add Spreadtrum multi-channel data transfer support") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Fix return value check in sprd_mcdt_probe()Wei Yongjun2019-05-021-2/+2
| | | | | | | | | | | In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: d7bff893e04f ("ASoC: sprd: Add Spreadtrum multi-channel data transfer support") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Add Spreadtrum multi-channel data transfer supportBaolin Wang2019-04-254-0/+1128
| | | | | | | | | | | | | On Spreadtrum platform, the audio subsystem will use the multi-channel data transfer controller to transfer sound stream between audio subsystem and other AP/CP subsystem. It can support 10 DAC channel and 10 ADC channel, and each channel has 512 bytes depth data fifo. Moreover each channel can be used DMA mode or interrupt mode to transfer data. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Fix spelling mistake "faied" -> "failed"Colin Ian King2019-04-041-2/+2
| | | | | | | | | There are two identical spelling mistakes in dev_err messages. Fix them. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Reviewed-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Fix the smatch warningBaolin Wang2019-04-041-2/+1
| | | | | | | | | | | | Remove the unnecessary validation of the 'cstream' variable to fix below smatch warning: sprd_platform_compr_drain_notify() warn: variable dereferenced before check 'cstream' (see line 105) Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Fix modular buildMark Brown2019-04-031-1/+3
| | | | | | | Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Suggested-by: Baolin Wang <baolin.wang@linaro.org> Tested-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Add Spreadtrum audio compress offload supportBaolin Wang2019-04-025-2/+721
| | | | | | | | | | | | | | We use 2-stage DMA mode to support Spreadtrum audio compress offload, which means we use one DMA source channel to transfer data from IRAM buffer to the DSP fifo to do decoding/encoding, once IRAM buffer is empty by transferring done, another DMA destination channel will be triggered automatically to start to transfer data from DDR buffer to the IRAM buffer. This can reduce the AP subsystem wakeup times to save power. Co-developed-by: Yintang Ren <yintang.ren@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sprd: Add Spreadtrum audio DMA platfrom driverBaolin Wang2019-01-294-0/+587
The Spreadtrum DMA engine uses the link-list mode to support audio playback or capture, thus this patch adds audio DMA platform support for CPU DAI to trigger DMA link-list transfer. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>