]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 17 Sep 2019 16:02:18 +0000 (18:02 +0200)
commitc830012b36dca5c857b9a854276a150528f94059
tree41090a1b970f871dcb8b96b561c14af1a0943752
parent1d6be8f2c89455f435c336e2fef1d17fe053a848
ASoC: ti: davinci-mcasp: Correct slot_width posed constraint

BugLink: https://bugs.launchpad.net/bugs/1842114
[ Upstream commit 1e112c35e3c96db7c8ca6ddaa96574f00c06e7db ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
sound/soc/davinci/davinci-mcasp.c