From patchwork Fri May 16 13:55:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 4193181 Return-Path: X-Original-To: patchwork-alsa-devel@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 D5394BFF02 for ; Fri, 16 May 2014 13:58:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18B0B20270 for ; Fri, 16 May 2014 13:58:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C9FE92026F for ; Fri, 16 May 2014 13:57:59 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A7C462651D8; Fri, 16 May 2014 15:57:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id CACDD261718; Fri, 16 May 2014 15:55:54 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id BF721261718; Fri, 16 May 2014 15:55:53 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 9AFC326087D for ; Fri, 16 May 2014 15:55:43 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 16 May 2014 06:55:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="4.97,1067,1389772800"; d="scan'208"; a="540236890" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.55]) by fmsmga002.fm.intel.com with ESMTP; 16 May 2014 06:55:41 -0700 From: Jarkko Nikula To: alsa-devel@alsa-project.org Date: Fri, 16 May 2014 16:55:21 +0300 Message-Id: <1400248525-21900-4-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.0.0.rc0 In-Reply-To: <1400248525-21900-1-git-send-email-jarkko.nikula@linux.intel.com> References: <1400248525-21900-1-git-send-email-jarkko.nikula@linux.intel.com> Cc: Liam Girdwood , Mark Brown , Jarkko Nikula , Liam Girdwood Subject: [alsa-devel] [PATCH 3/7] ASoC: max98090: Reset codec on resume X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Liam Girdwood Make sure we reset codec and clear any IRQs on resume. This matches the init sequence in probe. Signed-off-by: Liam Girdwood Signed-off-by: Jarkko Nikula --- sound/soc/codecs/max98090.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 4accf9ba447e..b3f447cc050c 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -2392,9 +2392,32 @@ static int max98090_runtime_suspend(struct device *dev) } #endif +#ifdef CONFIG_PM +static int max98090_resume(struct device *dev) +{ + struct max98090_priv *max98090 = dev_get_drvdata(dev); + unsigned int status; + + max98090_reset(max98090); + + /* clear IRQ status */ + regmap_read(max98090->regmap, M98090_REG_DEVICE_STATUS, &status); + + regcache_sync(max98090->regmap); + + return 0; +} + +static int max98090_suspend(struct device *dev) +{ + return 0; +} +#endif + static const struct dev_pm_ops max98090_pm = { SET_RUNTIME_PM_OPS(max98090_runtime_suspend, max98090_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(max98090_suspend, max98090_resume) }; static const struct i2c_device_id max98090_i2c_id[] = {