diff options
Diffstat (limited to 'sound/soc/davinci/davinci-pcm.c')
-rw-r--r-- | sound/soc/davinci/davinci-pcm.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index 091dacb78b4d..359e99ec7244 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c | |||
@@ -126,16 +126,9 @@ static void davinci_pcm_dma_irq(unsigned lch, u16 ch_status, void *data) | |||
126 | static int davinci_pcm_dma_request(struct snd_pcm_substream *substream) | 126 | static int davinci_pcm_dma_request(struct snd_pcm_substream *substream) |
127 | { | 127 | { |
128 | struct davinci_runtime_data *prtd = substream->runtime->private_data; | 128 | struct davinci_runtime_data *prtd = substream->runtime->private_data; |
129 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
130 | struct davinci_pcm_dma_params *dma_data = rtd->dai->cpu_dai->dma_data; | ||
131 | struct edmacc_param p_ram; | 129 | struct edmacc_param p_ram; |
132 | int ret; | 130 | int ret; |
133 | 131 | ||
134 | if (!dma_data) | ||
135 | return -ENODEV; | ||
136 | |||
137 | prtd->params = dma_data; | ||
138 | |||
139 | /* Request master DMA channel */ | 132 | /* Request master DMA channel */ |
140 | ret = edma_alloc_channel(prtd->params->channel, | 133 | ret = edma_alloc_channel(prtd->params->channel, |
141 | davinci_pcm_dma_irq, substream, | 134 | davinci_pcm_dma_irq, substream, |
@@ -244,6 +237,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) | |||
244 | struct snd_pcm_runtime *runtime = substream->runtime; | 237 | struct snd_pcm_runtime *runtime = substream->runtime; |
245 | struct davinci_runtime_data *prtd; | 238 | struct davinci_runtime_data *prtd; |
246 | int ret = 0; | 239 | int ret = 0; |
240 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
241 | struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->private_data; | ||
242 | struct davinci_pcm_dma_params *params = &pa[substream->stream]; | ||
243 | if (!params) | ||
244 | return -ENODEV; | ||
247 | 245 | ||
248 | snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); | 246 | snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); |
249 | /* ensure that buffer size is a multiple of period size */ | 247 | /* ensure that buffer size is a multiple of period size */ |
@@ -257,6 +255,7 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) | |||
257 | return -ENOMEM; | 255 | return -ENOMEM; |
258 | 256 | ||
259 | spin_lock_init(&prtd->lock); | 257 | spin_lock_init(&prtd->lock); |
258 | prtd->params = params; | ||
260 | 259 | ||
261 | runtime->private_data = prtd; | 260 | runtime->private_data = prtd; |
262 | 261 | ||