aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mxs/mxs-pcm.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-05-21treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1Thomas Gleixner1-14/+1
Based on 2 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 this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details 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 51 franklin street fifth floor boston ma 02110 1301 usa 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 [no]_[pad]_[ctrl] any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details 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 51 franklin street fifth floor boston ma 02110 1301 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 176 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154040.652910950@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07ASoC: mxs: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flagLars-Peter Clausen1-1/+0
Since commit 7b11304 ("dma: mxs-dma: Report correct residue for cyclic DMA") the mxs dmaengine driver has support for residue reporting. So there is no need to specify the SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag anymore. This allows a finer grained resolution for the PCM pointer as well as avoids the race condition that can occur with the period counting that is used when the dmaengine driver does not support residue reporting. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-07ASoC: mxs: Don't set unused struct snd_pcm_hardware fieldsLars-Peter Clausen1-5/+0
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> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02ASoC: mxs: Use devm_snd_dmaengine_pcm_register()Lars-Peter Clausen1-7/+1
Makes the code shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-05-13ASoC: mxs: move to use generic DMA helperShawn Guo1-18/+0
With mxs-dma converted to generic DMA bindings, let's move mxs-pcm to use it by removing flages SND_DMAENGINE_PCM_FLAG_NO_DT and SND_DMAENGINE_PCM_FLAG_COMPAT. As the result, those mxs custom dma params code can be removed now. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-22ASoC: mxs: Use generic dmaengine PCMLars-Peter Clausen1-125/+11
Use the generic dmaengine PCM driver instead of a custom implementation. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-22ASoC: mxs-pcm: Set SNDRV_PCM_INFO_HALF_DUPLEXLars-Peter Clausen1-1/+2
The MXS SAIF is only half-duplex so set the SNDRV_PCM_INFO_HALF_DUPLEX flag for the PCM in order to prevent playback and capture from running at the same time. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17ASoC: dmaengine-pcm: Make requesting the DMA channel at PCM open optionalLars-Peter Clausen1-2/+2
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-03-26ASoC: mxs: Embed the mxs_dma_data struct in the mxs_pcm_dma_params structLars-Peter Clausen1-38/+5
Currently the mxs_dma_data struct, which gets passed to the dmaengine driver, is allocated in the pcm driver's open callback. The mxs_dma_data struct has exactly one field which is initialized from the the same field in the mxs_pcm_dma_params struct. The mxs_pcm_dma_params struct gets passed to the pcm driver from the dai driver. Instead of taking this indirection embed the mxs_dma_data struct directly in the mxs_pcm_dma_params struct. This allows us to simplify the pcm driver quite a bit, since we don't have to care about memory managing the mxs_dma_data struct anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10ASoC: mxs: remove __dev* attributesBill Pemberton1-2/+2
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-20ASoC: dmaengine-pcm: Rename and deprecate snd_dmaengine_pcm_pointerLars-Peter Clausen1-1/+1
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>
2012-05-12ASoC: mxs: mxs-pcm does not need to be a plaform_driverShawn Guo1-18/+6
Same as the commit 518de86 (ASoC: tegra: register 'platform' from DAIs, get rid of pdev), it makes mxs-pcm not a platform_driver but helper to register "platform", so that the platform_device for mxs-pcm can be saved completely. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-30Merge tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6Linus Torvalds1-1/+1
Pull MTD changes from David Woodhouse: - Artem's cleanup of the MTD API continues apace. - Fixes and improvements for ST FSMC and SuperH FLCTL NAND, amongst others. - More work on DiskOnChip G3, new driver for DiskOnChip G4. - Clean up debug/warning printks in JFFS2 to use pr_<level>. Fix up various trivial conflicts, largely due to changes in calling conventions for things like dmaengine_prep_slave_sg() (new inline wrapper to hide new parameter, clashing with rewrite of previously last parameter that used to be an 'append' flag, and is now a bitmap of 'unsigned long flags'). (Also some header file fallout - like so many merges this merge window - and silly conflicts with sparse fixes) * tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6: (120 commits) mtd: docg3 add protection against concurrency mtd: docg3 refactor cascade floors structure mtd: docg3 increase write/erase timeout mtd: docg3 fix inbound calculations mtd: nand: gpmi: fix function annotations mtd: phram: fix section mismatch for phram_setup mtd: unify initialization of erase_info->fail_addr mtd: support ONFI multi lun NAND mtd: sm_ftl: fix typo in major number. mtd: add device-tree support to spear_smi mtd: spear_smi: Remove default partition information from driver mtd: Add device-tree support to fsmc_nand mtd: fix section mismatch for doc_probe_device mtd: nand/fsmc: Remove sparse warnings and errors mtd: nand/fsmc: Add DMA support mtd: nand/fsmc: Access the NAND device word by word whenever possible mtd: nand/fsmc: Use dev_err to report error scenario mtd: nand/fsmc: Use devm routines mtd: nand/fsmc: Modify fsmc driver to accept nand timing parameters via platform mtd: fsmc_nand: add pm callbacks to support hibernation ...
2012-03-27mxs-dma : move the mxs dma.h to a more common placeHuang Shijie1-1/+1
Move the header to a more common place. The mxs dma engine is not only used in mx23/mx28, but also used in mx50/mx6q. It will also be used in the future chips. Rename it to mxs-dma.h, and create a new folder include/linux/fsl/ to store the Freescale's header files. change mxs-dma driver, mxs-mmc driver, gpmi-nand driver, mxs-saif driver to the new header file. Acked-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Huang Shijie <b32955@freescale.com> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-03-02ASoC: mxs-pcm: Use dmaengine PCM helper functionsLars-Peter Clausen1-112/+24
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>
2012-02-22ASoC: mxs-pcm: Request DMA channel earlyLars-Peter Clausen1-20/+8
Request the DMA channel in the PCM open callback instead of the hwparams callback, this allows us to let open fail if no dma channel is available. This also fixes a bug where the channel will be requested multiple times if hwparams is called multiple times. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21ASoC: mxs-pcm: Remove unused fields from struct mxs_pcm_runtime_dataLars-Peter Clausen1-5/+0
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-17Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds1-1/+1
* 'next' of git://git.infradead.org/users/vkoul/slave-dma: (53 commits) ARM: mach-shmobile: specify CHCLR registers on SH7372 dma: shdma: fix runtime PM: clear channel buffers on reset dma/imx-sdma: save irq flags when use spin_lock in sdma_tx_submit dmaengine/ste_dma40: clear LNK on channel startup dmaengine: intel_mid_dma: remove legacy pm interface ASoC: mxs: correct 'direction' of device_prep_dma_cyclic dmaengine: intel_mid_dma: error path fix dmaengine: intel_mid_dma: locking and freeing fixes mtd: gpmi-nand: move to dma_transfer_direction mtd: fix compile error for gpmi-nand mmc: mxs-mmc: fix the dma_transfer_direction migration dmaengine: add DMA_TRANS_NONE to dma_transfer_direction dma: mxs-dma: Don't use CLKGATE bits in CTRL0 to disable DMA channels dma: mxs-dma: make mxs_dma_prep_slave_sg() multi user safe dma: mxs-dma: Always leave mxs_dma_init() with the clock disabled. dma: mxs-dma: fix a typo in comment DMA: PL330: Remove pm_runtime_xxx calls from pl330 probe/remove video i.MX IPU: Fix display connections i.MX IPU DMA: Fix wrong burstsize settings dmaengine/ste_dma40: allow fixed physical channel ... Fix up conflicts in drivers/dma/{Kconfig,mxs-dma.c,pl330.c} The conflicts looked pretty trivial, but I'll ask people to verify them.
2011-12-23ASoC: mxs: correct 'direction' of device_prep_dma_cyclicShawn Guo1-1/+1
The commit 49920bc (dmaengine: add new enum dma_transfer_direction) changes the type of parameter 'direction' of device_prep_dma_cyclic from dma_data_direction to dma_transfer_direction. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
2011-12-22Merge branch 'for-3.2' into for-3.3Mark Brown1-1/+1
2011-12-22Revert "ASoC: mxs: correct 'direction' of device_prep_dma_cyclic"Mark Brown1-1/+1
This reverts commit dbec3b30a601791717bc5bb827e210c3b5d6e067 as it should never have been applied to the ASoC tree at all, let alone 3.2.
2011-12-20Merge branch 'for-3.2' into for-3.3Mark Brown1-1/+1
2011-12-20ASoC: mxs: correct 'direction' of device_prep_dma_cyclicShawn Guo1-1/+1
The commit 49920bc (dmaengine: add new enum dma_transfer_direction) changes the type of parameter 'direction' of device_prep_dma_cyclic from dma_data_direction to dma_transfer_direction. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-11Merge branch 'for-3.2' into for-3.3Mark Brown1-0/+3
Conflicts: sound/soc/mxs/mxs-pcm.c
2011-12-11ASoC: mxs: Add appropriate MODULE_ALIAS()Lothar Waßmann1-0/+1
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-11ASoC: mxs: Add missing MODULE_LICENSE("GPL")Lothar Waßmann1-0/+2
The sound driver refuses to load as module, because of the missing MODULE_LICENSE("GPL"). The file header indicates that the driver is indeed published under the GPL. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-24ASoC: Convert mxs directory to module_platform_driverAxel Lin1-11/+1
Factor out some boilerplate code. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-28ASoC: mxs: add mxs-pcm driverDong Aisheng1-0/+359
Signed-off-by: Dong Aisheng <b29396@freescale.com> Acked-by: Liam Girdwood <lrg@ti.com> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>