alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@google.com>
To: broonie@kernel.org, pierre-louis.bossart@linux.intel.com
Cc: tzungbi@google.com, alsa-devel@alsa-project.org,
	dgreid@google.com, cychiang@google.com
Subject: [alsa-devel] [PATCH v2 1/3] ASoC: max98090: remove msleep in PLL unlocked workaround
Date: Fri, 22 Nov 2019 15:31:12 +0800	[thread overview]
Message-ID: <20191122073114.219945-2-tzungbi@google.com> (raw)
In-Reply-To: <20191122073114.219945-1-tzungbi@google.com>

It was observed Baytrail-based chromebooks could cause continuous PLL
unlocked when using playback stream and capture stream simultaneously.
Specifically, starting a capture stream after started a playback stream.
As a result, the audio data could corrupt or turn completely silent.

As the datasheet suggested, the maximum PLL lock time should be 7 msec.
The workaround resets the codec softly by toggling SHDN off and on if
PLL failed to lock for 10 msec.  Notably, there is no suggested hold
time for SHDN off.

On Baytrail-based chromebooks, it would easily happen continuous PLL
unlocked if there is a 10 msec delay between SHDN off and on.  Removes
the msleep().

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
---
 sound/soc/codecs/max98090.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index f6bf4cfbea23..12cb87c0d463 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2114,10 +2114,16 @@ static void max98090_pll_work(struct work_struct *work)
 
 	dev_info_ratelimited(component->dev, "PLL unlocked\n");
 
+	/*
+	 * As the datasheet suggested, the maximum PLL lock time should be
+	 * 7 msec.  The workaround resets the codec softly by toggling SHDN
+	 * off and on if PLL failed to lock for 10 msec.  Notably, there is
+	 * no suggested hold time for SHDN off.
+	 */
+
 	/* Toggle shutdown OFF then ON */
 	snd_soc_component_update_bits(component, M98090_REG_DEVICE_SHUTDOWN,
 			    M98090_SHDNN_MASK, 0);
-	msleep(10);
 	snd_soc_component_update_bits(component, M98090_REG_DEVICE_SHUTDOWN,
 			    M98090_SHDNN_MASK, M98090_SHDNN_MASK);
 
-- 
2.24.0.432.g9d3f5f5b63-goog

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-11-22  7:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  7:31 [alsa-devel] [PATCH v2 0/3] ASoC: max98090: fix PLL unlocked workaround-related Tzung-Bi Shih
2019-11-22  7:31 ` Tzung-Bi Shih [this message]
2019-11-28 13:18   ` [alsa-devel] Applied "ASoC: max98090: remove msleep in PLL unlocked workaround" to the asoc tree Mark Brown
2019-11-22  7:31 ` [alsa-devel] [PATCH v2 2/3] ASoC: max98090: exit workaround earlier if PLL is locked Tzung-Bi Shih
2019-11-28 13:18   ` [alsa-devel] Applied "ASoC: max98090: exit workaround earlier if PLL is locked" to the asoc tree Mark Brown
2019-11-22  7:31 ` [alsa-devel] [PATCH v2 3/3] ASoC: max98090: fix possible race conditions Tzung-Bi Shih
2019-11-28 13:18   ` [alsa-devel] Applied "ASoC: max98090: fix possible race conditions" to the asoc tree Mark Brown
2019-11-22 15:21 ` [alsa-devel] [PATCH v2 0/3] ASoC: max98090: fix PLL unlocked workaround-related Pierre-Louis Bossart

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=20191122073114.219945-2-tzungbi@google.com \
    --to=tzungbi@google.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cychiang@google.com \
    --cc=dgreid@google.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).