Lines Matching refs:pcm
10 #include <sound/pcm.h>
24 static struct device *dmaengine_dma_dev(struct dmaengine_pcm *pcm,
27 if (!pcm->chan[substream->stream])
30 return pcm->chan[substream->stream]->device->dev;
76 struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
86 if (!pcm->config)
89 prepare_slave_config = pcm->config->prepare_slave_config;
109 struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
110 struct device *dma_dev = dmaengine_dma_dev(pcm, substream);
111 struct dma_chan *chan = pcm->chan[substream->stream];
121 if (pcm->config && pcm->config->pcm_hardware)
123 pcm->config->pcm_hardware);
137 if (pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_RESIDUE)
156 struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
157 struct dma_chan *chan = pcm->chan[substream->stream];
184 struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
196 if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX) && pcm->chan[0])
197 return pcm->chan[0];
199 if (pcm->config && pcm->config->compat_request_channel)
200 return pcm->config->compat_request_channel(rtd, substream);
202 if (pcm->config)
203 fn = pcm->config->compat_filter_fn;
230 struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
231 const struct snd_dmaengine_pcm_config *config = pcm->config;
247 substream = rtd->pcm->streams[i].substream;
251 if (!pcm->chan[i] && config && config->chan_names[i])
252 pcm->chan[i] = dma_request_slave_channel(dev,
255 if (!pcm->chan[i] && (pcm->flags & SND_DMAENGINE_PCM_FLAG_COMPAT)) {
256 pcm->chan[i] = dmaengine_pcm_compat_request_channel(
260 if (!pcm->chan[i]) {
268 dmaengine_dma_dev(pcm, substream),
272 if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i]))
273 pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE;
275 if (rtd->pcm->streams[i].pcm->name[0] == '\0') {
276 strscpy_pad(rtd->pcm->streams[i].pcm->name,
277 rtd->pcm->streams[i].pcm->id,
278 sizeof(rtd->pcm->streams[i].pcm->name));
289 struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
291 if (pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_RESIDUE)
303 struct dmaengine_pcm *pcm = soc_component_to_pcm(component);
306 void *buf, unsigned long bytes) = pcm->config->process;
357 static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
364 if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || (!dev->of_node &&
381 if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX)
396 pcm->chan[i] = NULL;
398 pcm->chan[i] = chan;
400 if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX)
404 if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX)
405 pcm->chan[1] = pcm->chan[0];
410 static void dmaengine_pcm_release_chan(struct dmaengine_pcm *pcm)
415 if (!pcm->chan[i])
417 dma_release_channel(pcm->chan[i]);
418 if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX)
433 struct dmaengine_pcm *pcm;
436 pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
437 if (!pcm)
441 pcm->component.debugfs_prefix = "dma";
443 pcm->config = config;
444 pcm->flags = flags;
446 ret = dmaengine_pcm_request_chan_of(pcm, dev, config);
455 ret = snd_soc_component_initialize(&pcm->component, driver, dev);
459 ret = snd_soc_add_component(&pcm->component, NULL, 0);
466 dmaengine_pcm_release_chan(pcm);
467 kfree(pcm);
482 struct dmaengine_pcm *pcm;
488 pcm = soc_component_to_pcm(component);
491 dmaengine_pcm_release_chan(pcm);
492 kfree(pcm);