aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-i2s-pcm.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 11:52:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 11:52:38 -0400
commit710421cc7d295cc59eb2676fe2ba3bc3252c124e (patch)
tree4aa11cd7ee64b394871195cb585f16700553f540 /sound/soc/blackfin/bf5xx-i2s-pcm.c
parentd7ef64a9f9987b29e3d911369a9d40122d5be2dd (diff)
parentf686c74cc3e78349d16d46fc72807354574b1516 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (346 commits) ASoC: core: Don't set "(null)" as a driver name ALSA: hda - Use LPIB for ATI/AMD chipsets as default Revert "ALSA: hda - Use position_fix=3 as default for AMD chipsets" ASoC: Tegra: Fix compile when debugfs not enabled ASoC: spdif-dit: Add missing MODULE_* SOUND: OSS: Remove Au1550 driver. ALSA: hda - add Intel Panther Point HDMI codec id ALSA: emu10k1 - Add dB range to Bass and Treble for SB Live! ALSA: hda - Remove PCM mixer elements from Virtual Master of realtek ALSA: hda - Fix input-src parse in patch_analog.c ASoC: davinci-mcasp: enable ping-pong SRAM buffers ASoC: add iPAQ hx4700 machine driver ASoC: Asahi Kasei AK4641 codec driver ALSA: hda - Enable Realtek ALC269 codec input layer beep ALSA: intel8x0m: enable AMD8111 modem ALSA: HDA: Add jack detection for HDMI ALSA: sound, core, pcm_lib: fix xrun_log ASoC: Max98095: Move existing NULL check before pointer dereference. ALSA: sound, core, pcm_lib: xrun_log: log also in_interrupt ALSA: usb-audio - Add support for USB X-Fi S51 Pro ...
Diffstat (limited to 'sound/soc/blackfin/bf5xx-i2s-pcm.c')
-rw-r--r--sound/soc/blackfin/bf5xx-i2s-pcm.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c
index 890a0dccf902..b5101efd1c87 100644
--- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
@@ -148,10 +148,15 @@ static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream)
148 148
149static int bf5xx_pcm_open(struct snd_pcm_substream *substream) 149static int bf5xx_pcm_open(struct snd_pcm_substream *substream)
150{ 150{
151 struct snd_soc_pcm_runtime *rtd = substream->private_data;
152 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
153 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(cpu_dai);
151 struct snd_pcm_runtime *runtime = substream->runtime; 154 struct snd_pcm_runtime *runtime = substream->runtime;
155 struct snd_dma_buffer *buf = &substream->dma_buffer;
152 int ret; 156 int ret;
153 157
154 pr_debug("%s enter\n", __func__); 158 pr_debug("%s enter\n", __func__);
159
155 snd_soc_set_runtime_hwparams(substream, &bf5xx_pcm_hardware); 160 snd_soc_set_runtime_hwparams(substream, &bf5xx_pcm_hardware);
156 161
157 ret = snd_pcm_hw_constraint_integer(runtime, \ 162 ret = snd_pcm_hw_constraint_integer(runtime, \
@@ -159,9 +164,14 @@ static int bf5xx_pcm_open(struct snd_pcm_substream *substream)
159 if (ret < 0) 164 if (ret < 0)
160 goto out; 165 goto out;
161 166
162 if (sport_handle != NULL) 167 if (sport_handle != NULL) {
168 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
169 sport_handle->tx_buf = buf->area;
170 else
171 sport_handle->rx_buf = buf->area;
172
163 runtime->private_data = sport_handle; 173 runtime->private_data = sport_handle;
164 else { 174 } else {
165 pr_err("sport_handle is NULL\n"); 175 pr_err("sport_handle is NULL\n");
166 return -1; 176 return -1;
167 } 177 }
@@ -214,11 +224,6 @@ static int bf5xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
214 pr_debug("%s, area:%p, size:0x%08lx\n", __func__, 224 pr_debug("%s, area:%p, size:0x%08lx\n", __func__,
215 buf->area, buf->bytes); 225 buf->area, buf->bytes);
216 226
217 if (stream == SNDRV_PCM_STREAM_PLAYBACK)
218 sport_handle->tx_buf = buf->area;
219 else
220 sport_handle->rx_buf = buf->area;
221
222 return 0; 227 return 0;
223} 228}
224 229
@@ -239,8 +244,6 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
239 dma_free_coherent(NULL, buf->bytes, buf->area, 0); 244 dma_free_coherent(NULL, buf->bytes, buf->area, 0);
240 buf->area = NULL; 245 buf->area = NULL;
241 } 246 }
242 if (sport_handle)
243 sport_done(sport_handle);
244} 247}
245 248
246static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); 249static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
@@ -292,7 +295,7 @@ static int __devexit bfin_i2s_soc_platform_remove(struct platform_device *pdev)
292 295
293static struct platform_driver bfin_i2s_pcm_driver = { 296static struct platform_driver bfin_i2s_pcm_driver = {
294 .driver = { 297 .driver = {
295 .name = "bfin-pcm-audio", 298 .name = "bfin-i2s-pcm-audio",
296 .owner = THIS_MODULE, 299 .owner = THIS_MODULE,
297 }, 300 },
298 301