lkml.org 
[lkml]   [2018]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 005/109] ASoC: sgtl5000: Fix suspend/resume
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Fabio Estevam <fabio.estevam@nxp.com>

    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 <broonie@kernel.org>
    Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

    \
     
     \ /
      Last update: 2018-03-16 17:50    [W:4.514 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site