Path: csiph.com!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!news.panservice.it!bofh.it!news.nic.it!robomod From: "Levin, Alexander (Sasha Levin)" Newsgroups: linux.kernel Subject: [PATCH review for 4.9 32/50] i2c: at91: ensure state is restored after suspending Date: Mon, 25 Sep 2017 03:40:02 +0200 Message-ID: References: X-Original-To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506302054; x=1537838054; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qp6drZ0ZO9HCAwI9a9IJMN45552NgurFq8g1k4LRL5w=; b=sPXS2Wk661NggzBqPT72pFucZc9lB85W45Bx3VWsExZGbeF3O5AOegbr DiI9J64xy2363XPjyxf/JsS7zvp5WZlztpiDef6Th7vqb5cneUP2qxvYd Vez7mysLkWlc8hIz1qzYlP14ACIYsF+2jmhzQTkQDUyWhdbroMF2IvXW9 s=; Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506302011; x=1537838011; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qp6drZ0ZO9HCAwI9a9IJMN45552NgurFq8g1k4LRL5w=; b=b3bpG2jELJuEh7tp93757pxPWNvOgHuWEaezRDY9kHyQkMhnXJMdSS4s TrlsVnFK1lU8rLNhxqNdkXsO+vW9LQl4yx7SGjDLWmX2N18xkPAgjRy4t 5zlt0pIYpjgLiheanacrh6Zsb9jU1MeIsG74O6yDOPc4nFswBRnmbJotm I=; Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506302011; x=1537838011; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qp6drZ0ZO9HCAwI9a9IJMN45552NgurFq8g1k4LRL5w=; b=b3bpG2jELJuEh7tp93757pxPWNvOgHuWEaezRDY9kHyQkMhnXJMdSS4s TrlsVnFK1lU8rLNhxqNdkXsO+vW9LQl4yx7SGjDLWmX2N18xkPAgjRy4t 5zlt0pIYpjgLiheanacrh6Zsb9jU1MeIsG74O6yDOPc4nFswBRnmbJotm I=; X-Host: discovery.odc.vzwcorp.com Thread-Topic: [PATCH review for 4.9 32/50] i2c: at91: ensure state is restored after suspending Thread-Index: AQHTNZtprTYZRYqwDkCAI5j7zEc9MA== Accept-Language: en-US Content-Language: en-US X-Ms-Exchange-Messagesentrepresentingtype: 1 X-Ms-Exchange-Transport-Fromentityheader: Hosted X-Originating-IP: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 38 Organization: linux.* mail to news gateway X-Original-Cc: Alexandre Belloni , Wolfram Sang , "Levin, Alexander (Sasha Levin)" X-Original-Date: Mon, 25 Sep 2017 01:12:53 +0000 X-Original-Message-ID: <20170925011225.10029-32-alexander.levin@verizon.com> X-Original-References: <20170925011225.10029-1-alexander.levin@verizon.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1738689 From: Alexandre Belloni [ 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 Acked-by: Ludovic Desroches Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- 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) =20 static int at91_twi_resume_noirq(struct device *dev) { + struct at91_twi_dev *twi_dev =3D dev_get_drvdata(dev); int ret; =20 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); =20 + at91_init_twi_bus(twi_dev); + return 0; } =20 --=20 2.11.0