]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: ti: davinci-mcasp: Correct slot_width posed constraint
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 26 Jul 2019 06:42:43 +0000 (09:42 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 26 Jul 2019 12:09:32 +0000 (13:09 +0100)
commit2000ea155945677d777bb39858cab65636a90539
tree3684939c69a76f240d1443833209adcaa0bf4575
parent03fd4b32a9b3a2a3df4ad7c6e53bd93b26566b50
ASoC: ti: davinci-mcasp: Correct slot_width posed constraint

The slot_width is a property for the bus while the constraint for
SNDRV_PCM_HW_PARAM_SAMPLE_BITS is for the in memory format.

Applying slot_width constraint to sample_bits works most of the time, but
it will blacklist valid formats in some cases.

With slot_width 24 we can support S24_3LE and S24_LE formats as they both
look the same on the bus, but a a 24 constraint on sample_bits would not
allow S24_LE as it is stored in 32bits in memory.

Implement a simple hw_rule function to allow all formats which require less
or equal number of bits on the bus as slot_width (if configured).

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