~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/usb/host/xhci-pci.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 */
22
22
 
23
23
#include <linux/pci.h>
 
24
#include <linux/slab.h>
24
25
 
25
26
#include "xhci.h"
26
27
 
28
29
#define PCI_VENDOR_ID_FRESCO_LOGIC      0x1b73
29
30
#define PCI_DEVICE_ID_FRESCO_LOGIC_PDK  0x1000
30
31
 
 
32
#define PCI_VENDOR_ID_ETRON             0x1b6f
 
33
#define PCI_DEVICE_ID_ASROCK_P67        0x7023
 
34
 
31
35
static const char hcd_name[] = "xhci_hcd";
32
36
 
33
37
/* called after powerup, by probe or system-pm "wakeup" */
105
109
 
106
110
        /* Look for vendor-specific quirks */
107
111
        if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
108
 
                        pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
109
 
                        pdev->revision == 0x0) {
 
112
                        pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) {
 
113
                if (pdev->revision == 0x0) {
110
114
                        xhci->quirks |= XHCI_RESET_EP_QUIRK;
111
115
                        xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure"
112
116
                                        " endpoint cmd after reset endpoint\n");
 
117
                }
 
118
                /* Fresco Logic confirms: all revisions of this chip do not
 
119
                 * support MSI, even though some of them claim to in their PCI
 
120
                 * capabilities.
 
121
                 */
 
122
                xhci->quirks |= XHCI_BROKEN_MSI;
 
123
                xhci_dbg(xhci, "QUIRK: Fresco Logic revision %u "
 
124
                                "has broken MSI implementation\n",
 
125
                                pdev->revision);
113
126
        }
 
127
 
114
128
        if (pdev->vendor == PCI_VENDOR_ID_NEC)
115
129
                xhci->quirks |= XHCI_NEC_HOST;
116
130
 
 
131
        /* AMD PLL quirk */
 
132
        if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_find_chipset_info())
 
133
                xhci->quirks |= XHCI_AMD_PLL_FIX;
 
134
        if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
 
135
                        pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) {
 
136
                xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
 
137
                xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
 
138
                xhci->limit_active_eps = 64;
 
139
        }
 
140
        if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
 
141
                        pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
 
142
                xhci->quirks |= XHCI_RESET_ON_RESUME;
 
143
                xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
 
144
        }
 
145
 
117
146
        /* Make sure the HC is halted. */
118
147
        retval = xhci_halt(xhci);
119
148
        if (retval)
237
266
static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
238
267
{
239
268
        struct xhci_hcd         *xhci = hcd_to_xhci(hcd);
 
269
        struct pci_dev          *pdev = to_pci_dev(hcd->self.controller);
240
270
        int                     retval = 0;
241
271
 
 
272
        /* The BIOS on systems with the Intel Panther Point chipset may or may
 
273
         * not support xHCI natively.  That means that during system resume, it
 
274
         * may switch the ports back to EHCI so that users can use their
 
275
         * keyboard to select a kernel from GRUB after resume from hibernate.
 
276
         *
 
277
         * The BIOS is supposed to remember whether the OS had xHCI ports
 
278
         * enabled before resume, and switch the ports back to xHCI when the
 
279
         * BIOS/OS semaphore is written, but we all know we can't trust BIOS
 
280
         * writers.
 
281
         *
 
282
         * Unconditionally switch the ports back to xHCI after a system resume.
 
283
         * We can't tell whether the EHCI or xHCI controller will be resumed
 
284
         * first, so we have to do the port switchover in both drivers.  Writing
 
285
         * a '1' to the port switchover registers should have no effect if the
 
286
         * port was already switched over.
 
287
         */
 
288
        if (usb_is_intel_switchable_xhci(pdev))
 
289
                usb_enable_xhci_ports(pdev);
 
290
 
242
291
        retval = xhci_resume(xhci, hibernated);
243
292
        return retval;
244
293
}