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

Commit 43452335 authored by Mika Westerberg's avatar Mika Westerberg Committed by Wolfram Sang
Browse files

i2c-designware: switch to use runtime PM autosuspend



Using autosuspend helps to reduce the resume latency in situations where
another I2C message is going to be started soon. For example with HID over
I2C touch panels we get several messages in a short period of time while
the touch panel is in use.

Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 1451b91f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -600,7 +600,8 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
	ret = -EIO;

done:
	pm_runtime_put(dev->dev);
	pm_runtime_mark_last_busy(dev->dev);
	pm_runtime_put_autosuspend(dev->dev);
	mutex_unlock(&dev->lock);

	return ret;
+2 −1
Original line number Diff line number Diff line
@@ -291,7 +291,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
	/* Increase reference counter */
	get_device(&pdev->dev);

	pm_runtime_put_noidle(&pdev->dev);
	pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
	pm_runtime_use_autosuspend(&pdev->dev);
	pm_runtime_allow(&pdev->dev);

	return 0;
+2 −1
Original line number Diff line number Diff line
@@ -173,9 +173,10 @@ static int dw_i2c_probe(struct platform_device *pdev)
	/* Increase reference counter */
	get_device(&pdev->dev);

	pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
	pm_runtime_use_autosuspend(&pdev->dev);
	pm_runtime_set_active(&pdev->dev);
	pm_runtime_enable(&pdev->dev);
	pm_runtime_put(&pdev->dev);

	return 0;
}