Received: by 10.213.65.68 with SMTP id h4csp506726imn; Fri, 16 Mar 2018 09:50:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELul+Odr++oZGti2lYfmUoZpOzv2rOH0VTE9/36F8Z/w5h7ETlNKh2fLoUHelktAd692CS59 X-Received: by 2002:a17:902:8b85:: with SMTP id ay5-v6mr2797733plb.329.1521219036596; Fri, 16 Mar 2018 09:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521219036; cv=none; d=google.com; s=arc-20160816; b=Sa2LWCpn8s6sCj3zUMddZvYT6i16vALiixpZhi6IbHRR+UQ4ajy42uE3zbmfc5+7AO Q/BZ3Mq/969H05y/q/ESiJIg9kmZ6uiCbvQ6d/bGZdif3wvW2XBDIZjo9J6UFXhwtFVQ QImnUP2WmPGtbuQ67AvpWY58MeqGyKm1hnyeB5j1FnozHnu0VtUNooM3yiKtCklVGiLZ GkQ6/5+LCMHS/53X9w4pbOH7CQW4kmT46ZdoPpiGECjMCpYk/OBqyIQaRU6lW9X82HMo 0tv8JFIimVmxLwJ23iN4D2FUZ6SoUb3UyjWCzfVCAKo8FUqa6KBaFjHYyScMksuRN5SM 9wLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7TigRExQD+1SGddQNFXTk2T4dURXhn1OgqJMqWPEe04=; b=0OpmPUj081hE5eRP12g8EUeE3Mq/dn+RWXksebn2+hKCW8sfZXV9x52EoagwgXXJNp u+IjB5CC8ED3uh4g1MmZeNV8LuaAB4k/9oMyTWF0ehRyK7OEYvYd374XCsEcDprdRLw4 7OMsFHRW9mvrPKjV4jhPuw1eIx2oxD8lc54KUOB1/HPUsuaUAXoiECMPVI9RyU2H9i0d cc+kijNNH33z0l4og8tpszUZAish5SK7U2ytCAvCB0O0Yf5XcRk0cA+gfdlHMAATHm5z prtisxEbippFJKxM2C/cBlOIvMePDY1sOglduavRO94B0hYOweNiOngy5Zdzp+Dq88NR mrUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e34-v6si6459273plb.588.2018.03.16.09.50.22; Fri, 16 Mar 2018 09:50:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934073AbeCPPfE (ORCPT + 99 others); Fri, 16 Mar 2018 11:35:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39682 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934026AbeCPPfA (ORCPT ); Fri, 16 Mar 2018 11:35:00 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3414A1070; Fri, 16 Mar 2018 15:34:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Fabio Estevam Subject: [PATCH 4.14 005/109] ASoC: sgtl5000: Fix suspend/resume Date: Fri, 16 Mar 2018 16:22:34 +0100 Message-Id: <20180316152330.138393689@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fabio Estevam commit a8992973edbb2555e956b90f6fe97c4bc14d761d upstream. Commit 8419caa72702 ("ASoC: sgtl5000: Do not disable regulators in SND_SOC_BIAS_OFF") causes the sgtl5000 to fail after a suspend/resume sequence: Playing WAVE '/media/a2002011001-e02.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo aplay: pcm_write:2051: write error: Input/output error The problem is caused by the fact that the aforementioned commit dropped the cache handling, so re-introduce the register map resync to fix the problem. Suggested-by: Mark Brown Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown Cc: Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/sgtl5000.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -871,15 +871,26 @@ static int sgtl5000_pcm_hw_params(struct static int sgtl5000_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { + struct sgtl5000_priv *sgtl = snd_soc_codec_get_drvdata(codec); + int ret; + switch (level) { case SND_SOC_BIAS_ON: case SND_SOC_BIAS_PREPARE: case SND_SOC_BIAS_STANDBY: + regcache_cache_only(sgtl->regmap, false); + ret = regcache_sync(sgtl->regmap); + if (ret) { + regcache_cache_only(sgtl->regmap, true); + return ret; + } + snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, SGTL5000_REFTOP_POWERUP, SGTL5000_REFTOP_POWERUP); break; case SND_SOC_BIAS_OFF: + regcache_cache_only(sgtl->regmap, true); snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, SGTL5000_REFTOP_POWERUP, 0); break;