aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/sis-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/sis-agp.c')
-rw-r--r--drivers/char/agp/sis-agp.c47
1 files changed, 45 insertions, 2 deletions
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
index eb1a1c73819..b6791846809 100644
--- a/drivers/char/agp/sis-agp.c
+++ b/drivers/char/agp/sis-agp.c
@@ -14,6 +14,9 @@
14#define SIS_TLBCNTRL 0x97 14#define SIS_TLBCNTRL 0x97
15#define SIS_TLBFLUSH 0x98 15#define SIS_TLBFLUSH 0x98
16 16
17#define PCI_DEVICE_ID_SI_662 0x0662
18#define PCI_DEVICE_ID_SI_671 0x0671
19
17static int __devinitdata agp_sis_force_delay = 0; 20static int __devinitdata agp_sis_force_delay = 0;
18static int __devinitdata agp_sis_agp_spec = -1; 21static int __devinitdata agp_sis_agp_spec = -1;
19 22
@@ -27,8 +30,8 @@ static int sis_fetch_size(void)
27 values = A_SIZE_8(agp_bridge->driver->aperture_sizes); 30 values = A_SIZE_8(agp_bridge->driver->aperture_sizes);
28 for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { 31 for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) {
29 if ((temp_size == values[i].size_value) || 32 if ((temp_size == values[i].size_value) ||
30 ((temp_size & ~(0x03)) == 33 ((temp_size & ~(0x07)) ==
31 (values[i].size_value & ~(0x03)))) { 34 (values[i].size_value & ~(0x07)))) {
32 agp_bridge->previous_size = 35 agp_bridge->previous_size =
33 agp_bridge->current_size = (void *) (values + i); 36 agp_bridge->current_size = (void *) (values + i);
34 37
@@ -214,6 +217,26 @@ static void __devexit agp_sis_remove(struct pci_dev *pdev)
214 agp_put_bridge(bridge); 217 agp_put_bridge(bridge);
215} 218}
216 219
220#ifdef CONFIG_PM
221
222static int agp_sis_suspend(struct pci_dev *pdev, pm_message_t state)
223{
224 pci_save_state(pdev);
225 pci_set_power_state(pdev, pci_choose_state(pdev, state));
226
227 return 0;
228}
229
230static int agp_sis_resume(struct pci_dev *pdev)
231{
232 pci_set_power_state(pdev, PCI_D0);
233 pci_restore_state(pdev);
234
235 return sis_driver.configure();
236}
237
238#endif /* CONFIG_PM */
239
217static struct pci_device_id agp_sis_pci_table[] = { 240static struct pci_device_id agp_sis_pci_table[] = {
218 { 241 {
219 .class = (PCI_CLASS_BRIDGE_HOST << 8), 242 .class = (PCI_CLASS_BRIDGE_HOST << 8),
@@ -331,6 +354,22 @@ static struct pci_device_id agp_sis_pci_table[] = {
331 .class = (PCI_CLASS_BRIDGE_HOST << 8), 354 .class = (PCI_CLASS_BRIDGE_HOST << 8),
332 .class_mask = ~0, 355 .class_mask = ~0,
333 .vendor = PCI_VENDOR_ID_SI, 356 .vendor = PCI_VENDOR_ID_SI,
357 .device = PCI_DEVICE_ID_SI_662,
358 .subvendor = PCI_ANY_ID,
359 .subdevice = PCI_ANY_ID,
360 },
361 {
362 .class = (PCI_CLASS_BRIDGE_HOST << 8),
363 .class_mask = ~0,
364 .vendor = PCI_VENDOR_ID_SI,
365 .device = PCI_DEVICE_ID_SI_671,
366 .subvendor = PCI_ANY_ID,
367 .subdevice = PCI_ANY_ID,
368 },
369 {
370 .class = (PCI_CLASS_BRIDGE_HOST << 8),
371 .class_mask = ~0,
372 .vendor = PCI_VENDOR_ID_SI,
334 .device = PCI_DEVICE_ID_SI_730, 373 .device = PCI_DEVICE_ID_SI_730,
335 .subvendor = PCI_ANY_ID, 374 .subvendor = PCI_ANY_ID,
336 .subdevice = PCI_ANY_ID, 375 .subdevice = PCI_ANY_ID,
@@ -393,6 +432,10 @@ static struct pci_driver agp_sis_pci_driver = {
393 .id_table = agp_sis_pci_table, 432 .id_table = agp_sis_pci_table,
394 .probe = agp_sis_probe, 433 .probe = agp_sis_probe,
395 .remove = agp_sis_remove, 434 .remove = agp_sis_remove,
435#ifdef CONFIG_PM
436 .suspend = agp_sis_suspend,
437 .resume = agp_sis_resume,
438#endif
396}; 439};
397 440
398static int __init agp_sis_init(void) 441static int __init agp_sis_init(void)