devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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@gmail.com, 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 v2 7/7] ASoC: imx-rpmsg: Assign platform driver used by machine driver to link with
Date: Wed, 14 Sep 2022 18:51:45 +0800	[thread overview]
Message-ID: <20220914105145.2543646-8-chancel.liu@nxp.com> (raw)
In-Reply-To: <20220914105145.2543646-1-chancel.liu@nxp.com>

Each ASoC platform driver is named by rpmsg channel. ASoC machine
driver can parse "fsl,rpmsg-channel-name" property to figure out which
ASoC platform driver it should link with.

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

diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c
index 2e117311e582..57684064c9da 100644
--- a/sound/soc/fsl/imx-rpmsg.c
+++ b/sound/soc/fsl/imx-rpmsg.c
@@ -36,6 +36,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
 	struct platform_device *rpmsg_pdev = to_platform_device(dev);
 	struct device_node *np = rpmsg_pdev->dev.of_node;
 	struct of_phandle_args args;
+	const char *platform_name;
 	struct imx_rpmsg *data;
 	int ret = 0;
 
@@ -81,7 +82,10 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
 	}
 
 	data->dai.cpus->dai_name = dev_name(&rpmsg_pdev->dev);
-	data->dai.platforms->name = IMX_PCM_DRV_NAME;
+	if (!of_property_read_string(np, "fsl,rpmsg-channel-name", &platform_name))
+		data->dai.platforms->name = platform_name;
+	else
+		data->dai.platforms->name = "rpmsg-audio-channel";
 	data->dai.playback_only = true;
 	data->dai.capture_only = true;
 	data->card.num_links = 1;
-- 
2.25.1


      parent reply	other threads:[~2022-09-14 10:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 10:51 [PATCH v2 0/7] Create a new sound card to access MICFIL based on rpmsg channel Chancel Liu
2022-09-14 10:51 ` [PATCH v2 1/7] ASoC: dt-bindings: fsl_rpmsg: Add a property to assign the " Chancel Liu
2022-09-16 18:50   ` Rob Herring
2022-09-23  9:56     ` Chancel Liu
2022-09-23 10:30       ` Krzysztof Kozlowski
2022-09-25  8:29         ` [EXT] " Chancel Liu
2022-09-14 10:51 ` [PATCH v2 2/7] ASoC: imx-audio-rpmsg: Create rpmsg channel for MICFIL Chancel Liu
2022-09-14 10:51 ` [PATCH v2 3/7] ASoC: imx-pcm-rpmsg: Register different platform drivers Chancel Liu
2022-09-14 10:51 ` [PATCH v2 4/7] ASoC: imx-pcm-rpmsg: Multi-channel support for sound card based on rpmsg Chancel Liu
2022-09-14 10:51 ` [PATCH v2 5/7] ASoC: fsl_rpmsg: Register different ASoC machine devices Chancel Liu
2022-09-14 10:51 ` [PATCH v2 6/7] ASoC: fsl_rpmsg: Multi-channel support in CPU DAI driver Chancel Liu
2022-09-14 10:51 ` Chancel Liu [this message]

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=20220914105145.2543646-8-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@gmail.com \
    --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).