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

Commit a08e5454 authored by Mark A. Greer's avatar Mark A. Greer Committed by Samuel Ortiz
Browse files

NFC: trf7970a: Initialize when enabling RF



Currently, the trf7970a is reset & initialized only
when the pm_runtime resume hook is called.  Instead,
initialize it every time the RF is enabled to ensure
that the trf7970a is quiesced and in a known state
before being set up for another RF technology.

Signed-off-by: default avatarMark A. Greer <mgreer@animalcreek.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 6c08df42
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -823,10 +823,18 @@ static void trf7970a_switch_rf_off(struct trf7970a *trf)

static void trf7970a_switch_rf_on(struct trf7970a *trf)
{
	int ret;

	dev_dbg(trf->dev, "Switching rf on\n");

	pm_runtime_get_sync(trf->dev);

	ret = trf7970a_init(trf);
	if (ret) {
		dev_err(trf->dev, "%s - Can't initialize: %d\n", __func__, ret);
		return;
	}

	trf->state = TRF7970A_ST_IDLE;
}

@@ -1473,12 +1481,6 @@ static int trf7970a_pm_runtime_resume(struct device *dev)

	usleep_range(20000, 21000);

	ret = trf7970a_init(trf);
	if (ret) {
		dev_err(dev, "%s - Can't initialize: %d\n", __func__, ret);
		return ret;
	}

	pm_runtime_mark_last_busy(dev);

	return 0;