Received: by 10.213.65.68 with SMTP id h4csp488447imn; Fri, 16 Mar 2018 09:15:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELtGybG9TuhncDfMqQqcKPkU8rbXaImCjqTqBM7Go7nrB0KhLBIBsz6vQK2dCN2Qzj0nWr6k X-Received: by 10.99.143.66 with SMTP id r2mr1834718pgn.397.1521216932627; Fri, 16 Mar 2018 09:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216932; cv=none; d=google.com; s=arc-20160816; b=zLFU+Pg3kdxzhAF+sd/T98qITNKJwVsFtMdiXD988x5b3nZrRBI6d77pnNCCEXwFQ4 GVuPi8iiJUWQQUyXESQmrBIc8Vgrd/RYHrnHmKOpqREFpfDbpSifq7Mdgo2oJlDlrptX u6MzuYFXUU9t/yK3dycAunAb9lbPFPA4t9WTYv8sPjYxo3vlilfTh/A0BeAlKY19n2gX 40wMNZXvkg66P1JkcSLoy//EUSwAWCUumZFdTQ5UB+QxuoHf3zIbj9ICEVkRQXHIROf9 P5860ELiRoHdzN7C0tsvnJX6ctG+7Bq0zjt3xyCyYfMTignR/Us4dwz/h6wMxNXHiqiE BA0Q== 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=/pweFE44/ZDDceqWtuVqy4irs4VEB4+geF60fLcwXXA=; b=WYRxuFivAwoIw2iy1cnLMtH/tcYOflSnltIqg3yOsmnTQhcOQ0QfdE5iDQwcIam8Cs +TTmtQNWsPdhYaf7Vn35lHbilR/P7e6Z6Pgc27KON1muFAntH3xXaR7/NxV1rkYjFTZE 2LWjjIprbM6AXx/k/ErTUqypVi0tluWOCpr/y9zH17EHYpMv/IkiFlko08bNyhLzijlt ZuZHMNEb68NRIP3VXHGZIH4u+Uu4+iZIgAuBUb6Fr7u+HJ4rIPIJDBjOMyV+JRtEY9uE M7AYHYM8ZVaB+qeg5+jeX1L4xLagd+mZsn+fdWR7XN/j8/XXA5qGEWFe67xhw+yEBS+y DPxQ== 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 n69si5723008pfg.28.2018.03.16.09.15.17; Fri, 16 Mar 2018 09:15:32 -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 S934560AbeCPQMl (ORCPT + 99 others); Fri, 16 Mar 2018 12:12:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43544 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965027AbeCPPkV (ORCPT ); Fri, 16 Mar 2018 11:40:21 -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 01682D9A; Fri, 16 Mar 2018 15:40:20 +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.15 003/128] ASoC: sgtl5000: Fix suspend/resume Date: Fri, 16 Mar 2018 16:22:24 +0100 Message-Id: <20180316152336.384727825@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@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.15-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;