]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/usb/dwc2/gadget.c
usb: dwc2: gadget: Add DDMA isoc related fields to dwc2_hsotg_ep
authorVahram Aharonyan <vahrama@synopsys.com>
Tue, 15 Nov 2016 03:16:36 +0000 (19:16 -0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 18 Nov 2016 11:54:46 +0000 (13:54 +0200)
commitab7d2192947c292a289828f95f081583fdfccfea
tree5cf4dd7a0041d282c9fa1000c5d20223611b07dc
parenta5c18f1131506d23679b896660c73e30c51051cd
usb: dwc2: gadget: Add DDMA isoc related fields to dwc2_hsotg_ep

Preparing for isochronous transfers support adding in DDMA mode. In DDMA
isochronous transfers are handled differently compared to Slave and BDMA
modes. This is caused by fact that isoc requests contain data for one
frame/microframe. HW descriptor should contain data of one
frame/microframe as well. Hence each DMA descriptor in the chain will
correspond to one usb request.

Decided to divide endpoints descriptor chain to two halves - while one
will be processed by HW, other one will be under SW control. First part
will be passed to HW once ISOC traffic needs to be started. In parallel
to HW's work SW will keep creating new entries in the other half of
chain if new requests arrive in ep_queue routine. This will allow
passing of already pre-prepared descriptors to HW immediately after
endpoint gets disabled. The endpoint should be disabled once HW closes
descriptor with "L" bit set. Afterwards SW will switch to use first part
of chain if more requests are arriving.

Add two members to the dwc2_hsotg_ep structure to be used in isochronous
transfers' handling in DDMA mode:

-isoc_chain_num - indicates which half of EP descriptor chain can be
used by SW to add new queued requests while HW is
processing other half.

-next_desc - index which points to next not yet programmed descriptor in
the half of descriptor chain which is under SW control.

Also add initialization of these fields in function
dwc2_hsotg_ep_enable().

Signed-off-by: Vahram Aharonyan <vahrama@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/core.h
drivers/usb/dwc2/gadget.c