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