Skip to content

Commit

Permalink
i2c: at91: ensure state is restored after suspending
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexandre Belloni authored and Wolfram Sang committed Feb 20, 2017
1 parent ababb08 commit e3ccc92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/i2c/busses/i2c-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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;
}

Expand Down

0 comments on commit e3ccc92

Please sign in to comment.