diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-04-27 13:33:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:44 -0400 |
commit | 00240c3839d843ccf07abd52806f421f7b87bbdc (patch) | |
tree | 4ad3a8c543a7a3de0893b1289086e62fffb98bc6 | |
parent | 604eb89ffed9fba268582dc44d5b462ea94cc0ca (diff) |
PCI: add power-state name strings
This patch (as1235) adds an array of PCI power-state names, together
with a simple inline accessor routine.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/pci/pci.c | 5 | ||||
-rw-r--r-- | include/linux/pci.h | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1a91bf9687af..07bbb9b3b93f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -24,6 +24,11 @@ | |||
24 | #include <asm/setup.h> | 24 | #include <asm/setup.h> |
25 | #include "pci.h" | 25 | #include "pci.h" |
26 | 26 | ||
27 | const char *pci_power_names[] = { | ||
28 | "error", "D0", "D1", "D2", "D3hot", "D3cold", "unknown", | ||
29 | }; | ||
30 | EXPORT_SYMBOL_GPL(pci_power_names); | ||
31 | |||
27 | unsigned int pci_pm_d3_delay = PCI_PM_D3_WAIT; | 32 | unsigned int pci_pm_d3_delay = PCI_PM_D3_WAIT; |
28 | 33 | ||
29 | #ifdef CONFIG_PCI_DOMAINS | 34 | #ifdef CONFIG_PCI_DOMAINS |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 72698d89e767..8e366bb0705f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -124,6 +124,14 @@ typedef int __bitwise pci_power_t; | |||
124 | #define PCI_UNKNOWN ((pci_power_t __force) 5) | 124 | #define PCI_UNKNOWN ((pci_power_t __force) 5) |
125 | #define PCI_POWER_ERROR ((pci_power_t __force) -1) | 125 | #define PCI_POWER_ERROR ((pci_power_t __force) -1) |
126 | 126 | ||
127 | /* Remember to update this when the list above changes! */ | ||
128 | extern const char *pci_power_names[]; | ||
129 | |||
130 | static inline const char *pci_power_name(pci_power_t state) | ||
131 | { | ||
132 | return pci_power_names[1 + (int) state]; | ||
133 | } | ||
134 | |||
127 | #define PCI_PM_D2_DELAY 200 | 135 | #define PCI_PM_D2_DELAY 200 |
128 | #define PCI_PM_D3_WAIT 10 | 136 | #define PCI_PM_D3_WAIT 10 |
129 | #define PCI_PM_BUS_WAIT 50 | 137 | #define PCI_PM_BUS_WAIT 50 |