diff options
author | Peter Chen <peter.chen@nxp.com> | 2020-09-10 11:11:26 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-10-02 08:57:45 +0200 |
commit | 87e1dcd48970ea1cf2d2ce368eb70a46c2eff3ee (patch) | |
tree | 2a3121731477cb4dfa022cc0e8619d978d9eb6e6 /drivers/usb/cdns3 | |
parent | usb: cdns3: gadget: improve the dump TRB operation at cdns3_ep_run_transfer (diff) | |
download | linux-87e1dcd48970ea1cf2d2ce368eb70a46c2eff3ee.tar.xz linux-87e1dcd48970ea1cf2d2ce368eb70a46c2eff3ee.zip |
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 <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r-- | drivers/usb/cdns3/gadget.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index d33947d215f9..50aa993bff3c 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; |