aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2010-02-02 17:38:13 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-05 17:05:41 -0500
commit95a8b6efc5d07103583f706c8a5889437d537939 (patch)
treea8e9161eea03b0eb21e838826c547771158ecdce /drivers/pci/pci.c
parent499a2673713c85734a54c37dd90b4b729de399c4 (diff)
pci: Update pci_set_vga_state() to call arch functions
Update pci_set_vga_state to call arch dependent functions to enable Legacy VGA I/O transactions to be redirected to correct target. [akpm@linux-foundation.org: make pci_register_set_vga_state() __init] Signed-off-by: Mike Travis <travis@sgi.com> LKML-Reference: <201002022238.o12McE1J018723@imap1.linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Robin Holt <holt@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: David Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 315fea47e784..ac2a576133f9 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2615,6 +2615,23 @@ int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type)
2615 return 0; 2615 return 0;
2616} 2616}
2617 2617
2618/* Some architectures require additional programming to enable VGA */
2619static arch_set_vga_state_t arch_set_vga_state;
2620
2621void __init pci_register_set_vga_state(arch_set_vga_state_t func)
2622{
2623 arch_set_vga_state = func; /* NULL disables */
2624}
2625
2626static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode,
2627 unsigned int command_bits, bool change_bridge)
2628{
2629 if (arch_set_vga_state)
2630 return arch_set_vga_state(dev, decode, command_bits,
2631 change_bridge);
2632 return 0;
2633}
2634
2618/** 2635/**
2619 * pci_set_vga_state - set VGA decode state on device and parents if requested 2636 * pci_set_vga_state - set VGA decode state on device and parents if requested
2620 * @dev: the PCI device 2637 * @dev: the PCI device
@@ -2628,9 +2645,15 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
2628 struct pci_bus *bus; 2645 struct pci_bus *bus;
2629 struct pci_dev *bridge; 2646 struct pci_dev *bridge;
2630 u16 cmd; 2647 u16 cmd;
2648 int rc;
2631 2649
2632 WARN_ON(command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)); 2650 WARN_ON(command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY));
2633 2651
2652 /* ARCH specific VGA enables */
2653 rc = pci_set_vga_state_arch(dev, decode, command_bits, change_bridge);
2654 if (rc)
2655 return rc;
2656
2634 pci_read_config_word(dev, PCI_COMMAND, &cmd); 2657 pci_read_config_word(dev, PCI_COMMAND, &cmd);
2635 if (decode == true) 2658 if (decode == true)
2636 cmd |= command_bits; 2659 cmd |= command_bits;
@@ -2845,6 +2868,7 @@ EXPORT_SYMBOL(pcim_pin_device);
2845EXPORT_SYMBOL(pci_disable_device); 2868EXPORT_SYMBOL(pci_disable_device);
2846EXPORT_SYMBOL(pci_find_capability); 2869EXPORT_SYMBOL(pci_find_capability);
2847EXPORT_SYMBOL(pci_bus_find_capability); 2870EXPORT_SYMBOL(pci_bus_find_capability);
2871EXPORT_SYMBOL(pci_register_set_vga_state);
2848EXPORT_SYMBOL(pci_release_regions); 2872EXPORT_SYMBOL(pci_release_regions);
2849EXPORT_SYMBOL(pci_request_regions); 2873EXPORT_SYMBOL(pci_request_regions);
2850EXPORT_SYMBOL(pci_request_regions_exclusive); 2874EXPORT_SYMBOL(pci_request_regions_exclusive);
@@ -2877,4 +2901,3 @@ EXPORT_SYMBOL(pci_target_state);
2877EXPORT_SYMBOL(pci_prepare_to_sleep); 2901EXPORT_SYMBOL(pci_prepare_to_sleep);
2878EXPORT_SYMBOL(pci_back_from_sleep); 2902EXPORT_SYMBOL(pci_back_from_sleep);
2879EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); 2903EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state);
2880