From patchwork Mon Jun 3 17:37:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 248366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D8F212C00AA for ; Tue, 4 Jun 2013 03:37:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755880Ab3FCRht (ORCPT ); Mon, 3 Jun 2013 13:37:49 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:48856 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758231Ab3FCRht (ORCPT ); Mon, 3 Jun 2013 13:37:49 -0400 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id C1FD763F7; Mon, 3 Jun 2013 11:45:16 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 28032E4634; Mon, 3 Jun 2013 11:37:48 -0600 (MDT) From: Stephen Warren To: Mark Brown , Liam Girdwood Cc: alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, Stephen Warren Subject: [PATCH 2/2] ASoC: tegra: implement suspend/resume for Tegra30 I2S Date: Mon, 3 Jun 2013 11:37:42 -0600 Message-Id: <1370281062-15238-2-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1370281062-15238-1-git-send-email-swarren@wwwdotorg.org> References: <1370281062-15238-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.7 at avon.wwwdotorg.org X-Virus-Status: Clean Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Stephen Warren Add tegra30_i2s_{suspend,resume}. These use regcache functions to restore all HW registers after power loss during a suspend/resume cycle. Signed-off-by: Stephen Warren --- sound/soc/tegra/tegra30_i2s.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index 31d092d..bd0ebc0 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c @@ -514,6 +514,24 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM_SLEEP +static int tegra30_i2s_suspend(struct device *dev) +{ + struct tegra30_i2s *i2s = dev_get_drvdata(dev); + + regcache_mark_dirty(i2s->regmap); + + return 0; +} + +static int tegra30_i2s_resume(struct device *dev) +{ + struct tegra30_i2s *i2s = dev_get_drvdata(dev); + + return regcache_sync(i2s->regmap); +} +#endif + static const struct of_device_id tegra30_i2s_of_match[] = { { .compatible = "nvidia,tegra30-i2s", }, {}, @@ -522,6 +540,7 @@ static const struct of_device_id tegra30_i2s_of_match[] = { static const struct dev_pm_ops tegra30_i2s_pm_ops = { SET_RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend, tegra30_i2s_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(tegra30_i2s_suspend, tegra30_i2s_resume) }; static struct platform_driver tegra30_i2s_driver = {