Lines Matching refs:stream
107 struct sprd_compr_stream *stream = runtime->private_data; in sprd_platform_compr_drain_notify() local
109 memset(stream->info_area, 0, sizeof(struct sprd_compr_playinfo)); in sprd_platform_compr_drain_notify()
118 struct sprd_compr_stream *stream = runtime->private_data; in sprd_platform_compr_dma_complete() local
119 struct sprd_compr_dma *dma = &stream->dma[1]; in sprd_platform_compr_dma_complete()
122 stream->copied_total += dma->trans_len; in sprd_platform_compr_dma_complete()
123 if (stream->copied_total > stream->received_total) in sprd_platform_compr_dma_complete()
124 stream->copied_total = stream->received_total; in sprd_platform_compr_dma_complete()
135 struct sprd_compr_stream *stream = runtime->private_data; in sprd_platform_compr_dma_config() local
140 struct sprd_compr_dma *dma = &stream->dma[channel]; in sprd_platform_compr_dma_config()
174 src_addr = stream->iram_buffer.addr; in sprd_platform_compr_dma_config()
186 src_addr = stream->compr_buffer.addr; in sprd_platform_compr_dma_config()
187 dst_addr = stream->iram_buffer.addr; in sprd_platform_compr_dma_config()
269 struct sprd_compr_stream *stream = runtime->private_data; in sprd_platform_compr_set_params() local
294 compr_params.channels = stream->num_channels; in sprd_platform_compr_set_params()
295 compr_params.info_phys = stream->info_phys; in sprd_platform_compr_set_params()
296 compr_params.info_size = stream->info_size; in sprd_platform_compr_set_params()
300 ret = stream->compr_ops->set_params(cstream->direction, &compr_params); in sprd_platform_compr_set_params()
309 dma_release_channel(stream->dma[0].chan); in sprd_platform_compr_set_params()
311 dma_release_channel(stream->dma[1].chan); in sprd_platform_compr_set_params()
322 struct sprd_compr_stream *stream; in sprd_platform_compr_open() local
330 stream = devm_kzalloc(dev, sizeof(*stream), GFP_KERNEL); in sprd_platform_compr_open()
331 if (!stream) in sprd_platform_compr_open()
334 stream->cstream = cstream; in sprd_platform_compr_open()
335 stream->num_channels = 2; in sprd_platform_compr_open()
336 stream->compr_ops = data->ops; in sprd_platform_compr_open()
343 SPRD_COMPR_IRAM_SIZE, &stream->iram_buffer); in sprd_platform_compr_open()
348 stream->dma[0].virt = stream->iram_buffer.area + SPRD_COMPR_IRAM_SIZE; in sprd_platform_compr_open()
349 stream->dma[0].phys = stream->iram_buffer.addr + SPRD_COMPR_IRAM_SIZE; in sprd_platform_compr_open()
352 stream->info_phys = stream->iram_buffer.addr + SPRD_COMPR_IRAM_SIZE + in sprd_platform_compr_open()
354 stream->info_area = stream->iram_buffer.area + SPRD_COMPR_IRAM_SIZE + in sprd_platform_compr_open()
356 stream->info_size = SPRD_COMPR_IRAM_INFO_SIZE; in sprd_platform_compr_open()
363 SPRD_COMPR_AREA_SIZE, &stream->compr_buffer); in sprd_platform_compr_open()
368 stream->dma[1].virt = stream->compr_buffer.area + SPRD_COMPR_AREA_SIZE; in sprd_platform_compr_open()
369 stream->dma[1].phys = stream->compr_buffer.addr + SPRD_COMPR_AREA_SIZE; in sprd_platform_compr_open()
373 ret = stream->compr_ops->open(stream_id, &cb); in sprd_platform_compr_open()
379 runtime->private_data = stream; in sprd_platform_compr_open()
383 snd_dma_free_pages(&stream->compr_buffer); in sprd_platform_compr_open()
385 snd_dma_free_pages(&stream->iram_buffer); in sprd_platform_compr_open()
387 devm_kfree(dev, stream); in sprd_platform_compr_open()
396 struct sprd_compr_stream *stream = runtime->private_data; in sprd_platform_compr_free() local
400 for (i = 0; i < stream->num_channels; i++) { in sprd_platform_compr_free()
401 struct sprd_compr_dma *dma = &stream->dma[i]; in sprd_platform_compr_free()
409 snd_dma_free_pages(&stream->compr_buffer); in sprd_platform_compr_free()
410 snd_dma_free_pages(&stream->iram_buffer); in sprd_platform_compr_free()
412 stream->compr_ops->close(stream_id); in sprd_platform_compr_free()
414 devm_kfree(dev, stream); in sprd_platform_compr_free()
423 struct sprd_compr_stream *stream = runtime->private_data; in sprd_platform_compr_trigger() local
425 int channels = stream->num_channels, ret = 0, i; in sprd_platform_compr_trigger()
436 struct sprd_compr_dma *dma = &stream->dma[i]; in sprd_platform_compr_trigger()
451 struct sprd_compr_dma *dma = &stream->dma[i]; in sprd_platform_compr_trigger()
457 ret = stream->compr_ops->start(stream_id); in sprd_platform_compr_trigger()
462 struct sprd_compr_dma *dma = &stream->dma[i]; in sprd_platform_compr_trigger()
468 stream->copied_total = 0; in sprd_platform_compr_trigger()
469 stream->stage1_pointer = 0; in sprd_platform_compr_trigger()
470 stream->received_total = 0; in sprd_platform_compr_trigger()
471 stream->received_stage0 = 0; in sprd_platform_compr_trigger()
472 stream->received_stage1 = 0; in sprd_platform_compr_trigger()
474 ret = stream->compr_ops->stop(stream_id); in sprd_platform_compr_trigger()
480 struct sprd_compr_dma *dma = &stream->dma[i]; in sprd_platform_compr_trigger()
486 ret = stream->compr_ops->pause(stream_id); in sprd_platform_compr_trigger()
492 struct sprd_compr_dma *dma = &stream->dma[i]; in sprd_platform_compr_trigger()
498 ret = stream->compr_ops->pause_release(stream_id); in sprd_platform_compr_trigger()
503 ret = stream->compr_ops->drain(stream->received_total); in sprd_platform_compr_trigger()
519 struct sprd_compr_stream *stream = runtime->private_data; in sprd_platform_compr_pointer() local
521 (struct sprd_compr_playinfo *)stream->info_area; in sprd_platform_compr_pointer()
523 tstamp->copied_total = stream->copied_total; in sprd_platform_compr_pointer()
534 struct sprd_compr_stream *stream = runtime->private_data; in sprd_platform_compr_copy() local
544 if (stream->received_stage0 < runtime->fragment_size) { in sprd_platform_compr_copy()
545 avail_bytes = runtime->fragment_size - stream->received_stage0; in sprd_platform_compr_copy()
546 dst = stream->iram_buffer.area + stream->received_stage0; in sprd_platform_compr_copy()
556 stream->received_stage0 += data_count; in sprd_platform_compr_copy()
557 stream->copied_total += data_count; in sprd_platform_compr_copy()
570 stream->received_stage0 += avail_bytes; in sprd_platform_compr_copy()
571 stream->copied_total += avail_bytes; in sprd_platform_compr_copy()
580 dst = stream->compr_buffer.area + stream->stage1_pointer; in sprd_platform_compr_copy()
581 if (data_count < stream->compr_buffer.bytes - stream->stage1_pointer) { in sprd_platform_compr_copy()
585 stream->stage1_pointer += data_count; in sprd_platform_compr_copy()
587 avail_bytes = stream->compr_buffer.bytes - stream->stage1_pointer; in sprd_platform_compr_copy()
592 if (copy_from_user(stream->compr_buffer.area, buf + avail_bytes, in sprd_platform_compr_copy()
596 stream->stage1_pointer = data_count - avail_bytes; in sprd_platform_compr_copy()
599 stream->received_stage1 += data_count; in sprd_platform_compr_copy()
603 stream->received_total += count; in sprd_platform_compr_copy()