aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-13 17:58:42 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-01-17 09:54:08 -0500
commit7e9e7fa414e47fccc6127f23bc866cbcc7e27dcb (patch)
tree912d69316649f04bcf4b142bdec0ac353ea9fcf8 /drivers
parent7d5869e78f4c9d32f834dadefbb7dcb3c9d4d85f (diff)
brcmsmac: remove PCI suspend/resume from bcma driver
The brcmsmac driver isn't a PCI driver any more, it's a bcma one. The PCI device has been resumed by the PCI driver (the generic PCI layer, really), we should be resuming just our own driver state. Also add pr_debug() calls to show that we now actually get the suspend/resume events. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 213130afdaf..448ab9c4eb4 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -1128,13 +1128,6 @@ static int __devinit brcms_bcma_probe(struct bcma_device *pdev)
1128 return 0; 1128 return 0;
1129} 1129}
1130 1130
1131static int brcms_pci_suspend(struct pci_dev *pdev)
1132{
1133 pci_save_state(pdev);
1134 pci_disable_device(pdev);
1135 return pci_set_power_state(pdev, PCI_D3hot);
1136}
1137
1138static int brcms_suspend(struct bcma_device *pdev) 1131static int brcms_suspend(struct bcma_device *pdev)
1139{ 1132{
1140 struct brcms_info *wl; 1133 struct brcms_info *wl;
@@ -1153,40 +1146,15 @@ static int brcms_suspend(struct bcma_device *pdev)
1153 wl->pub->hw_up = false; 1146 wl->pub->hw_up = false;
1154 spin_unlock_bh(&wl->lock); 1147 spin_unlock_bh(&wl->lock);
1155 1148
1156 /* temporarily do suspend ourselves */ 1149 pr_debug("brcms_suspend ok\n");
1157 return brcms_pci_suspend(pdev->bus->host_pci);
1158}
1159
1160static int brcms_pci_resume(struct pci_dev *pdev)
1161{
1162 int err = 0;
1163 uint val;
1164
1165 err = pci_set_power_state(pdev, PCI_D0);
1166 if (err)
1167 return err;
1168
1169 pci_restore_state(pdev);
1170
1171 err = pci_enable_device(pdev);
1172 if (err)
1173 return err;
1174
1175 pci_set_master(pdev);
1176
1177 pci_read_config_dword(pdev, 0x40, &val);
1178 if ((val & 0x0000ff00) != 0)
1179 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
1180 1150
1181 return 0; 1151 return 0;
1182} 1152}
1183 1153
1184static int brcms_resume(struct bcma_device *pdev) 1154static int brcms_resume(struct bcma_device *pdev)
1185{ 1155{
1186 /* 1156 pr_debug("brcms_resume ok\n");
1187 * just do pci resume for now until bcma supports it. 1157 return 0;
1188 */
1189 return brcms_pci_resume(pdev->bus->host_pci);
1190} 1158}
1191 1159
1192static struct bcma_driver brcms_bcma_driver = { 1160static struct bcma_driver brcms_bcma_driver = {