From patchwork Mon Jun 3 17:37:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 248365 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 53E0C2C00A4 for ; Tue, 4 Jun 2013 03:37:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758695Ab3FCRhs (ORCPT ); Mon, 3 Jun 2013 13:37:48 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:46165 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758231Ab3FCRhs (ORCPT ); Mon, 3 Jun 2013 13:37:48 -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 8BB11635A; Mon, 3 Jun 2013 11:45:15 -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 0ECB3E4106; Mon, 3 Jun 2013 11:37:46 -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 1/2] ASoC: tegra: implement suspend/resume for Tegra30 AHUB Date: Mon, 3 Jun 2013 11:37:41 -0600 Message-Id: <1370281062-15238-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.10.4 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_ahub_{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_ahub.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c index 23e592f..0f4787c 100644 --- a/sound/soc/tegra/tegra30_ahub.c +++ b/sound/soc/tegra/tegra30_ahub.c @@ -627,9 +627,30 @@ static int tegra30_ahub_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM_SLEEP +static int tegra30_ahub_suspend(struct device *dev) +{ + regcache_mark_dirty(ahub->regmap_ahub); + regcache_mark_dirty(ahub->regmap_apbif); + + return 0; +} + +static int tegra30_ahub_resume(struct device *dev) +{ + int ret; + + ret = regcache_sync(ahub->regmap_ahub); + ret |= regcache_sync(ahub->regmap_apbif); + + return ret; +} +#endif + static const struct dev_pm_ops tegra30_ahub_pm_ops = { SET_RUNTIME_PM_OPS(tegra30_ahub_runtime_suspend, tegra30_ahub_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(tegra30_ahub_suspend, tegra30_ahub_resume) }; static struct platform_driver tegra30_ahub_driver = {