]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ASoC: fsl-ssi: Fix baudclock handling
authorMarkus Pargmann <mpa@pengutronix.de>
Tue, 27 May 2014 08:24:23 +0000 (10:24 +0200)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:16:53 +0000 (21:16 -0600)
commit59b4c3873a0221899ef6fa613b75d5b28ff5a472
treedd2828790b720e1085aecd15d4ee6202a7cd7ab0
parent6c61434c9343161dd802b252758959fff754f7d1
ASoC: fsl-ssi: Fix baudclock handling

The baudclock may be used and set by different streams.

Allow only the first stream to set the bitclock rate. Other streams have
to try to get to the correct rate without modifying the bitclock rate
using the SSI internal clock modifiers.

The variable baudclk_streams is introduced to keep track of the active
streams that are using the baudclock. This way we know if the baudclock
may be set and whether we may enable/disable the clock.

baudclock enable/disable is moved to hw_params()/hw_free(). This way we can
keep track of the baudclock in those two functions and avoid a running
clock while it is not used. As hw_params()/hw_free() may be called
multiple times for the same stream, we have to use baudclk_streams
variable to know whether we may enable/disable the clock.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d429d8e3324cae120784a1e194ef6ea62aeb327e)
sound/soc/fsl/fsl_ssi.c