diff options
Diffstat (limited to 'drivers/pci/pci.c')
| -rw-r--r-- | drivers/pci/pci.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 259d247b7551..61b855c99e39 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -252,6 +252,8 @@ pci_restore_bars(struct pci_dev *dev) | |||
| 252 | pci_update_resource(dev, &dev->resource[i], i); | 252 | pci_update_resource(dev, &dev->resource[i], i); |
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t t); | ||
| 256 | |||
| 255 | /** | 257 | /** |
| 256 | * pci_set_power_state - Set the power state of a PCI device | 258 | * pci_set_power_state - Set the power state of a PCI device |
| 257 | * @dev: PCI device to be suspended | 259 | * @dev: PCI device to be suspended |
| @@ -266,7 +268,6 @@ pci_restore_bars(struct pci_dev *dev) | |||
| 266 | * -EIO if device does not support PCI PM. | 268 | * -EIO if device does not support PCI PM. |
| 267 | * 0 if we can successfully change the power state. | 269 | * 0 if we can successfully change the power state. |
| 268 | */ | 270 | */ |
| 269 | int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t t); | ||
| 270 | int | 271 | int |
| 271 | pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 272 | pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
| 272 | { | 273 | { |
| @@ -314,19 +315,19 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
| 314 | * sets PowerState to 0. | 315 | * sets PowerState to 0. |
| 315 | */ | 316 | */ |
| 316 | switch (dev->current_state) { | 317 | switch (dev->current_state) { |
| 318 | case PCI_D0: | ||
| 319 | case PCI_D1: | ||
| 320 | case PCI_D2: | ||
| 321 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; | ||
| 322 | pmcsr |= state; | ||
| 323 | break; | ||
| 317 | case PCI_UNKNOWN: /* Boot-up */ | 324 | case PCI_UNKNOWN: /* Boot-up */ |
| 318 | if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot | 325 | if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot |
| 319 | && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) | 326 | && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) |
| 320 | need_restore = 1; | 327 | need_restore = 1; |
| 321 | /* Fall-through: force to D0 */ | 328 | /* Fall-through: force to D0 */ |
| 322 | case PCI_D3hot: | ||
| 323 | case PCI_D3cold: | ||
| 324 | case PCI_POWER_ERROR: | ||
| 325 | pmcsr = 0; | ||
| 326 | break; | ||
| 327 | default: | 329 | default: |
| 328 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; | 330 | pmcsr = 0; |
| 329 | pmcsr |= state; | ||
| 330 | break; | 331 | break; |
| 331 | } | 332 | } |
| 332 | 333 | ||
| @@ -808,8 +809,8 @@ pci_clear_mwi(struct pci_dev *dev) | |||
| 808 | 809 | ||
| 809 | /** | 810 | /** |
| 810 | * pci_intx - enables/disables PCI INTx for device dev | 811 | * pci_intx - enables/disables PCI INTx for device dev |
| 811 | * @dev: the PCI device to operate on | 812 | * @pdev: the PCI device to operate on |
| 812 | * @enable: boolean | 813 | * @enable: boolean: whether to enable or disable PCI INTx |
| 813 | * | 814 | * |
| 814 | * Enables/disables PCI INTx for device dev | 815 | * Enables/disables PCI INTx for device dev |
| 815 | */ | 816 | */ |
