From: Chancel Liu <chancel.liu@nxp.com>
To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
tiwai@suse.com, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, robh+dt@kernel.org,
devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org,
shengjiu.wang@nxp.com, Xiubo.Lee@gmail.com, festevam@gmail.com,
nicoleotsuka@gmail.com, linuxppc-dev@lists.ozlabs.org
Cc: Chancel Liu <chancel.liu@nxp.com>
Subject: [PATCH 3/5] ASoC: imx-pcm-rpmsg: Register different platform drivers
Date: Mon, 29 Aug 2022 15:51:42 +0800 [thread overview]
Message-ID: <20220829075144.2405000-4-chancel.liu@nxp.com> (raw)
In-Reply-To: <20220829075144.2405000-1-chancel.liu@nxp.com>
This patch can register different ASoC platform drivers in reference
to "fsl,platform" property of the corresponding node in dts. So sound
cards based on different rpmsg channels can link to their respective
platform drivers.
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
sound/soc/fsl/imx-pcm-rpmsg.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c
index 35049043e532..2f310994f7ee 100644
--- a/sound/soc/fsl/imx-pcm-rpmsg.c
+++ b/sound/soc/fsl/imx-pcm-rpmsg.c
@@ -178,7 +178,7 @@ static int imx_rpmsg_pcm_hw_params(struct snd_soc_component *component,
msg->s_msg.param.channels = RPMSG_CH_STEREO;
break;
default:
- ret = -EINVAL;
+ msg->s_msg.param.channels = params_channels(params);
break;
}
@@ -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
next prev parent reply other threads:[~2022-08-29 7:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 7:51 [PATCH 0/5] Create a new sound card to access MICFIL based on rpmsg channel Chancel Liu
2022-08-29 7:51 ` [PATCH 1/5] ASoC: dt-bindings: fsl_rpmsg: Add a property to assign platform driver name Chancel Liu
2022-08-30 6:28 ` S.J. Wang
2022-08-30 9:28 ` Krzysztof Kozlowski
2022-08-29 7:51 ` [PATCH 2/5] ASoC: imx-audio-rpmsg: Create rpmsg channel for MICFIL Chancel Liu
2022-08-29 7:51 ` Chancel Liu [this message]
2022-08-30 6:31 ` [PATCH 3/5] ASoC: imx-pcm-rpmsg: Register different platform drivers S.J. Wang
2022-08-29 7:51 ` [PATCH 4/5] ASoC: fsl_rpmsg: Register different CPU DAI drivers Chancel Liu
2022-08-29 7:51 ` [PATCH 5/5] ASoC: imx-rpmsg: Assign platform driver used by machine driver to link with Chancel Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220829075144.2405000-4-chancel.liu@nxp.com \
--to=chancel.liu@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--cc=shengjiu.wang@nxp.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).