From: Liam Girdwood <lrg@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Axel Lin <axel.lin@gmail.com>,
patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org
Subject: Re: [PATCH] ASoC: Fix WM8996 DC servo operation without IRQ
Date: Thu, 15 Sep 2011 19:06:05 +0100 [thread overview]
Message-ID: <1316109965.3333.3.camel@odin> (raw)
In-Reply-To: <1316080453-3710-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On Thu, 2011-09-15 at 10:54 +0100, Mark Brown wrote:
> We need to count the timneout down.
>
> Reported-by: Axel Lin <axel.lin@gmail.com>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> sound/soc/codecs/wm8996.c | 9 +++------
> 1 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
> index 0fed436..5ca9d76 100644
> --- a/sound/soc/codecs/wm8996.c
> +++ b/sound/soc/codecs/wm8996.c
> @@ -719,7 +719,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, u16 mask)
> {
> struct i2c_client *i2c = to_i2c_client(codec->dev);
> struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
> - int i, ret;
> + int ret;
> unsigned long timeout = 200;
>
> snd_soc_write(codec, WM8996_DC_SERVO_2, mask);
> @@ -734,15 +734,12 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, u16 mask)
>
> } else {
> msleep(1);
> - if (--i) {
> - timeout = 0;
> - break;
> - }
> + timeout--;
> }
>
> ret = snd_soc_read(codec, WM8996_DC_SERVO_2);
> dev_dbg(codec->dev, "DC servo state: %x\n", ret);
> - } while (ret & mask);
> + } while (timeout && ret & mask);
>
> if (timeout == 0)
> dev_err(codec->dev, "DC servo timed out for %x\n", mask);
Acked-by: Liam Girdwood <lrg@ti.com>
prev parent reply other threads:[~2011-09-15 18:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-15 9:54 [PATCH] ASoC: Fix WM8996 DC servo operation without IRQ Mark Brown
2011-09-15 18:06 ` Liam Girdwood [this message]
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=1316109965.3333.3.camel@odin \
--to=lrg@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=axel.lin@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=patches@opensource.wolfsonmicro.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 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.