aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/amd-k7-agp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 15:43:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 15:43:49 -0400
commita45fbc33137b11e479ea8b7d478a1d7e6488971b (patch)
tree947b39b8d39acd5db2d3a966921ec76443b9b5eb /drivers/char/agp/amd-k7-agp.c
parentc813b4e16ead3c3df98ac84419d4df2adf33fe01 (diff)
parenta64d2b37c2259e169759c1701ac565f0a11dc0ea (diff)
Merge branch 'agp-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6
* 'agp-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6: agp/nvidia: Support agp user-memory on nvidia agp. agp/amd-k7: Suspend support for AMD K7 GART driver agp/intel: Reduce extraneous PCI posting reads during init agp: Fix stolen memory counting on G4X.
Diffstat (limited to 'drivers/char/agp/amd-k7-agp.c')
-rw-r--r--drivers/char/agp/amd-k7-agp.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c
index 603a986e96af..3f98254b911f 100644
--- a/drivers/char/agp/amd-k7-agp.c
+++ b/drivers/char/agp/amd-k7-agp.c
@@ -223,12 +223,14 @@ static int amd_irongate_configure(void)
223 223
224 current_size = A_SIZE_LVL2(agp_bridge->current_size); 224 current_size = A_SIZE_LVL2(agp_bridge->current_size);
225 225
226 /* Get the memory mapped registers */ 226 if (!amd_irongate_private.registers) {
227 pci_read_config_dword(agp_bridge->dev, AMD_MMBASE, &temp); 227 /* Get the memory mapped registers */
228 temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); 228 pci_read_config_dword(agp_bridge->dev, AMD_MMBASE, &temp);
229 amd_irongate_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); 229 temp = (temp & PCI_BASE_ADDRESS_MEM_MASK);
230 if (!amd_irongate_private.registers) 230 amd_irongate_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096);
231 return -ENOMEM; 231 if (!amd_irongate_private.registers)
232 return -ENOMEM;
233 }
232 234
233 /* Write out the address of the gatt table */ 235 /* Write out the address of the gatt table */
234 writel(agp_bridge->gatt_bus_addr, amd_irongate_private.registers+AMD_ATTBASE); 236 writel(agp_bridge->gatt_bus_addr, amd_irongate_private.registers+AMD_ATTBASE);
@@ -492,6 +494,26 @@ static void __devexit agp_amdk7_remove(struct pci_dev *pdev)
492 agp_put_bridge(bridge); 494 agp_put_bridge(bridge);
493} 495}
494 496
497#ifdef CONFIG_PM
498
499static int agp_amdk7_suspend(struct pci_dev *pdev, pm_message_t state)
500{
501 pci_save_state(pdev);
502 pci_set_power_state(pdev, pci_choose_state(pdev, state));
503
504 return 0;
505}
506
507static int agp_amdk7_resume(struct pci_dev *pdev)
508{
509 pci_set_power_state(pdev, PCI_D0);
510 pci_restore_state(pdev);
511
512 return amd_irongate_driver.configure();
513}
514
515#endif /* CONFIG_PM */
516
495/* must be the same order as name table above */ 517/* must be the same order as name table above */
496static struct pci_device_id agp_amdk7_pci_table[] = { 518static struct pci_device_id agp_amdk7_pci_table[] = {
497 { 519 {
@@ -528,6 +550,10 @@ static struct pci_driver agp_amdk7_pci_driver = {
528 .id_table = agp_amdk7_pci_table, 550 .id_table = agp_amdk7_pci_table,
529 .probe = agp_amdk7_probe, 551 .probe = agp_amdk7_probe,
530 .remove = agp_amdk7_remove, 552 .remove = agp_amdk7_remove,
553#ifdef CONFIG_PM
554 .suspend = agp_amdk7_suspend,
555 .resume = agp_amdk7_resume,
556#endif
531}; 557};
532 558
533static int __init agp_amdk7_init(void) 559static int __init agp_amdk7_init(void)