]> 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)
commitf8c80040112be3ee187e2b87fc71f579b4ba9fe7
tree1e1e30653ce73b844e2d8d36c1e8d9b1dcca827a
parent93ef5b626509ab037cde2c32899db61fecf41b12
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