ASoC: mediatek: mt8188: DPCM used FE and BE merged parameters
authorTrevor Wu <trevor.wu@mediatek.com>
Thu, 6 Jul 2023 06:41:23 +0000 (14:41 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 19 Jul 2023 16:40:19 +0000 (17:40 +0100)
To ensure that DPCM takes into account the backend hardware limitations
when user space queries the hw_params of a device, we need to add
dpcm_merged_format, dpcm_merged_chan, and dpcm_merged_rate to the FE
dai_links.

This patch includes only stereo FE dai_links, since multi-channel FEs
may be reserved for specific purposes. Therefore, it may not be
appropriate to consider BE conditions.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230706064123.29790-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8188/mt8188-mt6359.c

index ac69c23..7c9e08e 100644 (file)
@@ -723,6 +723,9 @@ static struct snd_soc_dai_link mt8188_mt6359_dai_links[] = {
                },
                .dynamic = 1,
                .dpcm_playback = 1,
+               .dpcm_merged_chan = 1,
+               .dpcm_merged_rate = 1,
+               .dpcm_merged_format = 1,
                SND_SOC_DAILINK_REG(playback2),
        },
        [DAI_LINK_DL3_FE] = {
@@ -734,6 +737,9 @@ static struct snd_soc_dai_link mt8188_mt6359_dai_links[] = {
                },
                .dynamic = 1,
                .dpcm_playback = 1,
+               .dpcm_merged_chan = 1,
+               .dpcm_merged_rate = 1,
+               .dpcm_merged_format = 1,
                SND_SOC_DAILINK_REG(playback3),
        },
        [DAI_LINK_DL6_FE] = {
@@ -745,6 +751,9 @@ static struct snd_soc_dai_link mt8188_mt6359_dai_links[] = {
                },
                .dynamic = 1,
                .dpcm_playback = 1,
+               .dpcm_merged_chan = 1,
+               .dpcm_merged_rate = 1,
+               .dpcm_merged_format = 1,
                SND_SOC_DAILINK_REG(playback6),
        },
        [DAI_LINK_DL7_FE] = {
@@ -833,6 +842,9 @@ static struct snd_soc_dai_link mt8188_mt6359_dai_links[] = {
                },
                .dynamic = 1,
                .dpcm_capture = 1,
+               .dpcm_merged_chan = 1,
+               .dpcm_merged_rate = 1,
+               .dpcm_merged_format = 1,
                SND_SOC_DAILINK_REG(capture4),
        },
        [DAI_LINK_UL5_FE] = {
@@ -844,6 +856,9 @@ static struct snd_soc_dai_link mt8188_mt6359_dai_links[] = {
                },
                .dynamic = 1,
                .dpcm_capture = 1,
+               .dpcm_merged_chan = 1,
+               .dpcm_merged_rate = 1,
+               .dpcm_merged_format = 1,
                SND_SOC_DAILINK_REG(capture5),
        },
        [DAI_LINK_UL6_FE] = {