From patchwork Thu Feb 15 16:36:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10222371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F3EB16055C for ; Thu, 15 Feb 2018 16:36:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E417E29489 for ; Thu, 15 Feb 2018 16:36:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8BF42948F; Thu, 15 Feb 2018 16:36:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5DD229489 for ; Thu, 15 Feb 2018 16:36:08 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 70830267C7F; Thu, 15 Feb 2018 17:36:06 +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 2D3D6267C81; Thu, 15 Feb 2018 17:36:05 +0100 (CET) Received: from mail-ot0-f195.google.com (mail-ot0-f195.google.com [74.125.82.195]) by alsa0.perex.cz (Postfix) with ESMTP id 3617A267C5D for ; Thu, 15 Feb 2018 17:36:01 +0100 (CET) Received: by mail-ot0-f195.google.com with SMTP id q12so229875otg.10 for ; Thu, 15 Feb 2018 08:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jL4aWGY6rUsjjr8zoA+T/Dp2JF4J5t8uRG7NfpQKI3c=; b=ZUctZU7HO6Zu/Ju0wube4U2e+XffB4/yNfCvll27dqBTPtqyNgd1t807wQ4nnnt7kL xVHEYw2q9RcBXhuq8VlJDks/O83IEJSvMan+euncWoLBllH6mc1Rf0QQBNYho8mmMvpw ZYSZDQcYQ2tnXqj7yfFo6dHeHw/nvm4De1YE59j5Sg3WEMgvmz8SjIGJ2m7H12/mRSZN opJoH8qBIk/xESV5su3AW9cp9CbaGPcUedP/l1IIIEvte26dgWL5WURCJRt81CLB33GC cABhZWqdp7nHwZZt/D2kV+e/lSDaXJ7sEt2N7UK5t9VtGwvoWa4rWFmIEGLwwFhxYD8C xazA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jL4aWGY6rUsjjr8zoA+T/Dp2JF4J5t8uRG7NfpQKI3c=; b=XjQbCuWiwh+NBy55nukjaRxnsheeZvNnfEdSHTto1PyOhjGM4VtIezTYE2Q0TfUGki TY6ALYn4N3O8veqv1h4WjRZatScuYlKkc9jwHi5ECveHUA4DQzbrrXDypwSmp9wjPZmt 6giHIMtV5Pnlm9zW5CJ/LsboMerXPqxDocTfzKEJlwOCUhXew1dGQo/E9KBJ4TbQSjTL zGgMI0T2BCZVUobtXdUF70OZveI1sa1ge7mtcCBEb05lR6IVw1HB11nIIoZuFkhvQNEr j9uoKvrtwrYqK4uchpRRWhLrJuu38bsYwh7p6e4+eYe+rms0OjuGXRAWoIi7ubKDh+Mg 4oLA== X-Gm-Message-State: APf1xPB57L1ek7rAVjcIRVcMYE94Bg9a2LF/iXavdDSW+mODC1E/pr7D SGhhaBlcLTxpXvLHZqIjxq3f8DnKCNb/h6EAKYaYwQ== X-Google-Smtp-Source: AH8x224yUytNXQsW5wpaujFyFPG0qMkdIt9lX7rXTuAlA/vxIKs6VjLPm8taPYRC0bBr4fa+uJNEGPcHhCDNvYRCmbA= X-Received: by 10.157.10.195 with SMTP id 61mr2209335otq.157.1518712560591; Thu, 15 Feb 2018 08:36:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.5.137 with HTTP; Thu, 15 Feb 2018 08:36:00 -0800 (PST) In-Reply-To: References: From: Fabio Estevam Date: Thu, 15 Feb 2018 14:36:00 -0200 Message-ID: To: alsa-devel@alsa-project.org, Eric Nelson Cc: Max Krummenacher , Stefan Agner , Gary Bisson , Mark Brown , Sascha Hauer , Richard Leitner Subject: Re: [alsa-devel] sgtl5000 fails after suspend/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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Feb 15, 2018 at 11:35 AM, Fabio Estevam wrote: > Hi, > > I noticed that sgtl5000 does not work after a suspend/resume cycle: > > # aplay /media/a2002011001-e02.wav > Playing WAVE '/media/a2002011001-e02.wav' : Signed 16 bit Little > Endian, Rate 44100 Hz, Stereo > aplay: pcm_write:2051: write error: Input/output error > > Tested several 4.16-rc1 (and also previous kernels like 4.4) and all > of them failed. > > I think it worked in some point in time. > > Tested on a imx53qsb and imx6 wandboard. > > Does anyone have any suggestions? Reverting the commit below on top of 4.16-rc1 makes sgtl5000 suspend/resume to work again: commit 8419caa7270291e26f8b34b12b29680586c85d30 Author: Eric Nelson Date: Tue Jun 7 01:14:52 2016 +0200 ASoC: sgtl5000: Do not disable regulators in SND_SOC_BIAS_OFF Disabling the SGTL5000 through regulators would certainly save more power than simply disabling the reference voltages as described in the data sheet, but won't properly restore things on resume. This driver does not support active regulators. So we simply disable the reference bias currents. Signed-off-by: Eric Nelson Signed-off-by: Clemens Gruber Reviewed-by: Fabio Estevam Signed-off-by: Mark Brown Or if I do the change below against linux-next it also works: } Any suggestions for a proper fix? Eric? Thanks --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -880,8 +880,6 @@ static int sgtl5000_set_bias_level(struct snd_soc_component *component, SGTL5000_REFTOP_POWERUP); break; case SND_SOC_BIAS_OFF: - snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER, - SGTL5000_REFTOP_POWERUP, 0); break;