wcnss: Cancel Apps vote for Riva and Iris regulators once Riva is up

This reverts commit d6758ad3ab238b1fc89136646af7e95271018dca.
This change is a revert of a revert.

The WCNSS driver can remove it regulator votes because RIVA is
now requesting regulators for itself once it boots.

Signed-off-by: David Collins <collinsd@codeaurora.org>
diff --git a/drivers/net/wireless/wcnss/wcnss_wlan.c b/drivers/net/wireless/wcnss/wcnss_wlan.c
index db00c67..c05832c 100644
--- a/drivers/net/wireless/wcnss/wcnss_wlan.c
+++ b/drivers/net/wireless/wcnss/wcnss_wlan.c
@@ -18,6 +18,8 @@
 #include <linux/parser.h>
 #include <linux/wcnss_wlan.h>
 #include <linux/platform_data/qcom_wcnss_device.h>
+#include <linux/workqueue.h>
+#include <linux/jiffies.h>
 #include <mach/peripheral-loader.h>
 #include "wcnss_riva.h"
 
@@ -41,8 +43,18 @@
 	const struct dev_pm_ops *pm_ops;
 	int             smd_channel_ready;
 	struct wcnss_wlan_config wlan_config;
+	struct delayed_work wcnss_work;
 } *penv = NULL;
 
+static void wcnss_post_bootup(struct work_struct *work)
+{
+	pr_info("%s: Cancel APPS vote for Iris & Riva\n", __func__);
+
+	/* Since Riva is up, cancel any APPS vote for Iris & Riva VREGs  */
+	wcnss_wlan_power(&penv->pdev->dev, &penv->wlan_config,
+		WCNSS_WLAN_SWITCH_OFF);
+}
+
 static int __devinit
 wcnss_wlan_ctrl_probe(struct platform_device *pdev)
 {
@@ -51,6 +63,10 @@
 
 	pr_info("%s: SMD ctrl channel up\n", __func__);
 
+	/* Schedule a work to do any post boot up activity */
+	INIT_DELAYED_WORK(&penv->wcnss_work, wcnss_post_bootup);
+	schedule_delayed_work(&penv->wcnss_work, msecs_to_jiffies(10000));
+
 	return 0;
 }
 
@@ -242,8 +258,6 @@
 		if (penv->pil)
 			pil_put(penv->pil);
 
-		wcnss_wlan_power(&penv->pdev->dev, &penv->wlan_config,
-					WCNSS_WLAN_SWITCH_OFF);
 
 		kfree(penv);
 		penv = NULL;