From: Peter Chen Date: Thu, 10 Sep 2020 09:11:26 +0000 (+0800) Subject: usb: cdns3: gadget: add CHAIN and ISP bit for sg list use case X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=87e1dcd48970ea1cf2d2ce368eb70a46c2eff3ee;p=linux.git usb: cdns3: gadget: add CHAIN and ISP bit for sg list use case For sg buffer list use case, we need to add ISP for each TRB, and add CHAIN bit for each TRB except for the last TRB. Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index d33947d215f93..50aa993bff3ce 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -1220,8 +1220,14 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, else priv_req->trb->control = cpu_to_le32(control); - if (sg_supported) + if (sg_supported) { + trb->control |= TRB_ISP; + /* Don't set chain bit for last TRB */ + if (sg_iter < num_trb - 1) + trb->control |= TRB_CHAIN; + s = sg_next(s); + } control = 0; ++sg_iter;