mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 02:00:43 -04:00
Merge branch 'pci/pm-agp'
- Convert AGP efficeon, intel, amd-k7, ati, nvidia to generic power management (Bjorn Helgaas) * pci/pm-agp: agp/via: Update to DEFINE_SIMPLE_DEV_PM_OPS() agp/sis: Update to DEFINE_SIMPLE_DEV_PM_OPS() agp/amd64: Update to DEFINE_SIMPLE_DEV_PM_OPS() agp/nvidia: Convert to generic power management agp/ati: Convert to generic power management agp/amd-k7: Convert to generic power management agp/intel: Convert to generic power management agp/efficeon: Convert to generic power management
This commit is contained in:
@@ -488,26 +488,11 @@ static void agp_amdk7_remove(struct pci_dev *pdev)
|
||||
agp_put_bridge(bridge);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
static int agp_amdk7_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||
static int agp_amdk7_resume(struct device *dev)
|
||||
{
|
||||
pci_save_state(pdev);
|
||||
pci_set_power_state(pdev, pci_choose_state(pdev, state));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int agp_amdk7_resume(struct pci_dev *pdev)
|
||||
{
|
||||
pci_set_power_state(pdev, PCI_D0);
|
||||
pci_restore_state(pdev);
|
||||
|
||||
return amd_irongate_driver.configure();
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
/* must be the same order as name table above */
|
||||
static const struct pci_device_id agp_amdk7_pci_table[] = {
|
||||
{
|
||||
@@ -539,15 +524,14 @@ static const struct pci_device_id agp_amdk7_pci_table[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, agp_amdk7_pci_table);
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(agp_amdk7_pm_ops, NULL, agp_amdk7_resume);
|
||||
|
||||
static struct pci_driver agp_amdk7_pci_driver = {
|
||||
.name = "agpgart-amdk7",
|
||||
.id_table = agp_amdk7_pci_table,
|
||||
.probe = agp_amdk7_probe,
|
||||
.remove = agp_amdk7_remove,
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = agp_amdk7_suspend,
|
||||
.resume = agp_amdk7_resume,
|
||||
#endif
|
||||
.driver.pm = &agp_amdk7_pm_ops,
|
||||
};
|
||||
|
||||
static int __init agp_amdk7_init(void)
|
||||
|
||||
@@ -588,9 +588,7 @@ static void agp_amd64_remove(struct pci_dev *pdev)
|
||||
agp_bridges_found--;
|
||||
}
|
||||
|
||||
#define agp_amd64_suspend NULL
|
||||
|
||||
static int __maybe_unused agp_amd64_resume(struct device *dev)
|
||||
static int agp_amd64_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
|
||||
@@ -727,7 +725,7 @@ static const struct pci_device_id agp_amd64_pci_promisc_table[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(agp_amd64_pm_ops, agp_amd64_suspend, agp_amd64_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(agp_amd64_pm_ops, NULL, agp_amd64_resume);
|
||||
|
||||
static struct pci_driver agp_amd64_pci_driver = {
|
||||
.name = "agpgart-amd64",
|
||||
|
||||
@@ -238,23 +238,10 @@ static int ati_configure(void)
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int agp_ati_suspend(struct pci_dev *dev, pm_message_t state)
|
||||
static int agp_ati_resume(struct device *dev)
|
||||
{
|
||||
pci_save_state(dev);
|
||||
pci_set_power_state(dev, PCI_D3hot);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int agp_ati_resume(struct pci_dev *dev)
|
||||
{
|
||||
pci_set_power_state(dev, PCI_D0);
|
||||
pci_restore_state(dev);
|
||||
|
||||
return ati_configure();
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*Since we don't need contiguous memory we just try
|
||||
@@ -559,15 +546,14 @@ static const struct pci_device_id agp_ati_pci_table[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, agp_ati_pci_table);
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(agp_ati_pm_ops, NULL, agp_ati_resume);
|
||||
|
||||
static struct pci_driver agp_ati_pci_driver = {
|
||||
.name = "agpgart-ati",
|
||||
.id_table = agp_ati_pci_table,
|
||||
.probe = agp_ati_probe,
|
||||
.remove = agp_ati_remove,
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = agp_ati_suspend,
|
||||
.resume = agp_ati_resume,
|
||||
#endif
|
||||
.driver.pm = &agp_ati_pm_ops,
|
||||
};
|
||||
|
||||
static int __init agp_ati_init(void)
|
||||
|
||||
@@ -412,18 +412,11 @@ static void agp_efficeon_remove(struct pci_dev *pdev)
|
||||
agp_put_bridge(bridge);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int agp_efficeon_suspend(struct pci_dev *dev, pm_message_t state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int agp_efficeon_resume(struct pci_dev *pdev)
|
||||
static int agp_efficeon_resume(struct device *dev)
|
||||
{
|
||||
printk(KERN_DEBUG PFX "agp_efficeon_resume()\n");
|
||||
return efficeon_configure();
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct pci_device_id agp_efficeon_pci_table[] = {
|
||||
{
|
||||
@@ -437,6 +430,8 @@ static const struct pci_device_id agp_efficeon_pci_table[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(agp_efficeon_pm_ops, NULL, agp_efficeon_resume);
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, agp_efficeon_pci_table);
|
||||
|
||||
static struct pci_driver agp_efficeon_pci_driver = {
|
||||
@@ -444,10 +439,7 @@ static struct pci_driver agp_efficeon_pci_driver = {
|
||||
.id_table = agp_efficeon_pci_table,
|
||||
.probe = agp_efficeon_probe,
|
||||
.remove = agp_efficeon_remove,
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = agp_efficeon_suspend,
|
||||
.resume = agp_efficeon_resume,
|
||||
#endif
|
||||
.driver.pm = &agp_efficeon_pm_ops,
|
||||
};
|
||||
|
||||
static int __init agp_efficeon_init(void)
|
||||
|
||||
@@ -817,16 +817,15 @@ static void agp_intel_remove(struct pci_dev *pdev)
|
||||
agp_put_bridge(bridge);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int agp_intel_resume(struct pci_dev *pdev)
|
||||
static int agp_intel_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
|
||||
|
||||
bridge->driver->configure();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct pci_device_id agp_intel_pci_table[] = {
|
||||
#define ID(x) \
|
||||
@@ -895,14 +894,14 @@ static const struct pci_device_id agp_intel_pci_table[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, agp_intel_pci_table);
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(agp_intel_pm_ops, NULL, agp_intel_resume);
|
||||
|
||||
static struct pci_driver agp_intel_pci_driver = {
|
||||
.name = "agpgart-intel",
|
||||
.id_table = agp_intel_pci_table,
|
||||
.probe = agp_intel_probe,
|
||||
.remove = agp_intel_remove,
|
||||
#ifdef CONFIG_PM
|
||||
.resume = agp_intel_resume,
|
||||
#endif
|
||||
.driver.pm = &agp_intel_pm_ops,
|
||||
};
|
||||
|
||||
static int __init agp_intel_init(void)
|
||||
|
||||
@@ -404,28 +404,13 @@ static void agp_nvidia_remove(struct pci_dev *pdev)
|
||||
agp_put_bridge(bridge);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int agp_nvidia_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||
static int agp_nvidia_resume(struct device *dev)
|
||||
{
|
||||
pci_save_state(pdev);
|
||||
pci_set_power_state(pdev, PCI_D3hot);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int agp_nvidia_resume(struct pci_dev *pdev)
|
||||
{
|
||||
/* set power state 0 and restore PCI space */
|
||||
pci_set_power_state(pdev, PCI_D0);
|
||||
pci_restore_state(pdev);
|
||||
|
||||
/* reconfigure AGP hardware again */
|
||||
nvidia_configure();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static const struct pci_device_id agp_nvidia_pci_table[] = {
|
||||
{
|
||||
@@ -449,15 +434,14 @@ static const struct pci_device_id agp_nvidia_pci_table[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, agp_nvidia_pci_table);
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(agp_nvidia_pm_ops, NULL, agp_nvidia_resume);
|
||||
|
||||
static struct pci_driver agp_nvidia_pci_driver = {
|
||||
.name = "agpgart-nvidia",
|
||||
.id_table = agp_nvidia_pci_table,
|
||||
.probe = agp_nvidia_probe,
|
||||
.remove = agp_nvidia_remove,
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = agp_nvidia_suspend,
|
||||
.resume = agp_nvidia_resume,
|
||||
#endif
|
||||
.driver.pm = &agp_nvidia_pm_ops,
|
||||
};
|
||||
|
||||
static int __init agp_nvidia_init(void)
|
||||
|
||||
@@ -217,10 +217,7 @@ static void agp_sis_remove(struct pci_dev *pdev)
|
||||
agp_put_bridge(bridge);
|
||||
}
|
||||
|
||||
#define agp_sis_suspend NULL
|
||||
|
||||
static int __maybe_unused agp_sis_resume(
|
||||
__attribute__((unused)) struct device *dev)
|
||||
static int agp_sis_resume(__attribute__((unused)) struct device *dev)
|
||||
{
|
||||
return sis_driver.configure();
|
||||
}
|
||||
@@ -407,7 +404,7 @@ static const struct pci_device_id agp_sis_pci_table[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, agp_sis_pci_table);
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(agp_sis_pm_ops, agp_sis_suspend, agp_sis_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(agp_sis_pm_ops, NULL, agp_sis_resume);
|
||||
|
||||
static struct pci_driver agp_sis_pci_driver = {
|
||||
.name = "agpgart-sis",
|
||||
|
||||
@@ -489,9 +489,7 @@ static void agp_via_remove(struct pci_dev *pdev)
|
||||
agp_put_bridge(bridge);
|
||||
}
|
||||
|
||||
#define agp_via_suspend NULL
|
||||
|
||||
static int __maybe_unused agp_via_resume(struct device *dev)
|
||||
static int agp_via_resume(struct device *dev)
|
||||
{
|
||||
struct agp_bridge_data *bridge = dev_get_drvdata(dev);
|
||||
|
||||
@@ -551,7 +549,7 @@ static const struct pci_device_id agp_via_pci_table[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, agp_via_pci_table);
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(agp_via_pm_ops, agp_via_suspend, agp_via_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(agp_via_pm_ops, NULL, agp_via_resume);
|
||||
|
||||
static struct pci_driver agp_via_pci_driver = {
|
||||
.name = "agpgart-via",
|
||||
|
||||
Reference in New Issue
Block a user