OpenCloudOS-Kernel/sound/soc/mediatek/common
Chen-Yu Tsai 3d736856e2 ASoC: mediatek: disable buffer pre-allocation
[ Upstream commit 32c9c06adb5b157ef259233775a063a43746d699 ]

On Chromebooks based on Mediatek MT8195 or MT8188, the audio frontend
(AFE) is limited to accessing a very small window (1 MiB) of memory,
which is described as a reserved memory region in the device tree.

On these two platforms, the maximum buffer size is given as 512 KiB.
The MediaTek common code uses the same value for preallocations. This
means that only the first two PCM substreams get preallocations, and
then the whole space is exhausted, barring any other substreams from
working. Since the substreams used are not always the first two, this
means audio won't work correctly.

This is observed on the MT8188 Geralt Chromebooks, on which the
"mediatek,dai-link" property was dropped when it was upstreamed. That
property causes the driver to only register the PCM substreams listed
in the property, and in the order given.

Instead of trying to compute an optimal value and figuring out which
streams are used, simply disable preallocation. The PCM buffers are
managed by the core and are allocated and released on the fly. There
should be no impact to any of the other MediaTek platforms.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20241219105303.548437-1-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-17 13:36:11 +01:00
..
Makefile ASoC: mediatek: common: add soundcard driver common code 2023-01-16 11:16:29 +00:00
mtk-afe-fe-dai.c ASoC: mediatek: remove unnecessary initialization 2021-10-27 11:31:12 +01:00
mtk-afe-fe-dai.h ASoC: mediatek: move .suspend/.resume to component 2020-01-21 17:03:54 +00:00
mtk-afe-platform-driver.c ASoC: mediatek: disable buffer pre-allocation 2025-01-17 13:36:11 +01:00
mtk-afe-platform-driver.h ASoC: mediatek: Use managed buffer allocation 2019-12-12 15:41:13 +00:00
mtk-base-afe.h ASoC: mediatek: common: add SMC ops and SMC CMD 2023-01-16 11:16:20 +00:00
mtk-btcvsd.c ASoC: mediatek: Convert to generic PCM copy ops 2023-08-18 12:19:18 +02:00
mtk-dsp-sof-common.c ASoC: mediatek: sof-common: Add NULL check for normal_link string 2024-01-25 15:35:55 -08:00
mtk-dsp-sof-common.h ASoC: mediatek: mt8195: extract SOF common code 2022-07-18 13:45:16 +01:00
mtk-soc-card.h ASoC: mediatek: mt8195: extract SOF common code 2022-07-18 13:45:16 +01:00
mtk-soundcard-driver.c ASoC: mediatek: Assign dummy when codec not specified for a DAI link 2024-06-12 11:11:58 +02:00
mtk-soundcard-driver.h ASoC: mediatek: common: add soundcard driver common code 2023-01-16 11:16:29 +00:00