From patchwork Fri Jul 4 14:05:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 4481271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 68FDBBEEAA for ; Fri, 4 Jul 2014 14:08:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4FCF203C4 for ; Fri, 4 Jul 2014 14:08:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C21EA20251 for ; Fri, 4 Jul 2014 14:08:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X348C-0007cL-B3; Fri, 04 Jul 2014 14:06:28 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X3489-0007Zj-Iy for linux-arm-kernel@lists.infradead.org; Fri, 04 Jul 2014 14:06:26 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N86005DBXU0FVB0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 04 Jul 2014 23:06:00 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-e6-53b6b4c86d1e Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 48.64.04943.8C4B6B35; Fri, 04 Jul 2014 23:06:00 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N86007XBXTNOB90@mmp1.samsung.com>; Fri, 04 Jul 2014 23:06:00 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Subject: [PATCH] ASoC: samsung: Correct I2S DAI suspend/resume ops Date: Fri, 04 Jul 2014 16:05:45 +0200 Message-id: <1404482745-29177-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPJMWRmVeSWpSXmKPExsVy+t9jAd0TW7YFG+xezWVx5eIhJoupD5+w WWx6fI3VYsb5fUwWh9+0szqwemz43MTmsWlVJ5vH5iX1Hn1bVjF6fN4kF8AaxWWTkpqTWZZa pG+XwJXxfPU81oJtPBWt2yoaGFdydTFyckgImEi0zZ3BBmGLSVy4tx7I5uIQEljEKLHr/Ccm CKeDSWLLs+tMIFVsAoYSvUf7GEFsEaCO23M6mUGKmAWmM0qsfdHB2sXIwSEs4CRxsbsUpIZF QFXi3tb3LCA2r4CbxM+3k9hBSiQEFCTmTLKZwMi9gJFhFaNoakFyQXFSeq6hXnFibnFpXrpe cn7uJkZwMDyT2sG4ssHiEKMAB6MSD69H0dZgIdbEsuLK3EOMEhzMSiK8f1ZtCxbiTUmsrEot yo8vKs1JLT7EKM3BoiTOe6DVOlBIID2xJDU7NbUgtQgmy8TBKdXA2N0tL8vNkWVqV5312Swm pXQB85TqxB6X/QF7DUIZunXXzmBVb4tOuXPlRYJb4M477xnblsg1nvrfcyIhiGH31d8r1aU+ xHTmewYunq+yKGTtBQ1J99SAvTs3zN3K829aXmz+wY2naoOfsB5p1Uqdsy6d1XJmrrXcqRu5 L+2nWzvOszR44qurxFKckWioxVxUnAgABAA6VAICAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140704_070625_977922_55F5FAA6 X-CRM114-Status: GOOD ( 11.45 ) X-Spam-Score: -5.0 (-----) Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We should save/restore relevant I2S registers regardless of the dai->active flag, otherwise some settings are being lost after system suspend/resume cycle. E.g. I2S slave mode set only during dai initialization is not preserved and the device ends up in master mode after system resume. Signed-off-by: Sylwester Nawrocki --- sound/soc/samsung/i2s.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 2ac76fa..5f9b255 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -920,11 +920,9 @@ static int i2s_suspend(struct snd_soc_dai *dai) { struct i2s_dai *i2s = to_info(dai); - if (dai->active) { - i2s->suspend_i2smod = readl(i2s->addr + I2SMOD); - i2s->suspend_i2scon = readl(i2s->addr + I2SCON); - i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR); - } + i2s->suspend_i2smod = readl(i2s->addr + I2SMOD); + i2s->suspend_i2scon = readl(i2s->addr + I2SCON); + i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR); return 0; } @@ -933,11 +931,9 @@ static int i2s_resume(struct snd_soc_dai *dai) { struct i2s_dai *i2s = to_info(dai); - if (dai->active) { - writel(i2s->suspend_i2scon, i2s->addr + I2SCON); - writel(i2s->suspend_i2smod, i2s->addr + I2SMOD); - writel(i2s->suspend_i2spsr, i2s->addr + I2SPSR); - } + writel(i2s->suspend_i2scon, i2s->addr + I2SCON); + writel(i2s->suspend_i2smod, i2s->addr + I2SMOD); + writel(i2s->suspend_i2spsr, i2s->addr + I2SPSR); return 0; }