diff mbox series

[v3,3/7] ASoC: imx-pcm-rpmsg: Register different platform drivers

Message ID 20220930064441.2548505-4-chancel.liu@nxp.com
State Accepted
Commit b2c2a947b3412f6edb9a86f5b12d6420958e67ba
Headers show
Series Create a new sound card to access MICFIL based on rpmsg channel | expand

Commit Message

Chancel Liu Sept. 30, 2022, 6:44 a.m. UTC
This patch can register different ASoC platform drivers if there are
several rpmsg channels. Thus sound cards based on different rpmsg
channels can link to their respective platform drivers. Besides, the
name of driver is equal to the name of rpmsg channel.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
 sound/soc/fsl/imx-pcm-rpmsg.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Shengjiu Wang Oct. 9, 2022, 6:17 a.m. UTC | #1
On Fri, Sep 30, 2022 at 2:46 PM Chancel Liu <chancel.liu@nxp.com> wrote:

> This patch can register different ASoC platform drivers if there are
> several rpmsg channels. Thus sound cards based on different rpmsg
> channels can link to their respective platform drivers. Besides, the
> name of driver is equal to the name of rpmsg channel.
>
> Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
>

Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>

Best regards
Wang Shengjiu

> ---
>  sound/soc/fsl/imx-pcm-rpmsg.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c
> index 35049043e532..3157cd5a837e 100644
> --- a/sound/soc/fsl/imx-pcm-rpmsg.c
> +++ b/sound/soc/fsl/imx-pcm-rpmsg.c
> @@ -684,7 +684,7 @@ static int imx_rpmsg_pcm_probe(struct platform_device
> *pdev)
>         info->rpdev = container_of(pdev->dev.parent, struct rpmsg_device,
> dev);
>         info->dev = &pdev->dev;
>         /* Setup work queue */
> -       info->rpmsg_wq = alloc_ordered_workqueue("rpmsg_audio",
> +       info->rpmsg_wq = alloc_ordered_workqueue(info->rpdev->id.name,
>                                                  WQ_HIGHPRI |
>                                                  WQ_UNBOUND |
>                                                  WQ_FREEZABLE);
> @@ -723,11 +723,15 @@ static int imx_rpmsg_pcm_probe(struct
> platform_device *pdev)
>         if (ret)
>                 goto fail;
>
> -       component = snd_soc_lookup_component(&pdev->dev, IMX_PCM_DRV_NAME);
> +       component = snd_soc_lookup_component(&pdev->dev, NULL);
>         if (!component) {
>                 ret = -EINVAL;
>                 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
> --
> 2.25.1
>
>
diff mbox series

Patch

diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c
index 35049043e532..3157cd5a837e 100644
--- a/sound/soc/fsl/imx-pcm-rpmsg.c
+++ b/sound/soc/fsl/imx-pcm-rpmsg.c
@@ -684,7 +684,7 @@  static int imx_rpmsg_pcm_probe(struct platform_device *pdev)
 	info->rpdev = container_of(pdev->dev.parent, struct rpmsg_device, dev);
 	info->dev = &pdev->dev;
 	/* Setup work queue */
-	info->rpmsg_wq = alloc_ordered_workqueue("rpmsg_audio",
+	info->rpmsg_wq = alloc_ordered_workqueue(info->rpdev->id.name,
 						 WQ_HIGHPRI |
 						 WQ_UNBOUND |
 						 WQ_FREEZABLE);
@@ -723,11 +723,15 @@  static int imx_rpmsg_pcm_probe(struct platform_device *pdev)
 	if (ret)
 		goto fail;
 
-	component = snd_soc_lookup_component(&pdev->dev, IMX_PCM_DRV_NAME);
+	component = snd_soc_lookup_component(&pdev->dev, NULL);
 	if (!component) {
 		ret = -EINVAL;
 		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