All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: alsa-devel@alsa-project.org, Eric Nelson <eric@nelint.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>,
	Stefan Agner <stefan@agner.ch>,
	Gary Bisson <gary.bisson@boundarydevices.com>,
	Mark Brown <broonie@kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Richard Leitner <richard.leitner@skidata.com>
Subject: Re: sgtl5000 fails after suspend/resume
Date: Thu, 15 Feb 2018 14:36:00 -0200	[thread overview]
Message-ID: <CAOMZO5CyE5T-H=K2Q9A=tYoY9zt0CO4YdFWK5PMS=NR2XbqPzQ@mail.gmail.com> (raw)
In-Reply-To: <CAOMZO5B3rb_UKatssvP0eZdm4JD_oa3A0A1pAr4keq4w0EYBNA@mail.gmail.com>

On Thu, Feb 15, 2018 at 11:35 AM, Fabio Estevam <festevam@gmail.com> 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 <eric@nelint.com>
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 <eric@nelint.com>
    Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
    Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>

Or if I do the change below against linux-next it also works:

--- 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;
        }

Any suggestions for a proper fix? Eric?

Thanks

  reply	other threads:[~2018-02-15 16:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 13:35 sgtl5000 fails after suspend/resume Fabio Estevam
2018-02-15 16:36 ` Fabio Estevam [this message]
2018-02-15 18:11   ` Fabio Estevam
2018-02-15 18:16   ` Mark Brown
2018-02-15 18:27     ` Fabio Estevam
2018-02-15 18:25   ` Max Krummenacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOMZO5CyE5T-H=K2Q9A=tYoY9zt0CO4YdFWK5PMS=NR2XbqPzQ@mail.gmail.com' \
    --to=festevam@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=eric@nelint.com \
    --cc=gary.bisson@boundarydevices.com \
    --cc=kernel@pengutronix.de \
    --cc=max.krummenacher@toradex.com \
    --cc=richard.leitner@skidata.com \
    --cc=stefan@agner.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.