Lines Matching refs: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()
229 pair->dma_data.dma_request = tmp_data->dma_request; in fsl_asrc_dma_hw_params()
235 tmp_chan = asrc->get_dma_channel(pair, dir); in fsl_asrc_dma_hw_params()
237 pair->dma_data.dma_request2 = tmp_data->dma_request; in fsl_asrc_dma_hw_params()
238 pair->dma_data.peripheral_type = tmp_data->peripheral_type; in fsl_asrc_dma_hw_params()
239 pair->dma_data.priority = tmp_data->priority; in fsl_asrc_dma_hw_params()
242 of_dma_node = pair->dma_chan[!dir]->device->dev->of_node; in fsl_asrc_dma_hw_params()
243 pair->dma_chan[dir] = in fsl_asrc_dma_hw_params()
244 __dma_request_channel(&mask, filter, &pair->dma_data, in fsl_asrc_dma_hw_params()
246 pair->req_dma_chan = true; in fsl_asrc_dma_hw_params()
248 pair->dma_chan[dir] = tmp_chan; in fsl_asrc_dma_hw_params()
250 pair->req_dma_chan = !be_chan; in fsl_asrc_dma_hw_params()
253 if (!pair->dma_chan[dir]) { in fsl_asrc_dma_hw_params()
297 ret = dmaengine_slave_config(pair->dma_chan[dir], &config_be); in fsl_asrc_dma_hw_params()
300 if (pair->req_dma_chan) in fsl_asrc_dma_hw_params()
301 dma_release_channel(pair->dma_chan[dir]); in fsl_asrc_dma_hw_params()
313 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_hw_free() local
316 if (pair->dma_chan[!dir]) in fsl_asrc_dma_hw_free()
317 dma_release_channel(pair->dma_chan[!dir]); in fsl_asrc_dma_hw_free()
320 if (pair->dma_chan[dir] && pair->req_dma_chan) in fsl_asrc_dma_hw_free()
321 dma_release_channel(pair->dma_chan[dir]); in fsl_asrc_dma_hw_free()
323 pair->dma_chan[!dir] = NULL; in fsl_asrc_dma_hw_free()
324 pair->dma_chan[dir] = NULL; in fsl_asrc_dma_hw_free()
338 struct fsl_asrc_pair *pair; in fsl_asrc_dma_startup() local
351 pair = kzalloc(sizeof(*pair) + asrc->pair_priv_size, GFP_KERNEL); in fsl_asrc_dma_startup()
352 if (!pair) in fsl_asrc_dma_startup()
355 pair->asrc = asrc; in fsl_asrc_dma_startup()
356 pair->private = (void *)pair + sizeof(struct fsl_asrc_pair); in fsl_asrc_dma_startup()
358 runtime->private_data = pair; in fsl_asrc_dma_startup()
364 ret = asrc->request_pair(1, pair); in fsl_asrc_dma_startup()
371 tmp_chan = asrc->get_dma_channel(pair, dir); in fsl_asrc_dma_startup()
397 asrc->release_pair(pair); in fsl_asrc_dma_startup()
401 kfree(pair); in fsl_asrc_dma_startup()
410 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_shutdown() local
413 if (!pair) in fsl_asrc_dma_shutdown()
416 asrc = pair->asrc; in fsl_asrc_dma_shutdown()
418 if (asrc->pair[pair->index] == pair) in fsl_asrc_dma_shutdown()
419 asrc->pair[pair->index] = NULL; in fsl_asrc_dma_shutdown()
421 kfree(pair); in fsl_asrc_dma_shutdown()
431 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dma_pcm_pointer() local
433 return bytes_to_frames(substream->runtime, pair->pos); in fsl_asrc_dma_pcm_pointer()