Lines Matching refs:dma_private
160 static void fsl_dma_update_pointers(struct fsl_dma_private *dma_private) in fsl_dma_update_pointers() argument
163 &dma_private->link[dma_private->current_link]; in fsl_dma_update_pointers()
169 if (dma_private->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in fsl_dma_update_pointers()
170 link->source_addr = cpu_to_be32(dma_private->dma_buf_next); in fsl_dma_update_pointers()
173 upper_32_bits(dma_private->dma_buf_next)); in fsl_dma_update_pointers()
176 link->dest_addr = cpu_to_be32(dma_private->dma_buf_next); in fsl_dma_update_pointers()
179 upper_32_bits(dma_private->dma_buf_next)); in fsl_dma_update_pointers()
184 dma_private->dma_buf_next += dma_private->period_size; in fsl_dma_update_pointers()
186 if (dma_private->dma_buf_next >= dma_private->dma_buf_end) in fsl_dma_update_pointers()
187 dma_private->dma_buf_next = dma_private->dma_buf_phys; in fsl_dma_update_pointers()
189 if (++dma_private->current_link >= NUM_DMA_LINKS) in fsl_dma_update_pointers()
190 dma_private->current_link = 0; in fsl_dma_update_pointers()
201 struct fsl_dma_private *dma_private = dev_id; in fsl_dma_isr() local
202 struct snd_pcm_substream *substream = dma_private->substream; in fsl_dma_isr()
205 struct ccsr_dma_channel __iomem *dma_channel = dma_private->dma_channel; in fsl_dma_isr()
248 if (dma_private->num_periods != NUM_DMA_LINKS) in fsl_dma_isr()
249 fsl_dma_update_pointers(dma_private); in fsl_dma_isr()
367 struct fsl_dma_private *dma_private; in fsl_dma_open() local
392 dma_private = dma_alloc_coherent(dev, sizeof(struct fsl_dma_private), in fsl_dma_open()
394 if (!dma_private) { in fsl_dma_open()
399 dma_private->ssi_sxx_phys = dma->ssi_stx_phys; in fsl_dma_open()
401 dma_private->ssi_sxx_phys = dma->ssi_srx_phys; in fsl_dma_open()
403 dma_private->ssi_fifo_depth = dma->ssi_fifo_depth; in fsl_dma_open()
404 dma_private->dma_channel = dma->channel; in fsl_dma_open()
405 dma_private->irq = dma->irq; in fsl_dma_open()
406 dma_private->substream = substream; in fsl_dma_open()
407 dma_private->ld_buf_phys = ld_buf_phys; in fsl_dma_open()
408 dma_private->dma_buf_phys = substream->dma_buffer.addr; in fsl_dma_open()
410 ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "fsldma-audio", in fsl_dma_open()
411 dma_private); in fsl_dma_open()
414 dma_private->irq, ret); in fsl_dma_open()
416 dma_private, dma_private->ld_buf_phys); in fsl_dma_open()
423 runtime->private_data = dma_private; in fsl_dma_open()
427 dma_channel = dma_private->dma_channel; in fsl_dma_open()
429 temp_link = dma_private->ld_buf_phys + in fsl_dma_open()
433 dma_private->link[i].next = cpu_to_be64(temp_link); in fsl_dma_open()
438 dma_private->link[i - 1].next = cpu_to_be64(dma_private->ld_buf_phys); in fsl_dma_open()
442 CCSR_DMA_CLNDAR_ADDR(dma_private->ld_buf_phys)); in fsl_dma_open()
444 CCSR_DMA_ECLNDAR_ADDR(dma_private->ld_buf_phys)); in fsl_dma_open()
513 struct fsl_dma_private *dma_private = runtime->private_data; in fsl_dma_hw_params() local
524 dma_addr_t ssi_sxx_phys = dma_private->ssi_sxx_phys; in fsl_dma_hw_params()
536 struct ccsr_dma_channel __iomem *dma_channel = dma_private->dma_channel; in fsl_dma_hw_params()
543 dma_private->period_size = period_size; in fsl_dma_hw_params()
544 dma_private->num_periods = params_periods(hw_params); in fsl_dma_hw_params()
545 dma_private->dma_buf_end = dma_private->dma_buf_phys + buffer_size; in fsl_dma_hw_params()
546 dma_private->dma_buf_next = dma_private->dma_buf_phys + in fsl_dma_hw_params()
549 if (dma_private->dma_buf_next >= dma_private->dma_buf_end) in fsl_dma_hw_params()
551 dma_private->dma_buf_next = dma_private->dma_buf_phys; in fsl_dma_hw_params()
610 mr |= CCSR_DMA_MR_BWC((dma_private->ssi_fifo_depth - 2) * sample_bytes); in fsl_dma_hw_params()
615 struct fsl_dma_link_descriptor *link = &dma_private->link[i]; in fsl_dma_hw_params()
676 struct fsl_dma_private *dma_private = runtime->private_data; in fsl_dma_pointer() local
678 struct ccsr_dma_channel __iomem *dma_channel = dma_private->dma_channel; in fsl_dma_pointer()
710 if ((position < dma_private->dma_buf_phys) || in fsl_dma_pointer()
711 (position > dma_private->dma_buf_end)) { in fsl_dma_pointer()
716 frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys); in fsl_dma_pointer()
740 struct fsl_dma_private *dma_private = runtime->private_data; in fsl_dma_hw_free() local
742 if (dma_private) { in fsl_dma_hw_free()
745 dma_channel = dma_private->dma_channel; in fsl_dma_hw_free()
774 struct fsl_dma_private *dma_private = runtime->private_data; in fsl_dma_close() local
779 if (dma_private) { in fsl_dma_close()
780 if (dma_private->irq) in fsl_dma_close()
781 free_irq(dma_private->irq, dma_private); in fsl_dma_close()
785 dma_private, dma_private->ld_buf_phys); in fsl_dma_close()