Lines Matching refs:chan_ctxt
294 dma_free_coherent(mhi_cntrl->cntrl_dev, sizeof(*mhi_ctxt->chan_ctxt) * in mhi_deinit_dev_ctxt()
295 mhi_cntrl->max_chan, mhi_ctxt->chan_ctxt, in mhi_deinit_dev_ctxt()
305 struct mhi_chan_ctxt *chan_ctxt; in mhi_init_dev_ctxt() local
322 mhi_ctxt->chan_ctxt = dma_alloc_coherent(mhi_cntrl->cntrl_dev, in mhi_init_dev_ctxt()
323 sizeof(*mhi_ctxt->chan_ctxt) * in mhi_init_dev_ctxt()
327 if (!mhi_ctxt->chan_ctxt) in mhi_init_dev_ctxt()
331 chan_ctxt = mhi_ctxt->chan_ctxt; in mhi_init_dev_ctxt()
332 for (i = 0; i < mhi_cntrl->max_chan; i++, chan_ctxt++, mhi_chan++) { in mhi_init_dev_ctxt()
337 tmp = le32_to_cpu(chan_ctxt->chcfg); in mhi_init_dev_ctxt()
344 chan_ctxt->chcfg = cpu_to_le32(tmp); in mhi_init_dev_ctxt()
346 chan_ctxt->chtype = cpu_to_le32(mhi_chan->type); in mhi_init_dev_ctxt()
347 chan_ctxt->erindex = cpu_to_le32(mhi_chan->er_index); in mhi_init_dev_ctxt()
350 mhi_chan->tre_ring.db_addr = (void __iomem *)&chan_ctxt->wp; in mhi_init_dev_ctxt()
460 dma_free_coherent(mhi_cntrl->cntrl_dev, sizeof(*mhi_ctxt->chan_ctxt) * in mhi_init_dev_ctxt()
461 mhi_cntrl->max_chan, mhi_ctxt->chan_ctxt, in mhi_init_dev_ctxt()
615 struct mhi_chan_ctxt *chan_ctxt; in mhi_deinit_chan_ctxt() local
620 chan_ctxt = &mhi_cntrl->mhi_ctxt->chan_ctxt[mhi_chan->chan]; in mhi_deinit_chan_ctxt()
622 if (!chan_ctxt->rbase) /* Already uninitialized */ in mhi_deinit_chan_ctxt()
631 chan_ctxt->rbase = 0; in mhi_deinit_chan_ctxt()
632 chan_ctxt->rlen = 0; in mhi_deinit_chan_ctxt()
633 chan_ctxt->rp = 0; in mhi_deinit_chan_ctxt()
634 chan_ctxt->wp = 0; in mhi_deinit_chan_ctxt()
636 tmp = le32_to_cpu(chan_ctxt->chcfg); in mhi_deinit_chan_ctxt()
639 chan_ctxt->chcfg = cpu_to_le32(tmp); in mhi_deinit_chan_ctxt()
650 struct mhi_chan_ctxt *chan_ctxt; in mhi_init_chan_ctxt() local
658 chan_ctxt = &mhi_cntrl->mhi_ctxt->chan_ctxt[mhi_chan->chan]; in mhi_init_chan_ctxt()
673 tmp = le32_to_cpu(chan_ctxt->chcfg); in mhi_init_chan_ctxt()
676 chan_ctxt->chcfg = cpu_to_le32(tmp); in mhi_init_chan_ctxt()
678 chan_ctxt->rbase = cpu_to_le64(tre_ring->iommu_base); in mhi_init_chan_ctxt()
679 chan_ctxt->rp = chan_ctxt->wp = chan_ctxt->rbase; in mhi_init_chan_ctxt()
680 chan_ctxt->rlen = cpu_to_le64(tre_ring->len); in mhi_init_chan_ctxt()
681 tre_ring->ctxt_wp = &chan_ctxt->wp; in mhi_init_chan_ctxt()