CHROMIUM: ASoC: samsung i2s - Don't setup if already active.
authorDylan Reid <dgreid@chromium.org>
Fri, 7 Sep 2012 02:10:13 +0000 (19:10 -0700)
committerGerrit <chrome-bot@google.com>
Mon, 17 Sep 2012 16:34:51 +0000 (09:34 -0700)
commitf4157d911494aaf7752f253a71c72262c8d6b813
tree112a9cd3c3e2347d651e060910c1648af691e53e
parent8f374b29bd36c92e672efce3cf7621da7f5f4ff5
CHROMIUM: ASoC: samsung i2s - Don't setup if already active.

If the dai is already running when setup is called, skip setup.  Setting
up again caused set_sysclk to set rclk_srcrate to other->rclk_srcrate,
other would often be set to the default of 44.1.  Playing a 48k stream
then adding a 48k capture stream would lead to both streams set to 44.1
(The value of other->rclk_srcrate).

Similarly in shutdown, if either playback or capture are still active,
return instead of turning off the clocks.

BUG=chrome-os-partner:13769, 13749
TEST=aplay -Dhw:0 <any 48k wav file>, then arecord -Dhw:0 -f dat
/tmp/asdf.wav.  Make sure audio continues from aplay and is captured by
arecord, before this change aplay would stop and arecord would capture
silence.
Gmail settings, make sure microphone progress bar moves when you talk.

Change-Id: I1dd02854e234d23ac25ad686c7603e4bc9265b4e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32477
Reviewed-by: Olof Johansson <olofj@chromium.org>
sound/soc/samsung/i2s.c