aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/pxa2xx-pcm.c
diff options
context:
space:
mode:
authorAndrew Johnson <ajohnson@intrinsyc.com>2007-02-02 11:21:50 -0500
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:03:47 -0500
commita8f5d0a5d02cda0183c6e68d6a66d4c6641149a9 (patch)
tree440b21b913e3c3c14a7c3fa7b50232b81b58e711 /sound/soc/pxa/pxa2xx-pcm.c
parent596ce32b74dccf53ef59cc9ba2e95a2a34ba921c (diff)
[ALSA] soc - ASoC 0.13 pxa2xx DMA
This patch updates the pxa2xx I2S driver to the new API in ASoC 0.13. Changes:- o Added check in hw_params to detect buffer less pcms (i.e. BT <--> codec). o Updated structures to new API o Removed DAI's and ac97 ops from PCM header. o Integer hardware constraint added for periods. Signed-off-by: Andrew Johnson <ajohnson@intrinsyc.com> Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/soc/pxa/pxa2xx-pcm.c')
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index ff32f892287e..35e8fa3a469c 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -76,13 +76,18 @@ static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
76 struct snd_pcm_runtime *runtime = substream->runtime; 76 struct snd_pcm_runtime *runtime = substream->runtime;
77 struct pxa2xx_runtime_data *prtd = runtime->private_data; 77 struct pxa2xx_runtime_data *prtd = runtime->private_data;
78 struct snd_soc_pcm_runtime *rtd = substream->private_data; 78 struct snd_soc_pcm_runtime *rtd = substream->private_data;
79 struct pxa2xx_pcm_dma_params *dma = rtd->cpu_dai->dma_data; 79 struct pxa2xx_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data;
80 size_t totsize = params_buffer_bytes(params); 80 size_t totsize = params_buffer_bytes(params);
81 size_t period = params_period_bytes(params); 81 size_t period = params_period_bytes(params);
82 pxa_dma_desc *dma_desc; 82 pxa_dma_desc *dma_desc;
83 dma_addr_t dma_buff_phys, next_desc_phys; 83 dma_addr_t dma_buff_phys, next_desc_phys;
84 int ret; 84 int ret;
85 85
86 /* return if this is a bufferless transfer e.g.
87 * codec <--> BT codec or GSM modem -- lg FIXME */
88 if (!dma)
89 return 0;
90
86 /* this may get called several times by oss emulation 91 /* this may get called several times by oss emulation
87 * with different params */ 92 * with different params */
88 if (prtd->params == NULL) { 93 if (prtd->params == NULL) {
@@ -227,6 +232,10 @@ static int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
227 if (ret) 232 if (ret)
228 goto out; 233 goto out;
229 234
235 ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
236 if (ret < 0)
237 goto out;
238
230 prtd = kzalloc(sizeof(struct pxa2xx_runtime_data), GFP_KERNEL); 239 prtd = kzalloc(sizeof(struct pxa2xx_runtime_data), GFP_KERNEL);
231 if (prtd == NULL) { 240 if (prtd == NULL) {
232 ret = -ENOMEM; 241 ret = -ENOMEM;