diff options
Diffstat (limited to 'drivers/usb/host/pci-quirks.c')
-rw-r--r-- | drivers/usb/host/pci-quirks.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 83b5f9cea85a..464ed977b45d 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
@@ -169,6 +169,7 @@ static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx) | |||
169 | static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) | 169 | static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) |
170 | { | 170 | { |
171 | void __iomem *base; | 171 | void __iomem *base; |
172 | u32 control; | ||
172 | 173 | ||
173 | if (!mmio_resource_enabled(pdev, 0)) | 174 | if (!mmio_resource_enabled(pdev, 0)) |
174 | return; | 175 | return; |
@@ -177,10 +178,14 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) | |||
177 | if (base == NULL) | 178 | if (base == NULL) |
178 | return; | 179 | return; |
179 | 180 | ||
181 | control = readl(base + OHCI_CONTROL); | ||
182 | |||
180 | /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ | 183 | /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ |
181 | #ifndef __hppa__ | 184 | #ifdef __hppa__ |
182 | { | 185 | #define OHCI_CTRL_MASK (OHCI_CTRL_RWC | OHCI_CTRL_IR) |
183 | u32 control = readl(base + OHCI_CONTROL); | 186 | #else |
187 | #define OHCI_CTRL_MASK OHCI_CTRL_RWC | ||
188 | |||
184 | if (control & OHCI_CTRL_IR) { | 189 | if (control & OHCI_CTRL_IR) { |
185 | int wait_time = 500; /* arbitrary; 5 seconds */ | 190 | int wait_time = 500; /* arbitrary; 5 seconds */ |
186 | writel(OHCI_INTR_OC, base + OHCI_INTRENABLE); | 191 | writel(OHCI_INTR_OC, base + OHCI_INTRENABLE); |
@@ -194,13 +199,12 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) | |||
194 | dev_warn(&pdev->dev, "OHCI: BIOS handoff failed" | 199 | dev_warn(&pdev->dev, "OHCI: BIOS handoff failed" |
195 | " (BIOS bug?) %08x\n", | 200 | " (BIOS bug?) %08x\n", |
196 | readl(base + OHCI_CONTROL)); | 201 | readl(base + OHCI_CONTROL)); |
197 | |||
198 | /* reset controller, preserving RWC */ | ||
199 | writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL); | ||
200 | } | 202 | } |
201 | } | ||
202 | #endif | 203 | #endif |
203 | 204 | ||
205 | /* reset controller, preserving RWC (and possibly IR) */ | ||
206 | writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL); | ||
207 | |||
204 | /* | 208 | /* |
205 | * disable interrupts | 209 | * disable interrupts |
206 | */ | 210 | */ |