mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Suspend changes for PCI core
Changes the PCI core to use the new suspend infrastructure changes. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
7c8265f510
commit
cbd69dbbf1
2 changed files with 43 additions and 1 deletions
|
@ -264,6 +264,19 @@ static int pci_device_remove(struct device * dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int pci_device_suspend_prepare(struct device * dev, pm_message_t state)
|
||||||
|
{
|
||||||
|
struct pci_dev * pci_dev = to_pci_dev(dev);
|
||||||
|
struct pci_driver * drv = pci_dev->driver;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
if (drv && drv->suspend_prepare) {
|
||||||
|
i = drv->suspend_prepare(pci_dev, state);
|
||||||
|
suspend_report_result(drv->suspend_prepare, i);
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
static int pci_device_suspend(struct device * dev, pm_message_t state)
|
static int pci_device_suspend(struct device * dev, pm_message_t state)
|
||||||
{
|
{
|
||||||
struct pci_dev * pci_dev = to_pci_dev(dev);
|
struct pci_dev * pci_dev = to_pci_dev(dev);
|
||||||
|
@ -279,6 +292,18 @@ static int pci_device_suspend(struct device * dev, pm_message_t state)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int pci_device_suspend_late(struct device * dev, pm_message_t state)
|
||||||
|
{
|
||||||
|
struct pci_dev * pci_dev = to_pci_dev(dev);
|
||||||
|
struct pci_driver * drv = pci_dev->driver;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
if (drv && drv->suspend_late) {
|
||||||
|
i = drv->suspend_late(pci_dev, state);
|
||||||
|
suspend_report_result(drv->suspend_late, i);
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default resume method for devices that have no driver provided resume,
|
* Default resume method for devices that have no driver provided resume,
|
||||||
|
@ -313,6 +338,17 @@ static int pci_device_resume(struct device * dev)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int pci_device_resume_early(struct device * dev)
|
||||||
|
{
|
||||||
|
int error = 0;
|
||||||
|
struct pci_dev * pci_dev = to_pci_dev(dev);
|
||||||
|
struct pci_driver * drv = pci_dev->driver;
|
||||||
|
|
||||||
|
if (drv && drv->resume_early)
|
||||||
|
error = drv->resume_early(pci_dev);
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
static void pci_device_shutdown(struct device *dev)
|
static void pci_device_shutdown(struct device *dev)
|
||||||
{
|
{
|
||||||
struct pci_dev *pci_dev = to_pci_dev(dev);
|
struct pci_dev *pci_dev = to_pci_dev(dev);
|
||||||
|
@ -508,9 +544,12 @@ struct bus_type pci_bus_type = {
|
||||||
.uevent = pci_uevent,
|
.uevent = pci_uevent,
|
||||||
.probe = pci_device_probe,
|
.probe = pci_device_probe,
|
||||||
.remove = pci_device_remove,
|
.remove = pci_device_remove,
|
||||||
|
.suspend_prepare= pci_device_suspend_prepare,
|
||||||
.suspend = pci_device_suspend,
|
.suspend = pci_device_suspend,
|
||||||
.shutdown = pci_device_shutdown,
|
.suspend_late = pci_device_suspend_late,
|
||||||
|
.resume_early = pci_device_resume_early,
|
||||||
.resume = pci_device_resume,
|
.resume = pci_device_resume,
|
||||||
|
.shutdown = pci_device_shutdown,
|
||||||
.dev_attrs = pci_dev_attrs,
|
.dev_attrs = pci_dev_attrs,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -345,7 +345,10 @@ struct pci_driver {
|
||||||
const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
|
const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
|
||||||
int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
|
int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
|
||||||
void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
|
void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
|
||||||
|
int (*suspend_prepare) (struct pci_dev *dev, pm_message_t state);
|
||||||
int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */
|
int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */
|
||||||
|
int (*suspend_late) (struct pci_dev *dev, pm_message_t state);
|
||||||
|
int (*resume_early) (struct pci_dev *dev);
|
||||||
int (*resume) (struct pci_dev *dev); /* Device woken up */
|
int (*resume) (struct pci_dev *dev); /* Device woken up */
|
||||||
int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */
|
int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */
|
||||||
void (*shutdown) (struct pci_dev *dev);
|
void (*shutdown) (struct pci_dev *dev);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue