]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: soc-generic-dmaengine-pcm: set period_bytes_min based on maxburst
authorSascha Hauer <s.hauer@pengutronix.de>
Tue, 1 Mar 2022 11:34:46 +0000 (12:34 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 2 Mar 2022 13:45:25 +0000 (13:45 +0000)
commit9d911c5fec7d73e4b5a9a2c182316a7a023bf7ef
treec9202f54ebd53ffb18ec060f0415abfc002f1613
parent3b653a2b4d11c7e3f7a06857942a6b688f6fb4d9
ASoC: soc-generic-dmaengine-pcm: set period_bytes_min based on maxburst

In dmaengine_pcm_set_runtime_hwparams() period_bytes_min is hardcoded to
256. For some applications that may be too big. This patch changes that
to calculate the value based on dma_data->maxburst. The correct value
would be maxburst multiplied by the address width of the hardware FIFO.
Unfortunately the address width is dynamically calculated based on the
stream parameters and is not known at open time, so the worst case
is chosen here which is 8 bytes, the maximum that is supported by
dmaengine drivers.
Not all drivers may set a maxburst value, so we fall back to the
previously used hardcoded value of 256 bytes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20220301113446.1053171-1-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-generic-dmaengine-pcm.c