• Vardan Mikayelyan's avatar
    usb: dwc2: gadget: Add OUTTKNEPDIS and NAKINTRPT handlers · 5321922c
    Vardan Mikayelyan authored
    NAKINTRPT interrupt is starting point for isoc-in transfer,
    synchronization done with first in token received from host,
    core asserts this interrupt when responds with 0 length data
    to in token, received from host.
    
    The first IN token is asynchronous for device - device does not
    know when first one token will arrive from host. On first token
    arrival HW generates 2 interrupts: 'in token received while FIFO
    empty' and 'NAK'. NAK interrupt for ISOC in means that token has
    arrived and ZLP was sent in response to that as there was no data
    in FIFO. SW is basing on this interrupt to obtain frame in which
    token has come and then based on the interval calculates next
    frame for transfer.
    
    OUTTKNEPDIS interrupt is starting point for isoc-out transfer,
    synchronization done with first out token received from host
    while corresponding ep is disabled.
    
    For OUTs the reason is same - device does not know initial frame
    in which out token will come. For this HW generates OUTTKNEPDIS
    - out token is received while EP is disabled. Upon getting this
    interrupt SW starts calculation for next transfer frame.
    Tested-by: default avatarJohn Keeping <john@metanate.com>
    Signed-off-by: default avatarVardan Mikayelyan <mvardan@synopsys.com>
    Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
    Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
    5321922c
gadget.c 101 KB