]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: fsl_rpmsg: Configure CPU DAI for card that sits on rpmsg-micfil-channel
authorChancel Liu <chancel.liu@nxp.com>
Mon, 21 Apr 2025 10:57:00 +0000 (19:57 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 1 May 2025 20:38:53 +0000 (05:38 +0900)
Sound card that sits on rpmsg-micfil-channel has different settings on
CPU DAI.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20250421105701.2273588-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_rpmsg.c

index 6d67db4e058107fb89a49c7a0fab8d3403797433..4e3ca05bedd6e43a638e1f861b584d7c6105daa3 100644 (file)
@@ -229,6 +229,16 @@ static int fsl_rpmsg_probe(struct platform_device *pdev)
        }
        dai_drv->name = dai_name;
 
+       /* Setup cpu dai for sound card that sits on rpmsg-micfil-channel */
+       if (!strcmp(dai_name, "rpmsg-micfil-channel")) {
+               dai_drv->capture.channels_min = 1;
+               dai_drv->capture.channels_max = 8;
+               dai_drv->capture.rates = SNDRV_PCM_RATE_8000_48000;
+               dai_drv->capture.formats = SNDRV_PCM_FMTBIT_S32_LE;
+               if (of_device_is_compatible(np, "fsl,imx8mm-rpmsg-audio"))
+                       dai_drv->capture.formats = SNDRV_PCM_FMTBIT_S16_LE;
+       }
+
        if (of_property_read_bool(np, "fsl,enable-lpa")) {
                rpmsg->enable_lpa = 1;
                rpmsg->buffer_size = LPA_LARGE_BUFFER_SIZE;