sunxi: initial 4.4 support
[oweals/openwrt.git] / target / linux / sunxi / patches-4.4 / 115-musb-ignore-vbus-errors.patch
1 From fce20ac5d8c98f1a8ea5298051d9fa669e455f04 Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Tue, 4 Aug 2015 23:22:45 +0200
4 Subject: [PATCH] musb: sunxi: Ignore VBus errors in host-only mode
5
6 For some unclear reason sometimes we get VBus errors in host-only mode,
7 even though we do not have any vbus-detection then. Ignore these.
8
9 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 ---
11  drivers/usb/musb/sunxi.c | 4 ++++
12  1 file changed, 4 insertions(+)
13
14 diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
15 index d9b0dc4..4b472b8 100644
16 --- a/drivers/usb/musb/sunxi.c
17 +++ b/drivers/usb/musb/sunxi.c
18 @@ -194,6 +194,10 @@ static irqreturn_t sunxi_musb_interrupt(int irq, void *__hci)
19                 musb_writeb(musb->mregs, MUSB_FADDR, 0);
20         }
21  
22 +       /*  Ignore Vbus errors when in host only mode */
23 +       if (musb->port_mode == MUSB_PORT_MODE_HOST)
24 +               musb->int_usb &= ~MUSB_INTR_VBUSERROR;
25 +
26         musb->int_tx = readw(musb->mregs + SUNXI_MUSB_INTRTX);
27         if (musb->int_tx)
28                 writew(musb->int_tx, musb->mregs + SUNXI_MUSB_INTRTX);