summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dmaengine-pcm.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: dmaengine_pcm: Add support for compat platformsLars-Peter Clausen2013-04-171-2/+12
| | | | | | | | | | | | | | | | | Add support for platforms which don't use devicetree yet or have to optionally support a non-devicetree way to request the DMA channel. The patch adds the compat_request_channel and compat_filter_fn callbacks to the snd_dmaengine_pcm_config struct. If the compat_request_channel is implemented it will be used to request the DMA channel. If not dma_request_channel with compat_filter_fn as the filter function will be used to request the channel. The patch also exports the snd_dmaengine_pcm_request_chan() function, since compat platforms will want to use it to request their DMA channel. 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>
* ASoC: dmaengine-pcm: Make requesting the DMA channel at PCM open optionalLars-Peter Clausen2013-04-171-23/+49
| | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: dmaengine-pcm: Add a common DAI DMA data structLars-Peter Clausen2013-04-031-0/+37
| | | | | | | | | | | | | | | This patch adds a common DMA data struct which can be used by DAI drivers to communicate their DMA configuration requirements to the DMA pcm driver. Having a common data structure for this allows us to implement common functions on top of them, which can be used by multiple platforms. This patch also introduces a new function to initialize certain fields of a dma_slave_config struct from the common DAI DMA data struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: dmaengine_pcm: Setup device_fc in snd_hwparams_to_dma_slave_configLars-Peter Clausen2013-04-031-0/+2
| | | | | | | | | | 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>
* ASoC: dmaengine-pcm: Remove snd_dmaengine_pcm_{set,get}_dataLars-Peter Clausen2013-03-261-29/+0Star
| | | | | | | | | These functions were initially added to be able to support some oddball dma drivers, but all users have been updated to deal with the situation without the help of snd_dmaengine_pcm_{set,get}_data, so these two functions can be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: dmaengine_pcm: set MODULE_LICENSELothar Waßmann2012-11-231-0/+2
| | | | | Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic()Peter Ujfalusi2012-09-241-1/+5
| | | | | | | | | | | | | | With this parameter added to dmaengine_prep_dma_cyclic() the API will be in sync with other dmaengine_prep_*() functions. The dmaengine_prep_dma_cyclic() function primarily used by audio for cyclic transfer required by ALSA, we use the from audio to ask dma drivers to suppress interrupts (if DMA_PREP_INTERRUPT is cleared) when it is supported on the platform. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> CC: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: dmaengine_pcm: fix typo in commentUwe Kleine-König2012-06-251-1/+1
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: dmaengine-pcm: Add support for querying stream position from DMA driverLars-Peter Clausen2012-06-201-1/+28
| | | | | | | | | | | | | | | | | | | Currently the sound dmaengine pcm helper functions implement the pcm_pointer callback by trying to count the number of elapsed periods. This is done by advancing the stream position in the dmaengine callback by one period. Unfortunately there is no guarantee that the callback will be called for each elapsed period. It may be possible that under high system load it is only called once for multiple elapsed periods. This patch addresses the issue by implementing support for querying the current stream position directly from the dmaengine driver. Since not all dmaengine drivers support reporting the stream position yet the old period counting implementation is kept for now. Furthermore the new mechanism allows to report the stream position with a sub-period granularity, given that the dmaengine driver supports this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: dmaengine-pcm: Rename and deprecate snd_dmaengine_pcm_pointerLars-Peter Clausen2012-06-201-5/+5
| | | | | | | | | | | | | | | | | | | Currently the sound dmaengine pcm helper functions implement the pcm_pointer callback by trying to count the number of elapsed periods. This is done by advancing the stream position in the dmaengine callback by one period. Unfortunately there is no guarantee that the callback will be called for each elapsed period. It may be possible that under high system load it is only called once for multiple elapsed periods. This patch renames the current implementation and documents its shortcomings and that it should not be used anymore in new drivers. The next patch will introduce a new snd_dmaengine_pcm_pointer which will be implemented based on querying the current stream position from the dma device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by Vinod Koul <vinod.koul@linux.intel.com> Acked-by: Dong Aisheng <dong.aisheng@linaro.org Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: dmaengine_pcm: use dmaengine cyclic wrapperVinod Koul2012-03-261-2/+2
| | | | | | | | | | commit 4a163c82 added extra parameter to device_prep_dma_cyclic this is not required if we use the wrapper over cyclic API. This is split from Alexedre's patch Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add extra parameter to device_prep_dma_cyclicFabio Estevam2012-03-221-1/+1
| | | | | | | | | | | | Since commit 185ecb5 (dmaengine: add context parameter to prep_slave_sg and prep_dma_cyclic) prep_dma_cyclic() got an extra context parameter. Add this new parameter in order to fix the following build error (mxs_defconfig and imx_v4_v5_defconfig): sound/soc/soc-dmaengine-pcm.c:149:3: error: too few arguments to function 'chan->device->device_prep_dma_cyclic' Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: dmaengine_pcm: Reset pointer position when starting a streamMika Westerberg2012-03-121-0/+1
| | | | | | | | | Otherwise a wrong position will be reported after restarting a stream and the first few samples might be skipped. Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add dmaengine PCM helper functionsLars-Peter Clausen2012-03-021-0/+287
This patch adds a set of functions which are intended to be used when implementing a dmaengine based sound PCM driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>