Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a990964c authored by Sameer Thalappil's avatar Sameer Thalappil
Browse files

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 should also trigger the driver.

Change-Id: I843c044d4fa452ca541a62255bbcb33b9d7f6eb0
Signed-off-by: default avatarSameer Thalappil <sameert@codeaurora.org>
parent 001053d2
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -1988,19 +1988,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);
@@ -2011,7 +2009,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