From patchwork Wed Feb 12 18:24:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Reid X-Patchwork-Id: 3639901 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 658D69F369 for ; Wed, 12 Feb 2014 18:25:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 634C6201D5 for ; Wed, 12 Feb 2014 18:25:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 72C4620117 for ; Wed, 12 Feb 2014 18:25:45 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 544E2264F1C; Wed, 12 Feb 2014 19:25:33 +0100 (CET) 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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id F09C7264F22; Wed, 12 Feb 2014 19:25:22 +0100 (CET) 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 8C00F264F22; Wed, 12 Feb 2014 19:25:21 +0100 (CET) Received: from mail-yk0-f201.google.com (mail-yk0-f201.google.com [209.85.160.201]) by alsa0.perex.cz (Postfix) with ESMTP id A1EED26084D for ; Wed, 12 Feb 2014 19:25:14 +0100 (CET) Received: by mail-yk0-f201.google.com with SMTP id 142so2145925ykq.0 for ; Wed, 12 Feb 2014 10:25:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eWPuCI2r2co42CbqKoFkty+7IkvmdoomwQHenRMDlSI=; b=fx6Nyzza2ehpdUCEEHneSRSM72xE41c4wFI0Ixq2giTNAbzZt1LF8jN9sppq6CO/MD OOtz3kyxaliz7mnhmLPHHc5/VC41njSlRmJ4z3yAgM1KpFqEZZWHpLrMFJ9G4+p5rZAp hTxwh/qvoc23MHLiHy0dlgbUEZ8O8Hc0IccI646mNvHKkhI6xJbd8oMeINxy3rCnKZq0 DtWBNFPg0EHbUYUJ8RCYL+kYpMNkCeA2ATHmJ9nII6bKLcVyQNU90r+8fFAeYrNuDfNm r5LM7yadyZREnro2GhF9KCdv+JTAh6C3qGzlrFiM0S2yKFHDQf9nzj4x9N5hC+ljcAqq NpnQ== X-Gm-Message-State: ALoCoQn30prPkWwjZflMgh99ChR9drF3I89rRPPPGOvJjsl7P6dHwk+PzLX+/EZXyzPhehB2IaFp3AyObiAwORvOfUfuP0nd+RY05Vd5tMQvcphULfm/Monz65URwjgKoOIOOhqfys5sEB1UEkyZ74WnbBn2gjadwKLry/3V6A71lCn/Ps8NujgwihkXCe1l0ErgFsP/X9j4LhEASEx50tlSwdIn/2V0+oP56Y+iLQrdgXqAQYYkXII= X-Received: by 10.58.251.135 with SMTP id zk7mr2285639vec.16.1392229513262; Wed, 12 Feb 2014 10:25:13 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id v64si3150551yhm.3.2014.02.12.10.25.13 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Feb 2014 10:25:13 -0800 (PST) Received: from hojo20.mtv.corp.google.com (dhcp-172-22-75-131.mtv.corp.google.com [172.22.75.131]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 0525631C2B8; Wed, 12 Feb 2014 10:25:13 -0800 (PST) Received: by hojo20.mtv.corp.google.com (Postfix, from userid 123195) id 93BF7180786; Wed, 12 Feb 2014 10:25:12 -0800 (PST) From: Dylan Reid To: alsa-devel@alsa-project.org Date: Wed, 12 Feb 2014 10:24:54 -0800 Message-Id: <1392229494-29761-1-git-send-email-dgreid@chromium.org> X-Mailer: git-send-email 1.8.1.3.605.g02339dd Cc: sachin.kamat@linaro.org, Dylan Reid , broonie@kernel.org, jerry.wong@maximintegrated.com Subject: [alsa-devel] [PATCH] ASoC: max98090: sync regcache on entering STANDBY 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 Sync regcache when entering STANDBY from OFF. ON isn't entered with OFF as the current state, so the registers were not being re-synced after suspend/resume. The 98088 and 98095 already call regcache_sync from STANDBY. Signed-off-by: Dylan Reid --- sound/soc/codecs/max98090.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 51f9b3d..149b57f 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -1769,16 +1769,6 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec, switch (level) { case SND_SOC_BIAS_ON: - if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { - ret = regcache_sync(max98090->regmap); - - if (ret != 0) { - dev_err(codec->dev, - "Failed to sync cache: %d\n", ret); - return ret; - } - } - if (max98090->jack_state == M98090_JACK_STATE_HEADSET) { /* * Set to normal bias level. @@ -1792,6 +1782,16 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec, break; case SND_SOC_BIAS_STANDBY: + if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { + ret = regcache_sync(max98090->regmap); + if (ret != 0) { + dev_err(codec->dev, + "Failed to sync cache: %d\n", ret); + return ret; + } + } + break; + case SND_SOC_BIAS_OFF: /* Set internal pull-up to lowest power mode */ snd_soc_update_bits(codec, M98090_REG_JACK_DETECT,