]> git.pld-linux.org Git - packages/kernel.git/blob - linux-2.6-via-agpc-resume-suspend-support.patch
- obsolete
[packages/kernel.git] / linux-2.6-via-agpc-resume-suspend-support.patch
1
2 From: Arkadiusz Miskiewicz <arekm@pld-linux.org>
3
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)
6 while resuming).
7
8 Signed-off-by: Arkadiusz Miskiewicz <arekm@pld-linux.org>
9 Signed-off-by: Andrew Morton <akpm@osdl.org>
10 ---
11
12  25-akpm/drivers/char/agp/via-agp.c |   31 +++++++++++++++++++++++++++++++
13  1 files changed, 31 insertions(+)
14
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);
20  }
21  
22 +#ifdef CONFIG_PM
23 +
24 +static int agp_via_suspend(struct pci_dev *pdev, u32 state)
25 +{
26 +       pci_save_state (pdev, pdev->saved_config_space);
27 +       pci_set_power_state (pdev, 3);
28 +
29 +       return 0;
30 +}
31 +
32 +static int agp_via_resume(struct pci_dev *pdev)
33 +{
34 +       struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
35 +
36 +       pci_set_power_state (pdev, 0);
37 +       pci_restore_state(pdev, pdev->saved_config_space);
38 +
39 +       if (bridge->driver == &via_agp3_driver)
40 +               return via_configure_agp3();
41 +       else if (bridge->driver == &via_driver)
42 +               return via_configure();
43 +
44 +       return 0;
45 +}
46 +
47 +#endif /* CONFIG_PM */
48 +
49  /* must be the same order as name table above */
50  static struct pci_device_id agp_via_pci_table[] = {
51  #define ID(x) \
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,
56 +#ifdef CONFIG_PM
57 +       .suspend        = agp_via_suspend,
58 +       .resume         = agp_via_resume,
59 +#endif
60  };
61  
62  
63 _
This page took 0.03931 seconds and 3 git commands to generate.