linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] ASoC: sgtl5000: give it a ramping time before writting
Date: Mon, 1 Jul 2013 16:16:08 +0800	[thread overview]
Message-ID: <1372666571-17276-2-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1372666571-17276-1-git-send-email-shawn.guo@linaro.org>

Since commit af8ee11 (ASoC: sgtl5000: Fix driver probe after reset),
it's very ofen to run into the following probe error on imx28. It is
caused by the regmap_write() failure in sgtl5000_fill_defaults().
However, the regmap_read() before this has already been working.  It
seems that sgtl5000 takes a longer ramping time to get the registers
ready for write than read.

[    1.991579] sgtl5000 0-000a: sgtl5000 revision 0x11
[    2.021655] mxs-sgtl5000 sound.12: ASoC: CODEC (null) not registered
[    2.039087] mxs-sgtl5000 sound.12: snd_soc_register_card failed (-517)
[    2.046299] platform sound.12: Driver mxs-sgtl5000 requests probe deferral

Fix the regression by giving it a ramping time before the first write.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 sound/soc/codecs/sgtl5000.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index d441559..20bca03 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1552,6 +1552,13 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, sgtl5000);
 
+	/*
+	 * It seems that sgtl5000 takes a longer time to get the registers
+	 * ready for write than bread.  Let's give it a ramping time before
+	 * the first write goes.
+	 */
+	msleep(50);
+
 	/* Ensure sgtl5000 will start with sane register values */
 	ret = sgtl5000_fill_defaults(sgtl5000);
 	if (ret)
-- 
1.7.9.5

  reply	other threads:[~2013-07-01  8:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01  8:16 [PATCH 0/4] Fix mxs audio regressions Shawn Guo
2013-07-01  8:16 ` Shawn Guo [this message]
2013-07-01 10:07   ` [PATCH 1/4] ASoC: sgtl5000: give it a ramping time before writting Mark Brown
2013-07-01 10:54     ` Marek Vasut
2013-07-01 13:55       ` Shawn Guo
2013-07-01 14:12       ` [alsa-devel] " Fabio Estevam
2013-07-01 14:26         ` Shawn Guo
2013-07-01 14:34           ` Shawn Guo
2013-07-01 15:11             ` Fabio Estevam
2013-07-01 15:33               ` Shawn Guo
2013-07-01 15:42                 ` Fabio Estevam
2013-07-01 17:43                   ` Marek Vasut
2013-07-01 19:14                     ` Fabio Estevam
2013-07-01 19:28                       ` Alexandre Belloni
2013-07-02  2:16                     ` Shawn Guo
2013-07-01 19:23                   ` Alexandre Belloni
2013-07-01 14:04     ` Shawn Guo
2013-07-01 10:57   ` Lothar Waßmann
2013-07-01  8:16 ` [PATCH 2/4] ASoC: sgtl5000: defer the probe if clock is not found Shawn Guo
2013-07-01  9:45   ` Mark Brown
2013-07-01 11:33     ` Russell King - ARM Linux
2013-07-01 12:51       ` Mark Brown
2013-07-01  8:16 ` [PATCH 3/4] ASoC: mxs: register saif mclk to clock framework Shawn Guo
2013-07-01 10:11   ` Mark Brown
2013-07-01  8:16 ` [PATCH 4/4] ARM: mxs: saif0 is the clock provider to sgtl5000 Shawn Guo

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=1372666571-17276-2-git-send-email-shawn.guo@linaro.org \
    --to=shawn.guo@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).