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

Commit e9465353 authored by Gaurav Singhal's avatar Gaurav Singhal Committed by Gerrit - the friendly Code Review server
Browse files

NFC: Keep VEN gpio always high from boot



VEN will be toggled from NFC driver only once during boot
and it will remain high on successful driver probe exit,
after that MW shouldn't modify it's state
as eSE is also powered using VEN gpio in SN100 NFC HW.

VEN toggle will reset eSE power and cause failure if
any communication is in progress.

Change-Id: Id1c75a47017e53cc9d597e8d307a80a667207f74
Signed-off-by: default avatarGaurav Singhal <gsinghal@codeaurora.org>
parent 96db99c7
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -501,6 +501,7 @@ int nfc_ioctl_power_states(struct file *filp, unsigned long arg)
			gpio_set_value(nqx_dev->en_gpio, 0);
			gpio_set_value(nqx_dev->en_gpio, 0);
			usleep_range(10000, 10100);
			usleep_range(10000, 10100);
		}
		}

		if (nqx_dev->pdata->clk_pin_voting) {
		if (nqx_dev->pdata->clk_pin_voting) {
			r = nqx_clock_deselect(nqx_dev);
			r = nqx_clock_deselect(nqx_dev);
			if (r < 0)
			if (r < 0)
@@ -516,8 +517,14 @@ int nfc_ioctl_power_states(struct file *filp, unsigned long arg)
			gpio_set_value(nqx_dev->firm_gpio, 0);
			gpio_set_value(nqx_dev->firm_gpio, 0);
			usleep_range(10000, 10100);
			usleep_range(10000, 10100);
		}
		}

		if (gpio_get_value(nqx_dev->en_gpio)) {
			dev_dbg(&nqx_dev->client->dev, "VEN gpio already high\n");
		} else {
			gpio_set_value(nqx_dev->en_gpio, 1);
			gpio_set_value(nqx_dev->en_gpio, 1);
			usleep_range(10000, 10100);
			usleep_range(10000, 10100);
		}

		if (nqx_dev->pdata->clk_pin_voting) {
		if (nqx_dev->pdata->clk_pin_voting) {
			r = nqx_clock_select(nqx_dev);
			r = nqx_clock_select(nqx_dev);
			if (r < 0)
			if (r < 0)
@@ -887,8 +894,6 @@ static int nfcc_hw_check(struct i2c_client *client, struct nqx_dev *nqx_dev)
		break;
		break;
	}
	}


	/*Disable NFC by default to save power on boot*/
	gpio_set_value(enable_gpio, 0);/* ULPM: Disable */
	ret = 0;
	ret = 0;
	goto done;
	goto done;