Commit 731ffd0f authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Thadeu Lima de Souza Cascardo

i2c: at91: ensure state is restored after suspending

BugLink: http://bugs.launchpad.net/bugs/1729105


[ Upstream commit e3ccc921 ]

When going to suspend, the I2C registers may be lost because the power to
VDDcore is cut. Restore them when resuming.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: default avatarLudovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5a0e4d81
...@@ -1131,6 +1131,7 @@ static int at91_twi_suspend_noirq(struct device *dev) ...@@ -1131,6 +1131,7 @@ static int at91_twi_suspend_noirq(struct device *dev)
static int at91_twi_resume_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; int ret;
if (!pm_runtime_status_suspended(dev)) { if (!pm_runtime_status_suspended(dev)) {
...@@ -1142,6 +1143,8 @@ static int at91_twi_resume_noirq(struct device *dev) ...@@ -1142,6 +1143,8 @@ static int at91_twi_resume_noirq(struct device *dev)
pm_runtime_mark_last_busy(dev); pm_runtime_mark_last_busy(dev);
pm_request_autosuspend(dev); pm_request_autosuspend(dev);
at91_init_twi_bus(twi_dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment