ASoC: ti: davinci-mcasp: Support for correct symmetric sample bits
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 26 Jul 2019 06:42:44 +0000 (09:42 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 26 Jul 2019 12:10:54 +0000 (13:10 +0100)
commit2448c813b12cf1fb08da1d20bdb2ae583cda2d6f
tree84874ae1689428c3b34a0b2fe15c0b524d9ed3af
parent3b46a67af2eb8214a634a37c485146ca0ef42849
ASoC: ti: davinci-mcasp: Support for correct symmetric sample bits

Implement custom snd_pcm_hw_rule to filter the available formats for the
second stream to make it symmetric and allow only formats which require
the same amount of bits on the bus as the running stream.

A simple constraint is not working correctly because for example:
the first stream is started with S24_LE

If we place 24 as constraint for the SAMPLE_BITS then the second stream
can not use S24_LE as it is physically 32bits.

If we would place 32 as constraint (physical width) then S32_LE would have
been allowed, but S24_3LE is not.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190726064244.3762-3-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/ti/davinci-mcasp.c