Skip to content

Commit

Permalink
usb: cdns3: gadget: add CHAIN and ISP bit for sg list use case
Browse files Browse the repository at this point in the history
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 <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
  • Loading branch information
Peter Chen authored and Felipe Balbi committed Oct 2, 2020
1 parent 4e21888 commit 87e1dcd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/usb/cdns3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 87e1dcd

Please sign in to comment.