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

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

Merge "i2c: qcom: geni: Turn off resources during system-suspend if needed"

parents 3a8af61b 9b8e1052
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -910,8 +910,23 @@ static int geni_i2c_runtime_resume(struct device *dev)

static int geni_i2c_suspend_noirq(struct device *device)
{
	if (!pm_runtime_status_suspended(device))
	struct geni_i2c_dev *gi2c = dev_get_drvdata(device);
	int ret;

	/* Make sure no transactions are pending */
	ret = i2c_trylock_bus(&gi2c->adap, I2C_LOCK_SEGMENT);
	if (!ret) {
		GENI_SE_ERR(gi2c->ipcl, true, gi2c->dev,
				"late I2C transaction request\n");
		return -EBUSY;
	}
	if (!pm_runtime_status_suspended(device)) {
		geni_i2c_runtime_suspend(device);
		pm_runtime_disable(device);
		pm_runtime_set_suspended(device);
		pm_runtime_enable(device);
	}
	i2c_unlock_bus(&gi2c->adap, I2C_LOCK_SEGMENT);
	return 0;
}
#else