]> www.infradead.org Git - users/dwmw2/linux.git/commit
i2c: imx-lpi2c: make controller available until the system enters suspend_noirq(...
authorCarlos Song <carlos.song@nxp.com>
Fri, 27 Dec 2024 08:47:36 +0000 (16:47 +0800)
committerAndi Shyti <andi.shyti@kernel.org>
Tue, 7 Jan 2025 23:20:52 +0000 (00:20 +0100)
commit4262df2a69c32a0bce87d75342f6f8e3a535d7cb
tree31b31b18bc3e38fcb1c196c74acf906de59460f1
parent8abbc711da605e530a0f06bed7feb76df35e99f7
i2c: imx-lpi2c: make controller available until the system enters suspend_noirq() and from resume_noirq().

This is a general i2c controller feature. Some I2C devices may need the
I2C controller to remain active during resume_noirq() or suspend_noirq().
If the controller is autosuspended, there is no way to wake it up once
runtime PM disabled (in suspend_late()). During system resume, the I2C
controller will be available only after runtime PM is re-enabled
(in resume_early()). However, this may be too late for some devices.

Wake up the controller in the suspend() callback while runtime PM is
still enabled. The I2C controller will remain available until the
suspend_noirq() callback (pm_runtime_force_suspend()) is called. During
resume, the I2C controller can be restored by the resume_noirq() callback
(pm_runtime_force_resume()). Finally, the resume() callback re-enables
autosuspend. As a result, the I2C controller can remain available until
the system enters suspend_noirq() and from resume_noirq().

Signed-off-by: Carlos Song <carlos.song@nxp.com>
Link: https://lore.kernel.org/r/20241227084736.1323943-1-carlos.song@nxp.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-imx-lpi2c.c