Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1738689 > unrolled thread

[PATCH review for 4.9 32/50] i2c: at91: ensure state is restored after suspending

Started by"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
First post2017-09-25 03:40 +0200
Last post2017-09-25 03:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH review for 4.9 32/50] i2c: at91: ensure state is restored  after suspending "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-09-25 03:40 +0200

#1738689 — [PATCH review for 4.9 32/50] i2c: at91: ensure state is restored after suspending

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-09-25 03:40 +0200
Subject[PATCH review for 4.9 32/50] i2c: at91: ensure state is restored after suspending
Message-ID<utqxk-7O2-15@gated-at.bofh.it>
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

[ 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>
---
 drivers/i2c/busses/i2c-at91.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index 0b86c6173e07..c925a690cb32 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;
 }
 
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web