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)
6 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
8 drivers/net/wireless/rt2x00/rt2800pci.c | 52 +++++++++++++++++++++++++++++--
9 1 files changed, 49 insertions(+), 3 deletions(-)
11 --- a/drivers/net/wireless/rt2x00/rt2800pci.c
12 +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
13 @@ -2934,7 +2934,7 @@ exit:
15 static int rt2800soc_probe(struct platform_device *pdev)
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;
22 @@ -2990,10 +2990,56 @@ static int rt2800soc_remove(struct platf
27 +int rt2x00soc_suspend(struct device *dev, pm_message_t state)
29 + struct ieee80211_hw *hw = dev_get_drvdata(dev);
30 + struct rt2x00_dev *rt2x00dev = hw->priv;
33 + retval = rt2x00lib_suspend(rt2x00dev, state);
37 + rt2800soc_free_reg(rt2x00dev);
42 +int rt2x00soc_resume(struct device *dev)
44 + struct ieee80211_hw *hw = dev_get_drvdata(dev);
45 + struct rt2x00_dev *rt2x00dev = hw->priv;
48 + retval = rt2x00soc_alloc_reg(rt2x00dev);
52 + retval = rt2x00lib_resume(rt2x00dev);
59 + rt2x00pci_free_reg(rt2x00dev);
63 +#endif /* CONFIG_PM */
65 static struct platform_driver rt2800soc_driver = {
66 - .driver.name = "rt2800_wmac",
68 + .name = "rt2800_wmac",
69 + .owner = THIS_MODULE,
70 + .mod_name = KBUILD_MODNAME,
71 + .p = &rt2800pci_ops;
73 .probe = rt2800soc_probe,
74 - .remove = rt2800soc_remove,
75 + .remove = __devexit_p(rt2800soc_remove),
76 + .suspend = rt2x00soc_suspend,
77 + .resume = rt2x00soc_resume,
79 #endif /* CONFIG_RT2800PCI_WISOC */