summaryrefslogtreecommitdiff
path: root/sound/soc/atmel/atmel-pcm-dma.c
AgeCommit message (Collapse)Author
2015-04-27ASoC: dmaengine_pcm: Make FLAG_NO_RESIDUE internalLars-Peter Clausen
Whether residue can be reported or not is not a property of the audio controller but of the DMA controller. The FLAG_NO_RESIDUE was initially added when the DMAengine framework had no support for describing the residue reporting capabilities of the controller. Support for this was added quite a while ago and recently the DMAengine framework started to complain if a driver does not describe its capabilities and a lot of patches have been merged that add support for this where it was missing. So it should be safe to assume that driver on actively used platforms properly implement the DMA capabilities API. This patch makes the FLAG_NO_RESIDUE internal and no longer allows audio controller drivers to manually set the flag. If a DMA driver against expectations does not support reporting its capabilities for now the generic DMAengine PCM driver will now emit a warning and simply assume that residue reporting is not supported. In the future this might be changed to aborting with an error. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-02ASoC: atmel-pcm-dma: increase buffer_bytes_maxAlexandre Belloni
atmel-pcm-dma is not limited to a buffer size of 64kB like atmel-pcm-pdc. Increase buffer_bytes_max to 512kB to allow for higher bit rates (i.e. 32bps at 192kHz) to work correctly. By default, keep the prealloc at 64kB. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-02ASoC: atmel-pcm-dma: won't check direction when configure dmaBo Shen
As DMA framework request DMA using direction only in prep_slave function, (The At91 xdma driver has adapted to this request). So won't check direction when do DMA configuration. Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-09ALSA: pcm: Add snd_pcm_stop_xrun() helperTakashi Iwai
Add a new helper function snd_pcm_stop_xrun() to the standard sequnce lock/snd_pcm_stop(XRUN)/unlock by a single call, and replace the existing open codes with this helper. The function checks the PCM running state to prevent setting the wrong state, too, for more safety. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-06ASoC: atmel: Don't set unused struct snd_pcm_hardware fieldsLars-Peter Clausen
The ASoC core assumes that the PCM component of the ASoC card transparently moves data around and does not impose any restrictions on the memory layout or the transfer speed. It ignores all fields from the snd_pcm_hardware struct for the PCM driver that are related to this. Setting these fields in the PCM driver might suggest otherwise though, so rather not set them. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-22Merge remote-tracking branch 'asoc/topic/atmel' into asoc-nextMark Brown
2013-07-15ASoC: atmel: Fix unlocked snd_pcm_stop() callTakashi Iwai
snd_pcm_stop() must be called in the PCM substream lock context. Cc: <stable@vger.kernel.org> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-15ASoC: atmel-pcm: use generic dmaengine frameworkBo Shen
Align atmel pcm to use ASoC generic dmaengine framework DMA is fully device tree based Signed-off-by: Bo Shen <voice.shen@atmel.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-15ASoC: atmel-pcm-dma: move prepare for dma to dai prepareBo Shen
as prepare callback for dma is acctually access ssc register which better done in dai driver, so move it to dai prepare callback function Signed-off-by: Bo Shen <voice.shen@atmel.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-04-17ASoC: dmaengine-pcm: Make requesting the DMA channel at PCM open optionalLars-Peter Clausen
Refactor the dmaengine PCM library to allow the DMA channel to be requested before opening a PCM substream. snd_dmaengine_pcm_open() now expects a DMA channel instead of a filter function and filter parameter as its parameters. snd_dmaengine_pcm_close() is updated to not release the DMA channel. This allows a dmaengine based PCM driver to request its channels before the substream is opened. The patch also introduces two new functions, snd_dmaengine_pcm_open_request_chan() and snd_dmaengine_pcm_close_release_chan(), which have the same signature and behaviour of the old snd_dmaengine_pcm_{open,close}() and internally use the new variants of these functions. All users of snd_dmaengine_pcm_{open,close}() are updated to use snd_dmaengine_pcm_open_request_chan() and snd_dmaengine_pcm_close_release_chan(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Stephen Warren <swarren@nvidia.com> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-03ASoC: dmaengine_pcm: Setup device_fc in snd_hwparams_to_dma_slave_configLars-Peter Clausen
Usually device_fc should be set to false for audio DMAs. Initialize it in a common place so drivers don't have to do this manually. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26ASoC: atmel-pcm-dma: Do not use snd_dmaengine_pcm_{set,get}_data()Lars-Peter Clausen
We want to get rid of snd_dmaengine_pcm_{set,get}_data(). All instances of snd_dmaengine_pcm_get_data() in the atmel pcm driver can easily be replaced with snd_soc_dai_get_dma_data(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Bo Shen <voice.shen@atmel.com> Acked-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26ASoC: atmel-pcm-dma: No need to wrap snd_dmaengine_pcm_close()Lars-Peter Clausen
If a PCM driver using the dmaengine PCM helper functions doesn't need to do anything special in its pcm_close callback, snd_dmaengine_pcm_close can be used directly for as the pcm_close callback and there is no need to wrap it in a custom function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Bo Shen <voice.shen@atmel.com> Acked-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-02ASoC: atmel-pcm: dma support based on pcm dmaengineBo Shen
Specify overrun bit in interrupt mask Add dmaengine specific routines Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> [voice.shen@atmel.com: adapt to soc dmaengine framework] Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>