Lines Matching refs:cl_dev
83 ctx->cl_dev.frags = 0; in skl_cldma_setup_bdle()
86 (ctx->cl_dev.frags * ctx->cl_dev.bufsize)); in skl_cldma_setup_bdle()
91 bdl[2] = cpu_to_le32(ctx->cl_dev.bufsize); in skl_cldma_setup_bdle()
93 size -= ctx->cl_dev.bufsize; in skl_cldma_setup_bdle()
97 ctx->cl_dev.frags++; in skl_cldma_setup_bdle()
156 ctx->dsp_ops.free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_data); in skl_cldma_cleanup()
157 ctx->dsp_ops.free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_bdl); in skl_cldma_cleanup()
164 if (!wait_event_timeout(ctx->cl_dev.wait_queue, in skl_cldma_wait_interruptible()
165 ctx->cl_dev.wait_condition, in skl_cldma_wait_interruptible()
173 if (ctx->cl_dev.wake_status != SKL_CL_DMA_BUF_COMPLETE) { in skl_cldma_wait_interruptible()
179 ctx->cl_dev.wake_status = SKL_CL_DMA_STATUS_NONE; in skl_cldma_wait_interruptible()
193 ctx->cl_dev.dma_buffer_offset, trigger); in skl_cldma_fill_buffer()
194 dev_dbg(ctx->dev, "spib position: %d\n", ctx->cl_dev.curr_spib_pos); in skl_cldma_fill_buffer()
201 if (ctx->cl_dev.dma_buffer_offset + size > ctx->cl_dev.bufsize) { in skl_cldma_fill_buffer()
202 unsigned int size_b = ctx->cl_dev.bufsize - in skl_cldma_fill_buffer()
203 ctx->cl_dev.dma_buffer_offset; in skl_cldma_fill_buffer()
204 memcpy(ctx->cl_dev.dmab_data.area + ctx->cl_dev.dma_buffer_offset, in skl_cldma_fill_buffer()
208 ctx->cl_dev.dma_buffer_offset = 0; in skl_cldma_fill_buffer()
211 memcpy(ctx->cl_dev.dmab_data.area + ctx->cl_dev.dma_buffer_offset, in skl_cldma_fill_buffer()
214 if (ctx->cl_dev.curr_spib_pos == ctx->cl_dev.bufsize) in skl_cldma_fill_buffer()
215 ctx->cl_dev.dma_buffer_offset = 0; in skl_cldma_fill_buffer()
217 ctx->cl_dev.dma_buffer_offset = ctx->cl_dev.curr_spib_pos; in skl_cldma_fill_buffer()
219 ctx->cl_dev.wait_condition = false; in skl_cldma_fill_buffer()
224 ctx->cl_dev.ops.cl_setup_spb(ctx, ctx->cl_dev.curr_spib_pos, trigger); in skl_cldma_fill_buffer()
226 ctx->cl_dev.ops.cl_trigger(ctx, true); in skl_cldma_fill_buffer()
261 if (bytes_left > ctx->cl_dev.bufsize) { in skl_cldma_copy_to_buf()
267 if (ctx->cl_dev.curr_spib_pos == 0) in skl_cldma_copy_to_buf()
268 ctx->cl_dev.curr_spib_pos = ctx->cl_dev.bufsize; in skl_cldma_copy_to_buf()
270 size = ctx->cl_dev.bufsize; in skl_cldma_copy_to_buf()
284 if ((ctx->cl_dev.curr_spib_pos + bytes_left) in skl_cldma_copy_to_buf()
285 <= ctx->cl_dev.bufsize) { in skl_cldma_copy_to_buf()
286 ctx->cl_dev.curr_spib_pos += bytes_left; in skl_cldma_copy_to_buf()
289 (ctx->cl_dev.bufsize - in skl_cldma_copy_to_buf()
290 ctx->cl_dev.curr_spib_pos); in skl_cldma_copy_to_buf()
291 ctx->cl_dev.curr_spib_pos = excess_bytes; in skl_cldma_copy_to_buf()
315 ctx->cl_dev.wake_status = SKL_CL_DMA_ERR; in skl_cldma_process_intr()
317 ctx->cl_dev.wake_status = SKL_CL_DMA_BUF_COMPLETE; in skl_cldma_process_intr()
319 ctx->cl_dev.wait_condition = true; in skl_cldma_process_intr()
320 wake_up(&ctx->cl_dev.wait_queue); in skl_cldma_process_intr()
328 ctx->cl_dev.bufsize = SKL_MAX_BUFFER_SIZE; in skl_cldma_prepare()
331 ctx->cl_dev.ops.cl_setup_bdle = skl_cldma_setup_bdle; in skl_cldma_prepare()
332 ctx->cl_dev.ops.cl_setup_controller = skl_cldma_setup_controller; in skl_cldma_prepare()
333 ctx->cl_dev.ops.cl_setup_spb = skl_cldma_setup_spb; in skl_cldma_prepare()
334 ctx->cl_dev.ops.cl_cleanup_spb = skl_cldma_cleanup_spb; in skl_cldma_prepare()
335 ctx->cl_dev.ops.cl_trigger = skl_cldma_stream_run; in skl_cldma_prepare()
336 ctx->cl_dev.ops.cl_cleanup_controller = skl_cldma_cleanup; in skl_cldma_prepare()
337 ctx->cl_dev.ops.cl_copy_to_dmabuf = skl_cldma_copy_to_buf; in skl_cldma_prepare()
338 ctx->cl_dev.ops.cl_stop_dma = skl_cldma_stop; in skl_cldma_prepare()
342 &ctx->cl_dev.dmab_data, ctx->cl_dev.bufsize); in skl_cldma_prepare()
349 &ctx->cl_dev.dmab_bdl, PAGE_SIZE); in skl_cldma_prepare()
352 ctx->dsp_ops.free_dma_buf(ctx->dev, &ctx->cl_dev.dmab_data); in skl_cldma_prepare()
355 bdl = (__le32 *)ctx->cl_dev.dmab_bdl.area; in skl_cldma_prepare()
358 ctx->cl_dev.ops.cl_setup_bdle(ctx, &ctx->cl_dev.dmab_data, in skl_cldma_prepare()
359 &bdl, ctx->cl_dev.bufsize, 1); in skl_cldma_prepare()
360 ctx->cl_dev.ops.cl_setup_controller(ctx, &ctx->cl_dev.dmab_bdl, in skl_cldma_prepare()
361 ctx->cl_dev.bufsize, ctx->cl_dev.frags); in skl_cldma_prepare()
363 ctx->cl_dev.curr_spib_pos = 0; in skl_cldma_prepare()
364 ctx->cl_dev.dma_buffer_offset = 0; in skl_cldma_prepare()
365 init_waitqueue_head(&ctx->cl_dev.wait_queue); in skl_cldma_prepare()