Received: by 10.213.65.68 with SMTP id h4csp512541imn; Fri, 16 Mar 2018 10:01:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELtqFb8NuH8/rvaSiowNtGxzXNyOEBaxISz2ydCuppwtO+9hMR7e/PcylwhFmui3TPf1RiSa X-Received: by 10.101.100.141 with SMTP id e13mr2032126pgv.333.1521219705611; Fri, 16 Mar 2018 10:01:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521219705; cv=none; d=google.com; s=arc-20160816; b=dmmJaDZoM8SAMWKAMBk6eny4KkLGtRTC2blQm4dnPh/JRdoB3j0Mr2rKTYI4SDc5yy 3y9bs61R2bHOKebs9RNVBR8WKKddzXWBgGK6TIn22/dnG+gDPgSP1sVY0ED2QCIg6NtY idhqKNcL8gNxovCLRK3dMDOq+im7tp3jllrS7q7llmK6ojohY0vVVW+rh7vnuXTJuE2y Oi+34zT+5r363NqkrUeZ+El1ZWDRE3p7sGYwec2qAibMnlpWOizYFw0T1VlcFpzSiUVc 7lh56SDhu0I+bhA5lBc/VuRRq6K1bzhcLWExZ6vC9UlvfgzwFO3zLCpGhOjR3K50eTQ5 rNNg== 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=JSzBA4UxvbVZ77egFwhUBglTZnke4m25gp+Hc9uYbis=; b=uppSeBY4LZdwAfWp1Y6XrRW5j6Ts4PApcAQTc5bhWEWRoVLUegWCODHQHBZkhT5mJR fwYL04nk0o7CDlRQ1FVtyCVOfow/L/HH+FcOYVw1/BRD0SlAP2LZ0vNMGpq9j69kG+2W vlgiJFa3PxW9Au4ydPVRHXmXjSmCZznJ8eI1Vj13Yoqb/0r4r6ov0N1bn7PdbHLeizLT 6eycvDyqXc/fwJPNNSBpWggxUUNwpQCM7oCEGVZQMY7qNFdIhEMQr+nXWG+l/ZQwu9HV X00eRG87PQ7ZvFK1Q0Zj5UCLMYjxgKi6wnZC6O4TeQEI75WKYrnII6snmz34wWHtM3R1 8LmA== 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 102-v6si6503466pla.230.2018.03.16.10.01.30; Fri, 16 Mar 2018 10:01:45 -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 S932606AbeCPRAF (ORCPT + 99 others); Fri, 16 Mar 2018 13:00:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38184 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933273AbeCPPcy (ORCPT ); Fri, 16 Mar 2018 11:32:54 -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 ED0EB114D; Fri, 16 Mar 2018 15:32:53 +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.9 71/86] ASoC: sgtl5000: Fix suspend/resume Date: Fri, 16 Mar 2018 16:23:34 +0100 Message-Id: <20180316152322.155265430@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152317.167709497@linuxfoundation.org> References: <20180316152317.167709497@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.9-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 @@ -774,15 +774,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;