[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1589441605.28160.27.camel@mhfsdcap03>
Date: Thu, 14 May 2020 15:33:25 +0800
From: Min Guo <min.guo@...iatek.com>
To: Macpaul Lin <macpaul.lin@...iatek.com>
CC: Chunfeng Yun <chunfeng.yun@...iatek.com>,
Hans de Goede <hdegoede@...hat.com>, Bin Liu <b-liu@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Matthias Brugger <matthias.bgg@...il.com>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Mediatek WSD Upstream <wsd_upstream@...iatek.com>,
Macpaul Lin <macpaul.lin@...il.com>
Subject: Re: [PATCH] usb: musb: mediatek: add reset FADDR to zero in reset
interrupt handle
On Thu, 2020-05-14 at 12:01 +0800, Macpaul Lin wrote:
> When receiving reset interrupt, FADDR need to be reset to zero in
> periphearl mode. Otherwise ep0 cannot do enumeration when re-pluging USB
> cable.
>
> Signed-off-by: Macpaul Lin <macpaul.lin@...iatek.com>
> ---
> drivers/usb/musb/mediatek.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/usb/musb/mediatek.c b/drivers/usb/musb/mediatek.c
> index 6196b0e..eebeadd 100644
> --- a/drivers/usb/musb/mediatek.c
> +++ b/drivers/usb/musb/mediatek.c
> @@ -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);
>
Acked-by:Min Guo <min.guo@...iatek.com>
Powered by blists - more mailing lists