diff options
author | Mike Travis <travis@sgi.com> | 2010-02-02 17:38:13 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-05 17:05:41 -0500 |
commit | 95a8b6efc5d07103583f706c8a5889437d537939 (patch) | |
tree | a8e9161eea03b0eb21e838826c547771158ecdce /drivers | |
parent | 499a2673713c85734a54c37dd90b4b729de399c4 (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')
-rw-r--r-- | drivers/pci/pci.c | 25 |
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 */ | ||
2619 | static arch_set_vga_state_t arch_set_vga_state; | ||
2620 | |||
2621 | void __init pci_register_set_vga_state(arch_set_vga_state_t func) | ||
2622 | { | ||
2623 | arch_set_vga_state = func; /* NULL disables */ | ||
2624 | } | ||
2625 | |||
2626 | static 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); | |||
2845 | EXPORT_SYMBOL(pci_disable_device); | 2868 | EXPORT_SYMBOL(pci_disable_device); |
2846 | EXPORT_SYMBOL(pci_find_capability); | 2869 | EXPORT_SYMBOL(pci_find_capability); |
2847 | EXPORT_SYMBOL(pci_bus_find_capability); | 2870 | EXPORT_SYMBOL(pci_bus_find_capability); |
2871 | EXPORT_SYMBOL(pci_register_set_vga_state); | ||
2848 | EXPORT_SYMBOL(pci_release_regions); | 2872 | EXPORT_SYMBOL(pci_release_regions); |
2849 | EXPORT_SYMBOL(pci_request_regions); | 2873 | EXPORT_SYMBOL(pci_request_regions); |
2850 | EXPORT_SYMBOL(pci_request_regions_exclusive); | 2874 | EXPORT_SYMBOL(pci_request_regions_exclusive); |
@@ -2877,4 +2901,3 @@ EXPORT_SYMBOL(pci_target_state); | |||
2877 | EXPORT_SYMBOL(pci_prepare_to_sleep); | 2901 | EXPORT_SYMBOL(pci_prepare_to_sleep); |
2878 | EXPORT_SYMBOL(pci_back_from_sleep); | 2902 | EXPORT_SYMBOL(pci_back_from_sleep); |
2879 | EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); | 2903 | EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); |
2880 | |||