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);
392 if (mep->is_in)
398 dev_err(mtu->dev, "stop %s's qmu failed\n", mep->name);
403 if (mep->is_in)
406 dev_dbg(mtu->dev, "%s's qmu stop now!\n", mep->name);
409 void mtu3_qmu_flush(struct mtu3_ep *mep)
412 dev_dbg(mep->mtu->dev, "%s flush QMU %s\n", __func__,
413 ((mep->is_in) ? "TX" : "RX"));
416 mtu3_qmu_stop(mep);
417 reset_gpd_list(mep);
427 struct mtu3_ep *mep = mtu->in_eps + epnum;
428 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
436 mreq = next_request(mep);
449 trace_mtu3_zlp_exp_gpd(mep, gpd_current);
451 mtu3_clrbits(mbase, MU3D_EP_TXCR0(mep->epnum), TX_DMAREQEN);
453 ret = readl_poll_timeout_atomic(mbase + MU3D_EP_TXCR0(mep->epnum),
459 mtu3_setbits(mbase, MU3D_EP_TXCR0(mep->epnum), TX_TXPKTRDY);
466 mtu3_setbits(mbase, MU3D_EP_TXCR0(mep->epnum), TX_DMAREQEN);
467 mtu3_qmu_resume(mep);
476 struct mtu3_ep *mep = mtu->out_eps + epnum;
477 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
485 mreq = next_request(mep);
495 mtu3_qmu_resume(mep);
510 struct mtu3_ep *mep = mtu->in_eps + epnum;
511 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
528 mreq = next_request(mep);
537 trace_mtu3_complete_gpd(mep, gpd);
538 mtu3_req_complete(mep, request, 0);
550 struct mtu3_ep *mep = mtu->out_eps + epnum;
551 struct mtu3_gpd_ring *ring = &mep->gpd_ring;
567 mreq = next_request(mep);
576 trace_mtu3_complete_gpd(mep, gpd);
577 mtu3_req_complete(mep, req, 0);