Lines Matching full:pair
46 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_complete() local
48 pair->pos += snd_pcm_lib_period_bytes(substream); in fsl_asrc_dma_complete()
49 if (pair->pos >= snd_pcm_lib_buffer_bytes(substream)) in fsl_asrc_dma_complete()
50 pair->pos = 0; in fsl_asrc_dma_complete()
60 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_prepare_and_submit() local
68 pair->pos = 0; in fsl_asrc_dma_prepare_and_submit()
69 pair->desc[!dir] = dmaengine_prep_dma_cyclic( in fsl_asrc_dma_prepare_and_submit()
70 pair->dma_chan[!dir], runtime->dma_addr, in fsl_asrc_dma_prepare_and_submit()
74 if (!pair->desc[!dir]) { in fsl_asrc_dma_prepare_and_submit()
79 pair->desc[!dir]->callback = fsl_asrc_dma_complete; in fsl_asrc_dma_prepare_and_submit()
80 pair->desc[!dir]->callback_param = substream; in fsl_asrc_dma_prepare_and_submit()
82 dmaengine_submit(pair->desc[!dir]); in fsl_asrc_dma_prepare_and_submit()
85 pair->desc[dir] = dmaengine_prep_dma_cyclic( in fsl_asrc_dma_prepare_and_submit()
86 pair->dma_chan[dir], 0xffff, 64, 64, DMA_DEV_TO_DEV, 0); in fsl_asrc_dma_prepare_and_submit()
87 if (!pair->desc[dir]) { in fsl_asrc_dma_prepare_and_submit()
92 dmaengine_submit(pair->desc[dir]); in fsl_asrc_dma_prepare_and_submit()
101 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_trigger() local
111 dma_async_issue_pending(pair->dma_chan[IN]); in fsl_asrc_dma_trigger()
112 dma_async_issue_pending(pair->dma_chan[OUT]); in fsl_asrc_dma_trigger()
117 dmaengine_terminate_async(pair->dma_chan[OUT]); in fsl_asrc_dma_trigger()
118 dmaengine_terminate_async(pair->dma_chan[IN]); in fsl_asrc_dma_trigger()
138 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_hw_params() local
141 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_dma_hw_params()
144 enum asrc_pair_index index = pair->index; in fsl_asrc_dma_hw_params()
180 pair->dma_chan[!dir] = asrc->get_dma_channel(pair, !dir); in fsl_asrc_dma_hw_params()
181 if (!pair->dma_chan[!dir]) { in fsl_asrc_dma_hw_params()
192 ret = dmaengine_slave_config(pair->dma_chan[!dir], &config_fe); in fsl_asrc_dma_hw_params()
224 pair->dma_data.dma_request = tmp_data->dma_request; in fsl_asrc_dma_hw_params()
230 tmp_chan = asrc->get_dma_channel(pair, dir); in fsl_asrc_dma_hw_params()
232 pair->dma_data.dma_request2 = tmp_data->dma_request; in fsl_asrc_dma_hw_params()
233 pair->dma_data.peripheral_type = tmp_data->peripheral_type; in fsl_asrc_dma_hw_params()
234 pair->dma_data.priority = tmp_data->priority; in fsl_asrc_dma_hw_params()
237 of_dma_node = pair->dma_chan[!dir]->device->dev->of_node; in fsl_asrc_dma_hw_params()
238 pair->dma_chan[dir] = in fsl_asrc_dma_hw_params()
239 __dma_request_channel(&mask, filter, &pair->dma_data, in fsl_asrc_dma_hw_params()
241 pair->req_dma_chan = true; in fsl_asrc_dma_hw_params()
243 pair->dma_chan[dir] = tmp_chan; in fsl_asrc_dma_hw_params()
245 pair->req_dma_chan = !be_chan; in fsl_asrc_dma_hw_params()
248 if (!pair->dma_chan[dir]) { in fsl_asrc_dma_hw_params()
292 ret = dmaengine_slave_config(pair->dma_chan[dir], &config_be); in fsl_asrc_dma_hw_params()
295 if (pair->req_dma_chan) in fsl_asrc_dma_hw_params()
296 dma_release_channel(pair->dma_chan[dir]); in fsl_asrc_dma_hw_params()
308 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_hw_free() local
311 if (pair->dma_chan[!dir]) in fsl_asrc_dma_hw_free()
312 dma_release_channel(pair->dma_chan[!dir]); in fsl_asrc_dma_hw_free()
315 if (pair->dma_chan[dir] && pair->req_dma_chan) in fsl_asrc_dma_hw_free()
316 dma_release_channel(pair->dma_chan[dir]); in fsl_asrc_dma_hw_free()
318 pair->dma_chan[!dir] = NULL; in fsl_asrc_dma_hw_free()
319 pair->dma_chan[dir] = NULL; in fsl_asrc_dma_hw_free()
333 struct fsl_asrc_pair *pair; in fsl_asrc_dma_startup() local
346 pair = kzalloc(sizeof(*pair) + asrc->pair_priv_size, GFP_KERNEL); in fsl_asrc_dma_startup()
347 if (!pair) in fsl_asrc_dma_startup()
350 pair->asrc = asrc; in fsl_asrc_dma_startup()
351 pair->private = (void *)pair + sizeof(struct fsl_asrc_pair); in fsl_asrc_dma_startup()
353 runtime->private_data = pair; in fsl_asrc_dma_startup()
355 /* Request a dummy pair, which will be released later. in fsl_asrc_dma_startup()
356 * Request pair function needs channel num as input, for this in fsl_asrc_dma_startup()
357 * dummy pair, we just request "1" channel temporarily. in fsl_asrc_dma_startup()
359 ret = asrc->request_pair(1, pair); in fsl_asrc_dma_startup()
361 dev_err(dev, "failed to request asrc pair\n"); in fsl_asrc_dma_startup()
366 tmp_chan = asrc->get_dma_channel(pair, dir); in fsl_asrc_dma_startup()
392 asrc->release_pair(pair); in fsl_asrc_dma_startup()
396 kfree(pair); in fsl_asrc_dma_startup()
405 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_shutdown() local
408 if (!pair) in fsl_asrc_dma_shutdown()
411 asrc = pair->asrc; in fsl_asrc_dma_shutdown()
413 if (asrc->pair[pair->index] == pair) in fsl_asrc_dma_shutdown()
414 asrc->pair[pair->index] = NULL; in fsl_asrc_dma_shutdown()
416 kfree(pair); in fsl_asrc_dma_shutdown()
426 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_pcm_pointer() local
428 return bytes_to_frames(substream->runtime, pair->pos); in fsl_asrc_dma_pcm_pointer()