From: Alexandre Belloni Date: Thu, 16 Feb 2017 17:27:59 +0000 (+0100) Subject: i2c: at91: ensure state is restored after suspending X-Git-Tag: Ubuntu-5.13.0-19.19~13972^2~3 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e3ccc921b7d8fd1fcd10a00720e09823d8078666;p=mirror_ubuntu-jammy-kernel.git i2c: at91: ensure state is restored after suspending When going to suspend, the I2C registers may be lost because the power to VDDcore is cut. Restore them when resuming. Signed-off-by: Alexandre Belloni Acked-by: Ludovic Desroches Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index e4fcb0c2bc97..fabbb9e49161 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c @@ -1180,6 +1180,7 @@ static int at91_twi_suspend_noirq(struct device *dev) static int at91_twi_resume_noirq(struct device *dev) { + struct at91_twi_dev *twi_dev = dev_get_drvdata(dev); int ret; if (!pm_runtime_status_suspended(dev)) { @@ -1191,6 +1192,8 @@ static int at91_twi_resume_noirq(struct device *dev) pm_runtime_mark_last_busy(dev); pm_request_autosuspend(dev); + at91_init_twi_bus(twi_dev); + return 0; }