Lines Matching defs:mep
154 static void reset_gpd_list(struct mtu3_ep *mep)
156 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
165 int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
168 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
171 gpd = dma_pool_zalloc(mep->mtu->qmu_gpd_pool, GFP_ATOMIC, &ring->dma);
180 void mtu3_gpd_ring_free(struct mtu3_ep *mep)
182 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
184 dma_pool_free(mep->mtu->qmu_gpd_pool,
189 void mtu3_qmu_resume(struct mtu3_ep *mep)
191 struct mtu3 *mtu = mep->mtu;
193 int epnum = mep->epnum;
196 offset = mep->is_in ? USB_QMU_TQCSR(epnum) : USB_QMU_RQCSR(epnum);
239 int mtu3_prepare_transfer(struct mtu3_ep *mep)
241 return gpd_ring_empty(&mep->gpd_ring);
244 static int mtu3_prepare_tx_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
247 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
250 struct mtu3 *mtu = mep->mtu;
262 dev_dbg(mep->mtu->dev, "TX-EP%d queue gpd=%p, enq=%p, qdma=%pad\n",
263 mep->epnum, gpd, enq, &enq_dma);
282 trace_mtu3_prepare_gpd(mep, gpd);
287 static int mtu3_prepare_rx_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
290 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
293 struct mtu3 *mtu = mep->mtu;
305 dev_dbg(mep->mtu->dev, "RX-EP%d queue gpd=%p, enq=%p, qdma=%pad\n",
306 mep->epnum, gpd, enq, &enq_dma);
317 trace_mtu3_prepare_gpd(mep, gpd);
322 void mtu3_insert_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
325 if (mep->is_in)
326 mtu3_prepare_tx_gpd(mep, mreq);
328 mtu3_prepare_rx_gpd(mep, mreq);
331 int mtu3_qmu_start(struct mtu3_ep *mep)
333 struct mtu3 *mtu = mep->mtu;
335 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
336 u8 epnum = mep->epnum;
338 if (mep->is_in) {
375 void mtu3_qmu_stop(struct mtu3_ep *mep)
377 struct mtu3 *mtu = mep->mtu;
379 int epnum = mep->epnum;
384 qcsr = mep->is_in ? USB_QMU_TQCSR(epnum) : USB_QMU_RQCSR(epnum);
387 dev_dbg(mtu->dev, "%s's qmu is inactive now!\n", mep->name);
395 dev_err(mtu->dev, "stop %s's qmu failed\n", mep->name);
399 dev_dbg(mtu->dev, "%s's qmu stop now!\n", mep->name);
402 void mtu3_qmu_flush(struct mtu3_ep *mep)
405 dev_dbg(mep->mtu->dev, "%s flush QMU %s\n", __func__,
406 ((mep->is_in) ? "TX" : "RX"));
409 mtu3_qmu_stop(mep);
410 reset_gpd_list(mep);
420 struct mtu3_ep *mep = mtu->in_eps + epnum;
421 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
429 mreq = next_request(mep);
442 trace_mtu3_zlp_exp_gpd(mep, gpd_current);
444 mtu3_clrbits(mbase, MU3D_EP_TXCR0(mep->epnum), TX_DMAREQEN);
446 ret = readl_poll_timeout_atomic(mbase + MU3D_EP_TXCR0(mep->epnum),
452 mtu3_setbits(mbase, MU3D_EP_TXCR0(mep->epnum), TX_TXPKTRDY);
459 mtu3_setbits(mbase, MU3D_EP_TXCR0(mep->epnum), TX_DMAREQEN);
460 mtu3_qmu_resume(mep);
472 struct mtu3_ep *mep = mtu->in_eps + epnum;
473 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
490 mreq = next_request(mep);
499 trace_mtu3_complete_gpd(mep, gpd);
500 mtu3_req_complete(mep, request, 0);
512 struct mtu3_ep *mep = mtu->out_eps + epnum;
513 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
529 mreq = next_request(mep);
538 trace_mtu3_complete_gpd(mep, gpd);
539 mtu3_req_complete(mep, req, 0);