aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/core/pcm_dmaengine.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-03-30Merge tag 'asoc-v5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai1-1/+5
ASoC: Updates for v5.7 This is a very big update for the core since Morimoto-san has been rather busy continuing his refactorings to clean up a lot of the cruft that we have accumilated over the years. We've also gained several new drivers, including initial (but still not complete) parts of the Intel SoundWire support. - Lots of refactorings to modernize the code from Morimoto-san. - Conversion of SND_SOC_ALL_CODECS to use imply from Geert Uytterhoeven. - Continued refactoring and fixing of the Intel support. - Soundwire and more advanced clocking support for Realtek RT5682. - Support for amlogic GX, Meson 8, Meson 8B and T9015 DAC, Broadcom DSL/PON, Ingenic JZ4760 and JZ4770, Realtek RL6231, and TI TAS2563 and TLV320ADCX140.
2020-03-06ALSA: dmaengine_pcm: No need to take runtime reference twice in pcm_pointerPeter Ujfalusi1-2/+0
The runtime pointer has been taken in functional level so there is no need to take it again under the if () case. Fixes: 9d789dc047e3 ("ALSA: dmaengine_pcm: Consider DMA cache caused delay in pointer callback") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200227093544.27723-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ALSA: dmaengine_pcm: Consider DMA cache caused delay in pointer callbackPeter Ujfalusi1-1/+2
Some DMA engines can have big FIFOs which adds to the latency. The DMAengine framework can report the FIFO utilization in bytes. Use this information for the delay reporting. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200210153336.10218-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ALSA: dmaengine_pcm: Consider DMA cache caused delay in pointer callbackPeter Ujfalusi1-0/+5
Some DMA engines can have big FIFOs which adds to the latency. The DMAengine framework can report the FIFO utilization in bytes. Use this information for the delay reporting. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200210151402.29634-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-10ALSA: pcm_dmaengine: Use pcm_for_each_format() macro for PCM format iterationTakashi Iwai1-1/+1
The new macro can fix the sparse warnings gracefully: sound/core/pcm_dmaengine.c:429:50: warning: restricted snd_pcm_format_t degrades to integer sound/core/pcm_dmaengine.c:429:55: warning: restricted snd_pcm_format_t degrades to integer sound/core/pcm_dmaengine.c:429:79: warning: restricted snd_pcm_format_t degrades to integer No functional changes, just sparse warning fixes. Link: https://lore.kernel.org/r/20200206163945.6797-8-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-10-01ASoC: pcm_dmaengine: Extract snd_dmaengine_pcm_refine_runtime_hwparamsShengjiu Wang1-0/+83
When set the runtime hardware parameters, we may need to query the capability of DMA to complete the parameters. This patch is to Extract this operation from dmaengine_pcm_set_runtime_hwparams function to a separate function snd_dmaengine_pcm_refine_runtime_hwparams, that other components which need this feature can call this function. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/d728f65194e9978cbec4132b522d4fed420d704a.1569493933.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 151Thomas Gleixner1-10/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 675 mass ave cambridge ma 02139 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 35 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Armijn Hemel <armijn@tjaldur.nl> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.655028468@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-27ASoC: dmaengine_pcm: Add support for packed transfersMatthias Reichl1-2/+9
dmaengine_pcm currently only supports setups where FIFO reads/writes correspond to exactly one sample, eg 16-bit sample data is transferred via 16-bit FIFO accesses, 32-bit data via 32-bit accesses. This patch adds support for setups with fixed width FIFOs where multiple samples are packed into a larger word. For example setups with a 32-bit wide FIFO register that expect 16-bit sample transfers to be done with the left+right sample data packed into a 32-bit word. Support for packed transfers is controlled via the SND_DMAENGINE_PCM_DAI_FLAG_PACK flag in snd_dmaengine_dai_dma_data.flags If this flag is set dmaengine_pcm doesn't put any restriction on the supported formats and sets the DMA transfer width to undefined. This means control over the constraints is now transferred to the DAI driver and it's responsible to provide proper configuration and check for possible corner cases that aren't handled by the ALSA core. Signed-off-by: Matthias Reichl <hias@horus.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ALSA: pcm_dmaengine: Properly synchronize DMA on shutdownLars-Peter Clausen1-3/+6
Use the new dmaengine_synchronize() function to make sure that all complete callbacks have finished running before the runtime data, which is accessed in the completed callback, is freed. This fixes a long standing use-after-free race condition that has been observed on some systems. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-04ALSA: Fix spelling typo in Documentation/DocBook/alsa-driver-api.xmlMasanari Iida1-2/+2
This patch fix spelling typo found in alsa-driver-api.xml. It is because this file is generated from comments in source files, I have to fix source files. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-04ALSA: pcm_dmaengine: Correct support for 24bits physical sample widthsPeter Ujfalusi1-0/+2
In case of _3LE/_3BE formats the samples are stored in 3 consecutive bytes without padding it to 4 bytes. This means that the DMA needs to be able to support 3 bytes word length in order to read/write the samples from memory correctly. Originally the code treated 24 bits physical length samples as they were 32 bits which leads to corruption when playing or recording audio. The hw.formats field has already been prepared to exclude formats not supported by the DMA engine in use, which means that only on platforms where 3 bytes is supported by the DMA will be able to use this format. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-04ALSA: pcm_dmaengine: Use the available wrapper to get physical widthPeter Ujfalusi1-1/+1
params_physical_width() is available via pcm_params.h Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19ALSA: pcm_dmaengine: Add check during device suspendTushar Behera1-0/+6
Currently snd_dmaengine_pcm_trigger() calls dmaengine_pause() unconditinally during device suspend. In case where DMA controller doesn't support PAUSE/RESUME functionality, this call is not able to stop the DMA controller. In this scenario, audio playback doesn't resume after device resume. Calling dmaengine_pause/dmaengine_terminate_all conditionally fixes the issue. It has been tested with audio playback on Samsung platform having PL330 DMA controller which doesn't support PAUSE/RESUME. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-28ALSA: pcm_dmaengine: Remove hardcoded PCM formatsTakashi Iwai1-13/+9
Use the standard PCM helper function to figure out the sample bytes instead of hardcodec PCM format checks in snd_hwparams_to_dma_slave_config(). The patch also extends the format check for 8 bytes formats although no one should match so far. Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-15ALSA: move dmaengine implementation from ASoC to ALSA coreDaniel Mack1-0/+367
For the PXA DMA rework, we need the generic dmaengine implementation that currently lives in sound/soc for standalone (non-ASoC) AC'97 support. Move it to sound/core, and rename the Kconfig symbol. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>