]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: fsl-ssi: Fix baudclock handling
authorMarkus Pargmann <mpa@pengutronix.de>
Tue, 27 May 2014 08:24:23 +0000 (10:24 +0200)
committerMark Brown <broonie@linaro.org>
Sun, 1 Jun 2014 10:55:08 +0000 (11:55 +0100)
commit47547ab04d2d7fdf93b4c3994ffebdc4b15344d6
tree1e1e30653ce73b844e2d8d36c1e8d9b1dcca827a
parent7ff98dd8fab9f01f169d02544a0680a4e55d08be
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>
sound/soc/fsl/fsl_ssi.c