diff options
-rw-r--r-- | drivers/pci/pci.c | 29 | ||||
-rw-r--r-- | include/linux/pci.h | 14 |
2 files changed, 43 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 2a458279327a..2086cd1b5e0e 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -892,6 +892,34 @@ pci_disable_device(struct pci_dev *dev) | |||
892 | } | 892 | } |
893 | 893 | ||
894 | /** | 894 | /** |
895 | * pcibios_set_pcie_reset_state - set reset state for device dev | ||
896 | * @dev: the PCI-E device reset | ||
897 | * @state: Reset state to enter into | ||
898 | * | ||
899 | * | ||
900 | * Sets the PCI-E reset state for the device. This is the default | ||
901 | * implementation. Architecture implementations can override this. | ||
902 | */ | ||
903 | int __attribute__ ((weak)) pcibios_set_pcie_reset_state(struct pci_dev *dev, | ||
904 | enum pcie_reset_state state) | ||
905 | { | ||
906 | return -EINVAL; | ||
907 | } | ||
908 | |||
909 | /** | ||
910 | * pci_set_pcie_reset_state - set reset state for device dev | ||
911 | * @dev: the PCI-E device reset | ||
912 | * @state: Reset state to enter into | ||
913 | * | ||
914 | * | ||
915 | * Sets the PCI reset state for the device. | ||
916 | */ | ||
917 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state) | ||
918 | { | ||
919 | return pcibios_set_pcie_reset_state(dev, state); | ||
920 | } | ||
921 | |||
922 | /** | ||
895 | * pci_enable_wake - enable PCI device as wakeup event source | 923 | * pci_enable_wake - enable PCI device as wakeup event source |
896 | * @dev: PCI device affected | 924 | * @dev: PCI device affected |
897 | * @state: PCI state from which device will issue wakeup events | 925 | * @state: PCI state from which device will issue wakeup events |
@@ -1427,4 +1455,5 @@ EXPORT_SYMBOL(pci_set_power_state); | |||
1427 | EXPORT_SYMBOL(pci_save_state); | 1455 | EXPORT_SYMBOL(pci_save_state); |
1428 | EXPORT_SYMBOL(pci_restore_state); | 1456 | EXPORT_SYMBOL(pci_restore_state); |
1429 | EXPORT_SYMBOL(pci_enable_wake); | 1457 | EXPORT_SYMBOL(pci_enable_wake); |
1458 | EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state); | ||
1430 | 1459 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 972491089ac9..3aba02a04792 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -96,6 +96,19 @@ enum pci_channel_state { | |||
96 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, | 96 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | typedef unsigned int __bitwise pcie_reset_state_t; | ||
100 | |||
101 | enum pcie_reset_state { | ||
102 | /* Reset is NOT asserted (Use to deassert reset) */ | ||
103 | pcie_deassert_reset = (__force pcie_reset_state_t) 1, | ||
104 | |||
105 | /* Use #PERST to reset PCI-E device */ | ||
106 | pcie_warm_reset = (__force pcie_reset_state_t) 2, | ||
107 | |||
108 | /* Use PCI-E Hot Reset to reset device */ | ||
109 | pcie_hot_reset = (__force pcie_reset_state_t) 3 | ||
110 | }; | ||
111 | |||
99 | typedef unsigned short __bitwise pci_bus_flags_t; | 112 | typedef unsigned short __bitwise pci_bus_flags_t; |
100 | enum pci_bus_flags { | 113 | enum pci_bus_flags { |
101 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, | 114 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, |
@@ -532,6 +545,7 @@ static inline int pci_is_managed(struct pci_dev *pdev) | |||
532 | 545 | ||
533 | void pci_disable_device(struct pci_dev *dev); | 546 | void pci_disable_device(struct pci_dev *dev); |
534 | void pci_set_master(struct pci_dev *dev); | 547 | void pci_set_master(struct pci_dev *dev); |
548 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | ||
535 | #define HAVE_PCI_SET_MWI | 549 | #define HAVE_PCI_SET_MWI |
536 | int __must_check pci_set_mwi(struct pci_dev *dev); | 550 | int __must_check pci_set_mwi(struct pci_dev *dev); |
537 | void pci_clear_mwi(struct pci_dev *dev); | 551 | void pci_clear_mwi(struct pci_dev *dev); |