ath6kl: make sure WLAN power save is enabled during suspend

Power save is enabled during ath6kl init. But when user space disables power
save, the system will go into suspend with power save disabled. The ath6kl
driver will now explicitly enable power save prior to entering suspend and
restore its previous setting upon resume

Signed-off-by: Chilam Ng <chilamng@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index adb1635..e693756 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -959,6 +959,13 @@
 		       "during suspend\n");
 
 	ath6kl_cfg80211_scan_complete_event(ar, -ECANCELED);
+
+	/* save the current power mode before enabling power save */
+	ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
+
+	if (ath6kl_wmi_powermode_cmd(ar->wmi, REC_POWER) != 0)
+		ath6kl_warn("ath6kl_deep_sleep_enable: "
+			"wmi_powermode_cmd failed\n");
 }
 
 /* WMI Event handlers */