d08e5fecfd0c4929b428bd92beaaa71a20ad8ba7
[openwrt.git] / package / mac80211 / patches / 307-rt2x00-Add-PM-support-for-SoC-rt2800pci.patch
1 From aef81259a944186a120d51e4462a5f974de99fb8 Mon Sep 17 00:00:00 2001
2 From: Ivo van Doorn <IvDoorn@gmail.com>
3 Date: Sun, 15 Mar 2009 15:37:29 +0100
4 Subject: [PATCH] rt2x00: Add PM support for SoC (rt2800pci)
5
6 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
7 ---
8 drivers/net/wireless/rt2x00/rt2800pci.c | 52 +++++++++++++++++++++++++++++--
9 1 files changed, 49 insertions(+), 3 deletions(-)
10
11 --- a/drivers/net/wireless/rt2x00/rt2800pci.c
12 +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
13 @@ -2934,7 +2934,7 @@ exit:
14
15 static int rt2800soc_probe(struct platform_device *pdev)
16 {
17 - const struct rt2x00_ops *ops = &rt2800pci_ops;
18 + struct rt2x00_ops *ops = (struct rt2x00_ops *)pdev->driver->p;
19 struct ieee80211_hw *hw;
20 struct rt2x00_dev *rt2x00dev;
21 int retval;
22 @@ -2990,10 +2990,56 @@ static int rt2800soc_remove(struct platf
23 return 0;
24 }
25
26 +#ifdef CONFIG_PM
27 +int rt2x00soc_suspend(struct device *dev, pm_message_t state)
28 +{
29 + struct ieee80211_hw *hw = dev_get_drvdata(dev);
30 + struct rt2x00_dev *rt2x00dev = hw->priv;
31 + int retval;
32 +
33 + retval = rt2x00lib_suspend(rt2x00dev, state);
34 + if (retval)
35 + return retval;
36 +
37 + rt2800soc_free_reg(rt2x00dev);
38 +
39 + return 0;
40 +}
41 +
42 +int rt2x00soc_resume(struct device *dev)
43 +{
44 + struct ieee80211_hw *hw = dev_get_drvdata(dev);
45 + struct rt2x00_dev *rt2x00dev = hw->priv;
46 + int retval;
47 +
48 + retval = rt2x00soc_alloc_reg(rt2x00dev);
49 + if (retval)
50 + return retval;
51 +
52 + retval = rt2x00lib_resume(rt2x00dev);
53 + if (retval)
54 + goto exit_free_reg;
55 +
56 + return 0;
57 +
58 +exit_free_reg:
59 + rt2x00pci_free_reg(rt2x00dev);
60 +
61 + return retval;
62 +}
63 +#endif /* CONFIG_PM */
64 +
65 static struct platform_driver rt2800soc_driver = {
66 - .driver.name = "rt2800_wmac",
67 + .driver = {
68 + .name = "rt2800_wmac",
69 + .owner = THIS_MODULE,
70 + .mod_name = KBUILD_MODNAME,
71 + .p = &rt2800pci_ops;
72 + }
73 .probe = rt2800soc_probe,
74 - .remove = rt2800soc_remove,
75 + .remove = __devexit_p(rt2800soc_remove),
76 + .suspend = rt2x00soc_suspend,
77 + .resume = rt2x00soc_resume,
78 };
79 #endif /* CONFIG_RT2800PCI_WISOC */
80
This page took 0.041655 seconds and 3 git commands to generate.