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

Commit bce6c75a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "NFC: Return status of nci wake to userspace"

parents d7f736e9 161ad7ac
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -570,13 +570,16 @@ int nfcc_wake(int level, struct file *filp)
		} while ((wake_status & NCI_WAKE)
				&& (time_taken < WAKE_TIMEOUT));
		/* Restore original NFCC slave I2C address */
		if (time_taken >= WAKE_TIMEOUT)
			dev_err(&qca199x_dev->client->dev,
			"nfc_ioctl_nfcc_version : TIMED OUT to get WAKEUP bit\n");

		qca199x_dev->client->addr = curr_addr;
		if (r != sizeof(wake_status))
			return -EMSGSIZE;

		if (time_taken >= WAKE_TIMEOUT) {
			dev_err(&qca199x_dev->client->dev,
			" %s : TIMED OUT to get WAKEUP bit\n", __func__);
			r = -EIO;
		}
		qca199x_dev->state = NFCC_STATE_NORMAL_WAKE;
	}

@@ -656,12 +659,12 @@ int nfc_ioctl_power_states(struct file *filp, unsigned int cmd,
		msleep(20);
	} else if (arg == 4) {
		mutex_lock(&qca199x_dev->read_mutex);
		nfcc_wake(NFCC_WAKE, filp);
		r = nfcc_wake(NFCC_WAKE, filp);
		dev_dbg(&qca199x_dev->client->dev, "nfcc wake: %s: info: %p\n",
			__func__, qca199x_dev);
		mutex_unlock(&qca199x_dev->read_mutex);
	} else if (arg == 5) {
		nfcc_wake(NFCC_SLEEP, filp);
		r = nfcc_wake(NFCC_SLEEP, filp);
	} else {
		r = -ENOIOCTLCMD;
	}
@@ -997,7 +1000,7 @@ static long nfc_ioctl(struct file *pfile, unsigned int cmd,
	struct qca199x_dev *qca199x_dev = pfile->private_data;
	switch (cmd) {
	case NFC_SET_PWR:
		nfc_ioctl_power_states(pfile, cmd, arg);
		r = nfc_ioctl_power_states(pfile, cmd, arg);
		break;
	case NFCC_MODE:
		nfc_ioctl_nfcc_mode(pfile, cmd, arg);