aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/spear/spear_pcm.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-21 13:26:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-21 13:26:23 -0500
commitd4371f94bc003e912d4825f5c4bdf57959857073 (patch)
tree919e196d72fc83cba8c67ee720a233671938d265 /sound/soc/spear/spear_pcm.c
parenta547df99aad777c1807e23991fa2471693c0e4cc (diff)
parent7552f34a790069a008bd3e2ab4c0954b30c2f63b (diff)
Merge tag 'sound-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "It was holiday season, so no wonder that there are little changes in framework level, although diffstat shows quite many changes spreaded over sound/* directories. Most of changes are cleanups, code refactoring and fixes. Some highlights: - Removal of OSS sleep_on usages by Arnd - Simplified memalloc helper codes, drop obsoleted features; now it's built into PCM driver instead of an individual module - Warn if PCM buffer preallocation fails, which will show page allocation issues more clearly - Compress offload API updates for sample rates by Vinod - PCM glitch workaround on ctxfi emu20k1 by Sarah - Drop cs46xx DSP blobs, using firmware loader now - USB-audio quitks for Plantronics Gamecom 780, Creative VF0420, and Focusrite Saffire 6 HD-audio specifics: - Standardize Kconfigs of HD-audio codec drivers; now "make localmodconfig" recognizes configs properly (finally!) - Parallel PM implementation by Mengdong - BayleyBay/ValleyView2 board fixups - Broadwell audio support - Runtime PM improvement (PantherPoint, etc) - Quirks: Dell subwooer, Gigabyte mobo jack detection oddity, Dell AiO click noise fixes, Dell headset mic fixes, etc - Automatic bind with HDMI codec parser without generic parser - More AD codec fixes (since 3.12 regression) including the automatic stereo mix support - Common Thinkpad ACPI helper for Realtek and Conexant codecs ASoC specifics: - Update to the generic DMA code to support deferred probe and managed resources - New drivers for BCM2835 (used in Raspberry Pi), Tegra with MAX98090 and Analog Devices AXI I2S and S/PDIF controller IPs - Device tree support for the simple card, max98090 and cs42l52 - Conversion of the Samsung drivers to native dmaengine, making them multiplatform compatible and hopefully helping keep them more modern and up to date. - More regmap conversions, including a very welcome one for twl6040 from Peter Ujfalusi - A big overhaul of the DaVinci drivers also from Peter Ujfalusi - Lots of DMA updates from Lars-Peter - Improvements to the constraints handling code from Lars-Peter - A very helpful conversion of the TWL4030 driver to regmap from Peter - A new driver for the Freescale ESAI controller from Nicolin Chen - Conversion of some of the drivers to use params_width() - Extensions to DPCM for use with compressed audio from Liam" * tag 'sound-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (396 commits) ASoC: dapm: Fix double prefix addition ASoC: compress: Add suport for DPCM into compressed audio ASoC: DPCM: make some DPCM API calls non static for compressed usage ASoC: core: Fix possible NULL pointer dereference of pcm->config ALSA: hda - add headset mic detect quirks for some Dell machines ASoC: tlv320aic32x4: Fix regmap range_min ASoC: core: Return -ENOTSUPP from set_sysclk() if no operation provided ASoC: dapm: Change prototype of soc_widget_read ASoC: samsung: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag ASoC: axi-{spdif,i2s}: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag ASoC: generic-dmaengine-pcm: Check DMA residue granularity ASoC: generic-dmaengine-pcm: Check NO_RESIDUE flag at runtime dma: pl330: Set residue_granularity dma: Indicate residue granularity in dma_slave_caps ASoC: simple-card: fix one bug to writing to the platform data ASoC: pcm: Use snd_pcm_rate_mask_intersect() helper ALSA: Add helper function for intersecting two rate masks ASoC: s6000: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates ASoC: fsl: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates ASoC: pcm: Properly initialize hw->rate_max ...
Diffstat (limited to 'sound/soc/spear/spear_pcm.c')
-rw-r--r--sound/soc/spear/spear_pcm.c42
1 files changed, 9 insertions, 33 deletions
diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index 4707f2b862c3..0e5a8f35d0ad 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -18,6 +18,7 @@
18#include <sound/pcm.h> 18#include <sound/pcm.h>
19#include <sound/soc.h> 19#include <sound/soc.h>
20#include <sound/spear_dma.h> 20#include <sound/spear_dma.h>
21#include "spear_pcm.h"
21 22
22static const struct snd_pcm_hardware spear_pcm_hardware = { 23static const struct snd_pcm_hardware spear_pcm_hardware = {
23 .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | 24 .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -31,49 +32,24 @@ static const struct snd_pcm_hardware spear_pcm_hardware = {
31 .fifo_size = 0, /* fifo size in bytes */ 32 .fifo_size = 0, /* fifo size in bytes */
32}; 33};
33 34
34static struct dma_chan *spear_pcm_request_chan(struct snd_soc_pcm_runtime *rtd,
35 struct snd_pcm_substream *substream)
36{
37 struct spear_dma_data *dma_data;
38
39 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
40
41 return snd_dmaengine_pcm_request_channel(dma_data->filter, dma_data);
42}
43
44static const struct snd_dmaengine_pcm_config spear_dmaengine_pcm_config = { 35static const struct snd_dmaengine_pcm_config spear_dmaengine_pcm_config = {
45 .pcm_hardware = &spear_pcm_hardware, 36 .pcm_hardware = &spear_pcm_hardware,
46 .compat_request_channel = spear_pcm_request_chan,
47 .prealloc_buffer_size = 16 * 1024, 37 .prealloc_buffer_size = 16 * 1024,
48}; 38};
49 39
50static int spear_soc_platform_probe(struct platform_device *pdev) 40int devm_spear_pcm_platform_register(struct device *dev,
41 struct snd_dmaengine_pcm_config *config,
42 bool (*filter)(struct dma_chan *chan, void *slave))
51{ 43{
52 return snd_dmaengine_pcm_register(&pdev->dev, 44 *config = spear_dmaengine_pcm_config;
53 &spear_dmaengine_pcm_config, 45 config->compat_filter_fn = filter;
46
47 return snd_dmaengine_pcm_register(dev, config,
54 SND_DMAENGINE_PCM_FLAG_NO_DT | 48 SND_DMAENGINE_PCM_FLAG_NO_DT |
55 SND_DMAENGINE_PCM_FLAG_COMPAT); 49 SND_DMAENGINE_PCM_FLAG_COMPAT);
56} 50}
57 51EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register);
58static int spear_soc_platform_remove(struct platform_device *pdev)
59{
60 snd_dmaengine_pcm_unregister(&pdev->dev);
61 return 0;
62}
63
64static struct platform_driver spear_pcm_driver = {
65 .driver = {
66 .name = "spear-pcm-audio",
67 .owner = THIS_MODULE,
68 },
69
70 .probe = spear_soc_platform_probe,
71 .remove = spear_soc_platform_remove,
72};
73
74module_platform_driver(spear_pcm_driver);
75 52
76MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); 53MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
77MODULE_DESCRIPTION("SPEAr PCM DMA module"); 54MODULE_DESCRIPTION("SPEAr PCM DMA module");
78MODULE_LICENSE("GPL"); 55MODULE_LICENSE("GPL");
79MODULE_ALIAS("platform:spear-pcm-audio");