From a8f5d0a5d02cda0183c6e68d6a66d4c6641149a9 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 2 Feb 2007 17:21:50 +0100 Subject: [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 Signed-off-by: Liam Girdwood Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/soc/pxa/pxa2xx-pcm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sound/soc/pxa/pxa2xx-pcm.c') diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c index ff32f892287..35e8fa3a469 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, struct snd_pcm_runtime *runtime = substream->runtime; struct pxa2xx_runtime_data *prtd = runtime->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct pxa2xx_pcm_dma_params *dma = rtd->cpu_dai->dma_data; + struct pxa2xx_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data; size_t totsize = params_buffer_bytes(params); size_t period = params_period_bytes(params); pxa_dma_desc *dma_desc; dma_addr_t dma_buff_phys, next_desc_phys; int ret; + /* return if this is a bufferless transfer e.g. + * codec <--> BT codec or GSM modem -- lg FIXME */ + if (!dma) + return 0; + /* this may get called several times by oss emulation * with different params */ if (prtd->params == NULL) { @@ -227,6 +232,10 @@ static int pxa2xx_pcm_open(struct snd_pcm_substream *substream) if (ret) goto out; + ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); + if (ret < 0) + goto out; + prtd = kzalloc(sizeof(struct pxa2xx_runtime_data), GFP_KERNEL); if (prtd == NULL) { ret = -ENOMEM; -- cgit v1.2.3-70-g09d2