d23a015091497837d79351ca059676863a8eef49
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.1 / 102-ehci_hcd_ignore_oc.patch
1 --- a/drivers/usb/host/ehci-hcd.c
2 +++ b/drivers/usb/host/ehci-hcd.c
3 @@ -753,7 +753,7 @@ static int ehci_run (struct usb_hcd *hcd
4 "USB %x.%x started, EHCI %x.%02x%s\n",
5 ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
6 temp >> 8, temp & 0xff,
7 - ignore_oc ? ", overcurrent ignored" : "");
8 + (ignore_oc || ehci->ignore_oc) ? ", overcurrent ignored" : "");
9
10 ehci_writel(ehci, INTR_MASK,
11 &ehci->regs->intr_enable); /* Turn On Interrupts */
12 --- a/drivers/usb/host/ehci-hub.c
13 +++ b/drivers/usb/host/ehci-hub.c
14 @@ -580,7 +580,7 @@ ehci_hub_status_data (struct usb_hcd *hc
15 * always set, seem to clear PORT_OCC and PORT_CSC when writing to
16 * PORT_POWER; that's surprising, but maybe within-spec.
17 */
18 - if (!ignore_oc)
19 + if (!ignore_oc || !ehci->ignore_oc)
20 mask = PORT_CSC | PORT_PEC | PORT_OCC;
21 else
22 mask = PORT_CSC | PORT_PEC;
23 @@ -805,7 +805,7 @@ static int ehci_hub_control (
24 if (temp & PORT_PEC)
25 status |= USB_PORT_STAT_C_ENABLE << 16;
26
27 - if ((temp & PORT_OCC) && !ignore_oc){
28 + if ((temp & PORT_OCC) && (!ignore_oc || !ehci->ignore_oc)){
29 status |= USB_PORT_STAT_C_OVERCURRENT << 16;
30
31 /*
32 --- a/drivers/usb/host/ehci.h
33 +++ b/drivers/usb/host/ehci.h
34 @@ -140,6 +140,7 @@ struct ehci_hcd { /* one per controlle
35 unsigned use_dummy_qh:1; /* AMD Frame List table quirk*/
36 unsigned has_synopsys_hc_bug:1; /* Synopsys HC */
37 unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */
38 + unsigned ignore_oc:1;
39
40 /* required for usb32 quirk */
41 #define OHCI_CTRL_HCFS (3 << 6)