ASoC: fsl: imx-pcm-rpmsg: Register component with rpmsg channel name
authorChancel Liu <chancel.liu@nxp.com>
Mon, 11 Mar 2024 11:13:45 +0000 (20:13 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 25 Mar 2024 00:32:48 +0000 (00:32 +0000)
Machine driver uses rpmsg channel name to link this platform component.
However if the component is re-registerd card will not find this new
created component in snd_soc_try_rebind_card().

Explicitly register this component with rpmsg channel name so that
card can always find this component.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://msgid.link/r/20240311111349.723256-2-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/imx-pcm-rpmsg.c

index fb9244c1e9c5fc9ebd2a3e40457933b9baa7b02b..b84d1dfddba2f150e307ada95001290188ee9e5a 100644 (file)
@@ -732,9 +732,6 @@ static int imx_rpmsg_pcm_probe(struct platform_device *pdev)
                goto fail;
        }
 
-       /* platform component name is used by machine driver to link with */
-       component->name = info->rpdev->id.name;
-
 #ifdef CONFIG_DEBUG_FS
        component->debugfs_prefix = "rpmsg";
 #endif
@@ -822,9 +819,17 @@ static const struct dev_pm_ops imx_rpmsg_pcm_pm_ops = {
                                imx_rpmsg_pcm_resume)
 };
 
+static const struct platform_device_id imx_rpmsg_pcm_id_table[] = {
+       { .name = "rpmsg-audio-channel" },
+       { .name = "rpmsg-micfil-channel" },
+       { },
+};
+MODULE_DEVICE_TABLE(platform, imx_rpmsg_pcm_id_table);
+
 static struct platform_driver imx_pcm_rpmsg_driver = {
        .probe  = imx_rpmsg_pcm_probe,
        .remove_new = imx_rpmsg_pcm_remove,
+       .id_table = imx_rpmsg_pcm_id_table,
        .driver = {
                .name = IMX_PCM_DRV_NAME,
                .pm = &imx_rpmsg_pcm_pm_ops,