Lines Matching refs:pchan

31 	struct mxs_dma_chan *pchan;  in mxs_dma_validate_chan()  local
36 pchan = mxs_dma_channels + channel; in mxs_dma_validate_chan()
37 if (!(pchan->flags & MXS_DMA_FLAGS_ALLOCATED)) in mxs_dma_validate_chan()
113 struct mxs_dma_chan *pchan; in mxs_dma_enable() local
121 pchan = mxs_dma_channels + channel; in mxs_dma_enable()
123 if (pchan->pending_num == 0) { in mxs_dma_enable()
124 pchan->flags |= MXS_DMA_FLAGS_BUSY; in mxs_dma_enable()
128 pdesc = list_first_entry(&pchan->active, struct mxs_dma_desc, node); in mxs_dma_enable()
132 if (pchan->flags & MXS_DMA_FLAGS_BUSY) { in mxs_dma_enable()
146 writel(pchan->pending_num, in mxs_dma_enable()
148 pchan->active_num += pchan->pending_num; in mxs_dma_enable()
149 pchan->pending_num = 0; in mxs_dma_enable()
151 pchan->active_num += pchan->pending_num; in mxs_dma_enable()
152 pchan->pending_num = 0; in mxs_dma_enable()
155 writel(pchan->active_num, in mxs_dma_enable()
161 pchan->flags |= MXS_DMA_FLAGS_BUSY; in mxs_dma_enable()
181 struct mxs_dma_chan *pchan; in mxs_dma_disable() local
190 pchan = mxs_dma_channels + channel; in mxs_dma_disable()
192 if (!(pchan->flags & MXS_DMA_FLAGS_BUSY)) in mxs_dma_disable()
198 pchan->flags &= ~MXS_DMA_FLAGS_BUSY; in mxs_dma_disable()
199 pchan->active_num = 0; in mxs_dma_disable()
200 pchan->pending_num = 0; in mxs_dma_disable()
201 list_splice_init(&pchan->active, &pchan->done); in mxs_dma_disable()
283 struct mxs_dma_chan *pchan; in mxs_dma_request() local
288 pchan = mxs_dma_channels + channel; in mxs_dma_request()
289 if ((pchan->flags & MXS_DMA_FLAGS_VALID) != MXS_DMA_FLAGS_VALID) in mxs_dma_request()
292 if (pchan->flags & MXS_DMA_FLAGS_ALLOCATED) in mxs_dma_request()
295 pchan->flags |= MXS_DMA_FLAGS_ALLOCATED; in mxs_dma_request()
296 pchan->active_num = 0; in mxs_dma_request()
297 pchan->pending_num = 0; in mxs_dma_request()
299 INIT_LIST_HEAD(&pchan->active); in mxs_dma_request()
300 INIT_LIST_HEAD(&pchan->done); in mxs_dma_request()
315 struct mxs_dma_chan *pchan; in mxs_dma_release() local
322 pchan = mxs_dma_channels + channel; in mxs_dma_release()
324 if (pchan->flags & MXS_DMA_FLAGS_BUSY) in mxs_dma_release()
327 pchan->dev = 0; in mxs_dma_release()
328 pchan->active_num = 0; in mxs_dma_release()
329 pchan->pending_num = 0; in mxs_dma_release()
330 pchan->flags &= ~MXS_DMA_FLAGS_ALLOCATED; in mxs_dma_release()
407 struct mxs_dma_chan *pchan; in mxs_dma_desc_append() local
415 pchan = mxs_dma_channels + channel; in mxs_dma_desc_append()
420 if (!list_empty(&pchan->active)) { in mxs_dma_desc_append()
421 last = list_entry(pchan->active.prev, struct mxs_dma_desc, in mxs_dma_desc_append()
434 pchan->pending_num++; in mxs_dma_desc_append()
435 list_add_tail(&pdesc->node, &pchan->active); in mxs_dma_desc_append()
456 struct mxs_dma_chan *pchan; in mxs_dma_finish() local
465 pchan = mxs_dma_channels + channel; in mxs_dma_finish()
471 if (sem == pchan->active_num) in mxs_dma_finish()
474 list_for_each_safe(p, q, &pchan->active) { in mxs_dma_finish()
475 if ((pchan->active_num) <= sem) in mxs_dma_finish()
484 list_move_tail(p, &pchan->done); in mxs_dma_finish()
487 pchan->active_num--; in mxs_dma_finish()
491 pchan->flags &= ~MXS_DMA_FLAGS_BUSY; in mxs_dma_finish()
597 struct mxs_dma_chan *pchan; in mxs_dma_init_channel() local
600 pchan = mxs_dma_channels + channel; in mxs_dma_init_channel()
601 pchan->flags = MXS_DMA_FLAGS_VALID; in mxs_dma_init_channel()