diff options
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index fc734014206f..ec582d37c189 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/ktime.h> | 26 | #include <linux/ktime.h> |
27 | #include <linux/mm.h> | 27 | #include <linux/mm.h> |
28 | #include <linux/platform_data/x86/apple.h> | 28 | #include <linux/platform_data/x86/apple.h> |
29 | #include <linux/pm_runtime.h> | ||
29 | #include <asm/dma.h> /* isa_dma_bridge_buggy */ | 30 | #include <asm/dma.h> /* isa_dma_bridge_buggy */ |
30 | #include "pci.h" | 31 | #include "pci.h" |
31 | 32 | ||
@@ -4832,3 +4833,41 @@ static void quirk_fsl_no_msi(struct pci_dev *pdev) | |||
4832 | pdev->no_msi = 1; | 4833 | pdev->no_msi = 1; |
4833 | } | 4834 | } |
4834 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, quirk_fsl_no_msi); | 4835 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, quirk_fsl_no_msi); |
4836 | |||
4837 | /* | ||
4838 | * GPUs with integrated HDA controller for streaming audio to attached displays | ||
4839 | * need a device link from the HDA controller (consumer) to the GPU (supplier) | ||
4840 | * so that the GPU is powered up whenever the HDA controller is accessed. | ||
4841 | * The GPU and HDA controller are functions 0 and 1 of the same PCI device. | ||
4842 | * The device link stays in place until shutdown (or removal of the PCI device | ||
4843 | * if it's hotplugged). Runtime PM is allowed by default on the HDA controller | ||
4844 | * to prevent it from permanently keeping the GPU awake. | ||
4845 | */ | ||
4846 | static void quirk_gpu_hda(struct pci_dev *hda) | ||
4847 | { | ||
4848 | struct pci_dev *gpu; | ||
4849 | |||
4850 | if (PCI_FUNC(hda->devfn) != 1) | ||
4851 | return; | ||
4852 | |||
4853 | gpu = pci_get_domain_bus_and_slot(pci_domain_nr(hda->bus), | ||
4854 | hda->bus->number, | ||
4855 | PCI_DEVFN(PCI_SLOT(hda->devfn), 0)); | ||
4856 | if (!gpu || (gpu->class >> 16) != PCI_BASE_CLASS_DISPLAY) { | ||
4857 | pci_dev_put(gpu); | ||
4858 | return; | ||
4859 | } | ||
4860 | |||
4861 | if (!device_link_add(&hda->dev, &gpu->dev, | ||
4862 | DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME)) | ||
4863 | pci_err(hda, "cannot link HDA to GPU %s\n", pci_name(gpu)); | ||
4864 | |||
4865 | pm_runtime_allow(&hda->dev); | ||
4866 | pci_dev_put(gpu); | ||
4867 | } | ||
4868 | DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, PCI_ANY_ID, | ||
4869 | PCI_CLASS_MULTIMEDIA_HD_AUDIO, 8, quirk_gpu_hda); | ||
4870 | DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMD, PCI_ANY_ID, | ||
4871 | PCI_CLASS_MULTIMEDIA_HD_AUDIO, 8, quirk_gpu_hda); | ||
4872 | DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, | ||
4873 | PCI_CLASS_MULTIMEDIA_HD_AUDIO, 8, quirk_gpu_hda); | ||