2 From: Arkadiusz Miskiewicz <arekm@pld-linux.org>
4 With this patch I'm able to suspend to disk (well, works even without
5 patch) and resume (without it my laptop hangs (even sysrq is not working)
8 Signed-off-by: Arkadiusz Miskiewicz <arekm@pld-linux.org>
9 Signed-off-by: Andrew Morton <akpm@osdl.org>
12 25-akpm/drivers/char/agp/via-agp.c | 31 +++++++++++++++++++++++++++++++
13 1 files changed, 31 insertions(+)
15 diff -puN drivers/char/agp/via-agp.c~via-agpc-resume-suspend-support drivers/char/agp/via-agp.c
16 --- 25/drivers/char/agp/via-agp.c~via-agpc-resume-suspend-support 2004-08-04 21:01:53.306912184 -0700
17 +++ 25-akpm/drivers/char/agp/via-agp.c 2004-08-04 21:01:53.310911576 -0700
18 @@ -438,6 +438,33 @@ static void __devexit agp_via_remove(str
19 agp_put_bridge(bridge);
24 +static int agp_via_suspend(struct pci_dev *pdev, u32 state)
26 + pci_save_state (pdev, pdev->saved_config_space);
27 + pci_set_power_state (pdev, 3);
32 +static int agp_via_resume(struct pci_dev *pdev)
34 + struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
36 + pci_set_power_state (pdev, 0);
37 + pci_restore_state(pdev, pdev->saved_config_space);
39 + if (bridge->driver == &via_agp3_driver)
40 + return via_configure_agp3();
41 + else if (bridge->driver == &via_driver)
42 + return via_configure();
47 +#endif /* CONFIG_PM */
49 /* must be the same order as name table above */
50 static struct pci_device_id agp_via_pci_table[] = {
52 @@ -487,6 +514,10 @@ static struct pci_driver agp_via_pci_dri
53 .id_table = agp_via_pci_table,
54 .probe = agp_via_probe,
55 .remove = agp_via_remove,
57 + .suspend = agp_via_suspend,
58 + .resume = agp_via_resume,