2 --- a/drivers/usb/host/pci-quirks.c
3 +++ b/drivers/usb/host/pci-quirks.c
5 #define USB_INTEL_USB3_PSSEN 0xD8
6 #define USB_INTEL_USB3PRM 0xDC
8 +#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
10 static struct amd_chipset_info {
11 struct pci_dev *nb_dev;
12 struct pci_dev *smbus_dev;
13 @@ -353,6 +355,10 @@ void usb_amd_dev_put(void)
15 EXPORT_SYMBOL_GPL(usb_amd_dev_put);
17 +#endif /* CONFIG_PCI_DISABLE_COMMON_QUIRKS */
19 +#if IS_ENABLED(CONFIG_USB_UHCI_HCD)
22 * Make sure the controller is completely inactive, unable to
23 * generate interrupts or do DMA.
24 @@ -432,6 +438,13 @@ reset_needed:
25 uhci_reset_hc(pdev, base);
29 +int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base)
35 EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc);
37 static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask)
38 @@ -461,6 +474,8 @@ static void __devinit quirk_usb_handoff_
39 uhci_check_and_reset_hc(pdev, base);
42 +#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
44 static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx)
46 return pci_resource_start(pdev, idx) && mmio_enabled(pdev);
47 @@ -971,3 +986,4 @@ static void __devinit quirk_usb_early_ha
49 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
50 PCI_CLASS_SERIAL_USB, 8, quirk_usb_early_handoff);
52 --- a/drivers/usb/host/pci-quirks.h
53 +++ b/drivers/usb/host/pci-quirks.h
56 void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
57 int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
58 +bool usb_is_intel_switchable_xhci(struct pci_dev *pdev);
59 +void usb_enable_xhci_ports(struct pci_dev *xhci_pdev);
60 +void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
62 +static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
63 +#endif /* CONFIG_PCI */
65 +#if defined(CONFIG_PCI) && !defined(CONFIG_PCI_DISABLE_COMMON_QUIRKS)
66 int usb_amd_find_chipset_info(void);
67 void usb_amd_dev_put(void);
68 void usb_amd_quirk_pll_disable(void);
69 void usb_amd_quirk_pll_enable(void);
70 -bool usb_is_intel_switchable_xhci(struct pci_dev *pdev);
71 -void usb_enable_xhci_ports(struct pci_dev *xhci_pdev);
72 -void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
74 +static inline int usb_amd_find_chipset_info(void)
78 static inline void usb_amd_quirk_pll_disable(void) {}
79 static inline void usb_amd_quirk_pll_enable(void) {}
80 static inline void usb_amd_dev_put(void) {}
81 -static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
82 -#endif /* CONFIG_PCI */
85 #endif /* __LINUX_USB_PCI_QUIRKS_H */