aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci-common.c
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2013-04-07 23:05:10 -0400
committerMichael Ellerman <michael@ellerman.id.au>2013-04-18 01:59:58 -0400
commitc2e1d84523ad2a19e5be08c1f01999cc9e82652e (patch)
tree6e1d883db255cda10995b2d622880168dc5b9a0c /arch/powerpc/kernel/pci-common.c
parent88e7b167a079f090405ab4390b629b5effdab41a (diff)
powerpc: Set default VGA device
Add a PCI quirk for VGA devices on Power to set the default VGA device. Ensures a default VGA is always set if a graphics adapter is present, even if firmware did not initialize it. If more than one graphics adapter is present, ensure the one initialized by firmware is set as the default VGA device. This ensures that X autoconfiguration will work. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r--arch/powerpc/kernel/pci-common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 032475851d6a..f325dc923409 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -30,6 +30,7 @@
30#include <linux/irq.h> 30#include <linux/irq.h>
31#include <linux/vmalloc.h> 31#include <linux/vmalloc.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/vgaarb.h>
33 34
34#include <asm/processor.h> 35#include <asm/processor.h>
35#include <asm/io.h> 36#include <asm/io.h>
@@ -1734,3 +1735,15 @@ static void fixup_hide_host_resource_fsl(struct pci_dev *dev)
1734} 1735}
1735DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_resource_fsl); 1736DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_resource_fsl);
1736DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl); 1737DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl);
1738
1739static void fixup_vga(struct pci_dev *pdev)
1740{
1741 u16 cmd;
1742
1743 pci_read_config_word(pdev, PCI_COMMAND, &cmd);
1744 if ((cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) || !vga_default_device())
1745 vga_set_default_device(pdev);
1746
1747}
1748DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
1749 PCI_CLASS_DISPLAY_VGA, 8, fixup_vga);