]> Git Repo - J-linux.git/commitdiff
usb: musb: mediatek: add reset FADDR to zero in reset interrupt handle
authorMacpaul Lin <[email protected]>
Mon, 25 May 2020 02:50:47 +0000 (21:50 -0500)
committerGreg Kroah-Hartman <[email protected]>
Mon, 25 May 2020 11:36:30 +0000 (13:36 +0200)
When receiving reset interrupt, FADDR need to be reset to zero in
peripheral mode. Otherwise ep0 cannot do enumeration when re-plugging USB
cable.

Signed-off-by: Macpaul Lin <[email protected]>
Acked-by: Min Guo <[email protected]>
Signed-off-by: Bin Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/usb/musb/mediatek.c

index 6196b0e8d77d2016d6746be91f289134da37f5b4..eebeadd269461421b7e6915adc1a106c249112d2 100644 (file)
@@ -208,6 +208,12 @@ static irqreturn_t generic_interrupt(int irq, void *__hci)
        musb->int_rx = musb_clearw(musb->mregs, MUSB_INTRRX);
        musb->int_tx = musb_clearw(musb->mregs, MUSB_INTRTX);
 
+       if ((musb->int_usb & MUSB_INTR_RESET) && !is_host_active(musb)) {
+               /* ep0 FADDR must be 0 when (re)entering peripheral mode */
+               musb_ep_select(musb->mregs, 0);
+               musb_writeb(musb->mregs, MUSB_FADDR, 0);
+       }
+
        if (musb->int_usb || musb->int_tx || musb->int_rx)
                retval = musb_interrupt(musb);
 
This page took 0.06417 seconds and 4 git commands to generate.