wcnss: Trigger WCNSS driver on first open

WCNSS driver requires a trigger followed by an open, this is to support
the trigger from an external script. However, startup scripts are no
more supported; and wcnss service should always trigger this driver. So
the first open to this driver (that is from wcnss service), should also
trigger the driver.

Change-Id: I843c044d4fa452ca541a62255bbcb33b9d7f6eb0
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
This commit is contained in:
Sameer Thalappil
2013-11-08 13:27:12 -08:00
parent bcafd4e3c6
commit d0bb3bb1bc
+5 -7
View File
@@ -2032,19 +2032,17 @@ fail_gpio_res:
static int wcnss_node_open(struct inode *inode, struct file *file)
{
struct platform_device *pdev;
int rc = 0;
if (!penv)
return -EFAULT;
/* first open is only to trigger WCNSS platform driver */
if (!penv->triggered) {
pr_info(DEVICE " triggered by userspace\n");
pdev = penv->pdev;
return wcnss_trigger_config(pdev);
} else if (penv->device_opened) {
pr_info(DEVICE " already opened\n");
return -EBUSY;
rc = wcnss_trigger_config(pdev);
if (rc)
return -EFAULT;
}
mutex_lock(&penv->dev_lock);
@@ -2055,7 +2053,7 @@ static int wcnss_node_open(struct inode *inode, struct file *file)
penv->device_opened = 1;
mutex_unlock(&penv->dev_lock);
return 0;
return rc;
}
static ssize_t wcnss_wlan_read(struct file *fp, char __user