diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-02-16 18:27:59 +0100 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2017-11-05 23:54:32 -0500 |
commit | b8ee52a95949f2d3c3c6a6e279229365147e26e5 (patch) | |
tree | 4e5c0edc081867fe40f20fcb7343c8e0a7646d19 | |
parent | 5d0f92a77377fbcf9b488f292f57eb0e7de69abb (diff) | |
download | linux-rt-b8ee52a95949f2d3c3c6a6e279229365147e26e5.tar.gz |
i2c: at91: ensure state is restored after suspending
[ Upstream commit e3ccc921b7d8fd1fcd10a00720e09823d8078666 ]
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 <alexandre.belloni@free-electrons.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r-- | drivers/i2c/busses/i2c-at91.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index 9bd10a9b4b50..8029a81a3799 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c @@ -875,6 +875,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)) { @@ -886,6 +887,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; } |