CHROMIUM: ASoC: Samsung: Don't reset playing streams.
authorDylan Reid <dgreid@chromium.org>
Wed, 29 Aug 2012 03:42:48 +0000 (20:42 -0700)
committerGerrit <chrome-bot@google.com>
Fri, 31 Aug 2012 01:44:50 +0000 (18:44 -0700)
b796fed30720 "Asoc: Samsung: Add I2S S/W RST in startup function"
introduced a bug where whenever a new stream was started, all i2s
streams would be reset.  This caused all full-duplex use cases to fail,
no hangouts, no GTalk.

Instead of always resetting, only reset if nothing is active.  The reset
will still happen when it is needed, but won't if something is already
playing.

BUG=chrome-os-partner:13282
TEST=aplay and arecord at the same time should work.

Change-Id: I1bc7c87b8deff710f408565b2b834c25d4d0053d
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31681
Reviewed-by: Doug Anderson <dianders@chromium.org>
sound/soc/samsung/i2s.c

index a47fd34..12f6383 100644 (file)
@@ -662,7 +662,7 @@ static int i2s_startup(struct snd_pcm_substream *substream,
        /* Enforce set_sysclk in Master mode */
        i2s->rclk_srcrate = 0;
 
-       if (i2s->quirks & QUIRK_NEED_RSTCLR)
+       if (!any_active(i2s) && (i2s->quirks & QUIRK_NEED_RSTCLR))
                writel(CON_RSTCLR, i2s->addr + I2SCON);
 
        spin_unlock_irqrestore(&lock, flags);