[adm5120] add USB drivers for the NFS-101U/WU profiles
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1205-workaround-s3c24xx-i2s-stop-live-stream-stall-on-res.patch
1 From edd4b9c7128495063fb529282ebbf165a20f7a23 Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Wed, 2 Jul 2008 22:42:56 +0100
4 Subject: [PATCH] workaround-s3c24xx-i2s-stop-live-stream-stall-on-resume.patch
5 Reported-by: Graeme Gregory <graeme@openmoko.org>
6 Basically-solved-by: Graeme Gregory <graeme@openmoko.org>
7
8 Graeme found a while back that on resume, IISCON register in
9 s3c2442 does not show LRCK toggling in LRINDEX bit any more,
10 causing s3c24xx_snd_lrsync() to timeout and return an error,
11 aborting restart of any live stream that was playing at
12 suspend.
13
14 I confirmed it was true, meddled around for a bit looking
15 for some magic to restart LRCK or at least the reporting of
16 it, and in the end worked around it using the method noted
17 by Graeme: just ignore LRCK sync if it timed out. The worst
18 that could happen would be L and R swap for the duration of
19 stream that was suspended into but probably not even that.
20
21 Signed-off-by: Andy Green <andy@openmoko.com>
22 ---
23 sound/soc/s3c24xx/s3c24xx-i2s.c | 15 +++++++++------
24 1 files changed, 9 insertions(+), 6 deletions(-)
25
26 diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
27 index 7b6cca7..4ec37ef 100644
28 --- a/sound/soc/s3c24xx/s3c24xx-i2s.c
29 +++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
30 @@ -180,7 +180,7 @@ static void s3c24xx_snd_rxctrl(int on)
31 static int s3c24xx_snd_lrsync(void)
32 {
33 u32 iiscon;
34 - int timeout = 50; /* 5ms */
35 + int timeout = 5; /* 500us, 125 should be enough at 8kHz */
36
37 DBG("Entered %s\n", __FUNCTION__);
38
39 @@ -285,11 +285,14 @@ static int s3c24xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
40 case SNDRV_PCM_TRIGGER_START:
41 case SNDRV_PCM_TRIGGER_RESUME:
42 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
43 - if (!s3c24xx_snd_is_clkmaster()) {
44 - ret = s3c24xx_snd_lrsync();
45 - if (ret)
46 - goto exit_err;
47 - }
48 + if (!s3c24xx_snd_is_clkmaster())
49 + /* we ignore the return code, if it sync'd then fine,
50 + * if it didn't sync, which happens after resume the
51 + * first time when there was a live stream at suspend,
52 + * just let it timeout, the stream picks up OK after
53 + * that and LRCK is evidently working again.
54 + */
55 + s3c24xx_snd_lrsync();
56
57 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
58 s3c24xx_snd_rxctrl(1);
59 --
60 1.5.6.5
61
This page took 0.046695 seconds and 5 git commands to generate.