Skip to content

Commit c128baf

Browse files
alexandrebellonigregkh
authored andcommitted
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d7ecae7 commit c128baf

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/i2c/busses/i2c-at91.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ static int at91_twi_suspend_noirq(struct device *dev)
11311131

11321132
static int at91_twi_resume_noirq(struct device *dev)
11331133
{
1134+
struct at91_twi_dev *twi_dev = dev_get_drvdata(dev);
11341135
int ret;
11351136

11361137
if (!pm_runtime_status_suspended(dev)) {
@@ -1142,6 +1143,8 @@ static int at91_twi_resume_noirq(struct device *dev)
11421143
pm_runtime_mark_last_busy(dev);
11431144
pm_request_autosuspend(dev);
11441145

1146+
at91_init_twi_bus(twi_dev);
1147+
11451148
return 0;
11461149
}
11471150

0 commit comments

Comments
 (0)