USB: xHCI: bus power management implementation
[pandora-kernel.git] / drivers / usb / host / xhci-pci.c
index 11482b6..3865f8c 100644 (file)
@@ -53,6 +53,7 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
        struct xhci_hcd         *xhci = hcd_to_xhci(hcd);
        struct pci_dev          *pdev = to_pci_dev(hcd->self.controller);
        int                     retval;
+       u32                     temp;
 
        hcd->self.sg_tablesize = TRBS_PER_SEGMENT - 2;
 
@@ -93,6 +94,14 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
                return retval;
        xhci_dbg(xhci, "Reset complete\n");
 
+       temp = xhci_readl(xhci, &xhci->cap_regs->hcc_params);
+       if (HCC_64BIT_ADDR(temp)) {
+               xhci_dbg(xhci, "Enabling 64-bit DMA addresses.\n");
+               dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64));
+       } else {
+               dma_set_mask(hcd->self.controller, DMA_BIT_MASK(32));
+       }
+
        xhci_dbg(xhci, "Calling HCD init\n");
        /* Initialize HCD and host controller data structures. */
        retval = xhci_init(hcd);
@@ -143,7 +152,7 @@ static const struct hc_driver xhci_pci_hc_driver = {
        .reset_bandwidth =      xhci_reset_bandwidth,
        .address_device =       xhci_address_device,
        .update_hub_device =    xhci_update_hub_device,
-       .reset_device =         xhci_reset_device,
+       .reset_device =         xhci_discover_or_reset_device,
 
        /*
         * scheduling support
@@ -153,6 +162,8 @@ static const struct hc_driver xhci_pci_hc_driver = {
        /* Root hub support */
        .hub_control =          xhci_hub_control,
        .hub_status_data =      xhci_hub_status_data,
+       .bus_suspend =          xhci_bus_suspend,
+       .bus_resume =           xhci_bus_resume,
 };
 
 /*-------------------------------------------------------------------------*/