linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Create a new sound card to access MICFIL based on rpmsg channel
@ 2022-08-29  7:51 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
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Chancel Liu @ 2022-08-29  7:51 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel,
	robh+dt, devicetree, krzysztof.kozlowski+dt, shengjiu.wang,
	Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev
  Cc: Chancel Liu

At a previous time, we have successfully created a virtual sound card
based on rpmsg. The sound card works under this mechanism Cortex-A core
tells the Cortex-M core the format, rate, channel, .etc configuration
of the PCM parameters and Cortex-M controls real hardware devices such
as SAI and DMA. From the view of Linux side, the sound card is bound to
a rpmsg channel through which it can access SAI.

Here these patches are introduced to create a new virtual sound card to
access MICFIL based on a new created rpmsg channel. It's easy to create
a new rpmsg channel for MICFIL through rpmsg name service announcment.
Also the other ASoC components bound to this rpmsg MICFIL sound card
will be registered with these patches.

If other sound cards using different hardware devices needs to be
created over rpmsg in the future, these patches can be referred.

Chancel Liu (5):
  ASoC: dt-bindings: fsl_rpmsg: Add a property to assign platform driver
    name
  ASoC: imx-audio-rpmsg: Create rpmsg channel for MICFIL
  ASoC: imx-pcm-rpmsg: Register different platform drivers
  ASoC: fsl_rpmsg: Register different CPU DAI drivers
  ASoC: imx-rpmsg: Assign platform driver used by machine driver to link
    with

 .../devicetree/bindings/sound/fsl,rpmsg.yaml  | 34 +++++++++++++++++--
 sound/soc/fsl/fsl_rpmsg.c                     |  2 +-
 sound/soc/fsl/imx-audio-rpmsg.c               |  3 +-
 sound/soc/fsl/imx-pcm-rpmsg.c                 | 10 ++++--
 sound/soc/fsl/imx-rpmsg.c                     |  6 +++-
 5 files changed, 47 insertions(+), 8 deletions(-)

--
2.25.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] ASoC: dt-bindings: fsl_rpmsg: Add a property to assign platform driver name
  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 ` 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
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 9+ messages in thread
From: Chancel Liu @ 2022-08-29  7:51 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel,
	robh+dt, devicetree, krzysztof.kozlowski+dt, shengjiu.wang,
	Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev
  Cc: Chancel Liu

Add a string property to assign ASoC platform driver name. It also
represents the rpmsg channel this sound card sits on. This property
can be omitted if there is only one sound card and it sits on
"rpmsg-audio-channel".

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
 .../devicetree/bindings/sound/fsl,rpmsg.yaml  | 34 +++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
index d370c98a62c7..35e3cb9f768b 100644
--- a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
@@ -11,8 +11,11 @@ maintainers:
 
 description: |
   fsl_rpmsg is a virtual audio device. Mapping to real hardware devices
-  are SAI, DMA controlled by Cortex M core. What we see from Linux
-  side is a device which provides audio service by rpmsg channel.
+  are SAI, MICFIL, DMA controlled by Cortex M core. What we see from
+  Linux side is a device which provides audio service by rpmsg channel.
+  We can create different sound cards which access different hardwares
+  such as SAI, MICFIL, .etc through building rpmsg channels between
+  Cortex-A and Cortex-M.
 
 properties:
   compatible:
@@ -85,6 +88,14 @@ properties:
       This is a boolean property. If present, the receiving function
       will be enabled.
 
+  fsl,platform:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: |
+      A string property to assign ASoC platform driver name. It also
+      represents the rpmsg channel this sound card sits on. This property
+      can be omitted if there is only one sound card and it sits on
+      "rpmsg-audio-channel".
+
 required:
   - compatible
   - model
@@ -107,3 +118,22 @@ examples:
                  <&clk IMX8MN_AUDIO_PLL2_OUT>;
         clock-names = "ipg", "mclk", "dma", "pll8k", "pll11k";
     };
+
+  - |
+    #include <dt-bindings/clock/imx8mm-clock.h>
+
+    rpmsg_micfil: rpmsg_micfil {
+        compatible = "fsl,imx8mm-rpmsg-audio";
+        model = "micfil-audio";
+        fsl,platform = "rpmsg-micfil-channel";
+        fsl,enable-lpa;
+        fsl,rpmsg-in;
+        clocks = <&clk IMX8MM_CLK_PDM_IPG>,
+                 <&clk IMX8MM_CLK_PDM_ROOT>,
+                 <&clk IMX8MM_CLK_SDMA3_ROOT>,
+                 <&clk IMX8MM_AUDIO_PLL1_OUT>,
+                 <&clk IMX8MM_AUDIO_PLL2_OUT>;
+        clock-names = "ipg", "mclk", "dma", "pll8k", "pll11k";
+    };
+
+...
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/5] ASoC: imx-audio-rpmsg: Create rpmsg channel for MICFIL
  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-29  7:51 ` Chancel Liu
  2022-08-29  7:51 ` [PATCH 3/5] ASoC: imx-pcm-rpmsg: Register different platform drivers Chancel Liu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Chancel Liu @ 2022-08-29  7:51 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel,
	robh+dt, devicetree, krzysztof.kozlowski+dt, shengjiu.wang,
	Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev
  Cc: Chancel Liu

Rpmsg channel for MICFIL can also be created through rpmsg name
service announcement. If this driver is probed, Cortex-A can access
MICFIL which is actually controlled by Cortex-M through rpmsg channel
for MICFIL.

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

diff --git a/sound/soc/fsl/imx-audio-rpmsg.c b/sound/soc/fsl/imx-audio-rpmsg.c
index 905c3a071300..d5234ac4b09b 100644
--- a/sound/soc/fsl/imx-audio-rpmsg.c
+++ b/sound/soc/fsl/imx-audio-rpmsg.c
@@ -88,7 +88,7 @@ static int imx_audio_rpmsg_probe(struct rpmsg_device *rpdev)
 	/* Register platform driver for rpmsg routine */
 	data->rpmsg_pdev = platform_device_register_data(&rpdev->dev,
 							 IMX_PCM_DRV_NAME,
-							 PLATFORM_DEVID_NONE,
+							 PLATFORM_DEVID_AUTO,
 							 NULL, 0);
 	if (IS_ERR(data->rpmsg_pdev)) {
 		dev_err(&rpdev->dev, "failed to register rpmsg platform.\n");
@@ -110,6 +110,7 @@ static void imx_audio_rpmsg_remove(struct rpmsg_device *rpdev)
 
 static struct rpmsg_device_id imx_audio_rpmsg_id_table[] = {
 	{ .name	= "rpmsg-audio-channel" },
+	{ .name = "rpmsg-micfil-channel" },
 	{ },
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/5] ASoC: imx-pcm-rpmsg: Register different platform drivers
  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-29  7:51 ` [PATCH 2/5] ASoC: imx-audio-rpmsg: Create rpmsg channel for MICFIL Chancel Liu
@ 2022-08-29  7:51 ` Chancel Liu
  2022-08-30  6:31   ` 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
  4 siblings, 1 reply; 9+ messages in thread
From: Chancel Liu @ 2022-08-29  7:51 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel,
	robh+dt, devicetree, krzysztof.kozlowski+dt, shengjiu.wang,
	Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev
  Cc: Chancel Liu

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/5] ASoC: fsl_rpmsg: Register different CPU DAI drivers
  2022-08-29  7:51 [PATCH 0/5] Create a new sound card to access MICFIL based on rpmsg channel Chancel Liu
                   ` (2 preceding siblings ...)
  2022-08-29  7:51 ` [PATCH 3/5] ASoC: imx-pcm-rpmsg: Register different platform drivers Chancel Liu
@ 2022-08-29  7:51 ` 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
  4 siblings, 0 replies; 9+ messages in thread
From: Chancel Liu @ 2022-08-29  7:51 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel,
	robh+dt, devicetree, krzysztof.kozlowski+dt, shengjiu.wang,
	Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev
  Cc: Chancel Liu

This patch can register different ASoC CPU DAI drivers. So sound
cards based on different rpmsg channels can link to their respective
CPU DAI drivers.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
 sound/soc/fsl/fsl_rpmsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_rpmsg.c b/sound/soc/fsl/fsl_rpmsg.c
index bf94838bdbef..fde3d5006ce0 100644
--- a/sound/soc/fsl/fsl_rpmsg.c
+++ b/sound/soc/fsl/fsl_rpmsg.c
@@ -235,7 +235,7 @@ static int fsl_rpmsg_probe(struct platform_device *pdev)
 
 	rpmsg->card_pdev = platform_device_register_data(&pdev->dev,
 							 "imx-audio-rpmsg",
-							 PLATFORM_DEVID_NONE,
+							 PLATFORM_DEVID_AUTO,
 							 NULL,
 							 0);
 	if (IS_ERR(rpmsg->card_pdev)) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/5] ASoC: imx-rpmsg: Assign platform driver used by machine driver to link with
  2022-08-29  7:51 [PATCH 0/5] Create a new sound card to access MICFIL based on rpmsg channel Chancel Liu
                   ` (3 preceding siblings ...)
  2022-08-29  7:51 ` [PATCH 4/5] ASoC: fsl_rpmsg: Register different CPU DAI drivers Chancel Liu
@ 2022-08-29  7:51 ` Chancel Liu
  4 siblings, 0 replies; 9+ messages in thread
From: Chancel Liu @ 2022-08-29  7:51 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel,
	robh+dt, devicetree, krzysztof.kozlowski+dt, shengjiu.wang,
	Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev
  Cc: Chancel Liu

Use "fsl,platform" property to indicate ASoC machine driver which
ASoC platform driver 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..c534b638698e 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,platform", &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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH 1/5] ASoC: dt-bindings: fsl_rpmsg: Add a property to assign platform driver name
  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
  1 sibling, 0 replies; 9+ messages in thread
From: S.J. Wang @ 2022-08-30  6:28 UTC (permalink / raw)
  To: Chancel Liu, lgirdwood, broonie, perex, tiwai, alsa-devel,
	linux-kernel, robh+dt, devicetree, krzysztof.kozlowski+dt,
	Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev

> 
> Add a string property to assign ASoC platform driver name. It also represents
> the rpmsg channel this sound card sits on. This property can be omitted if
> there is only one sound card and it sits on "rpmsg-audio-channel".
> 
> Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
> ---
>  .../devicetree/bindings/sound/fsl,rpmsg.yaml  | 34 +++++++++++++++++--
>  1 file changed, 32 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
> b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
> index d370c98a62c7..35e3cb9f768b 100644
> --- a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
> @@ -11,8 +11,11 @@ maintainers:
> 
>  description: |
>    fsl_rpmsg is a virtual audio device. Mapping to real hardware devices
> -  are SAI, DMA controlled by Cortex M core. What we see from Linux
> -  side is a device which provides audio service by rpmsg channel.
> +  are SAI, MICFIL, DMA controlled by Cortex M core. What we see from
> + Linux side is a device which provides audio service by rpmsg channel.
> +  We can create different sound cards which access different hardwares
> + such as SAI, MICFIL, .etc through building rpmsg channels between
> + Cortex-A and Cortex-M.
> 
>  properties:
>    compatible:
> @@ -85,6 +88,14 @@ properties:
>        This is a boolean property. If present, the receiving function
>        will be enabled.
> 
> +  fsl,platform:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description: |
> +      A string property to assign ASoC platform driver name. It also
> +      represents the rpmsg channel this sound card sits on. This property
> +      can be omitted if there is only one sound card and it sits on
> +      "rpmsg-audio-channel".

Please add enum to list supported strings.

Best regards
Wang Shengjiu
> +
>  required:
>    - compatible
>    - model
> @@ -107,3 +118,22 @@ examples:
>                   <&clk IMX8MN_AUDIO_PLL2_OUT>;
>          clock-names = "ipg", "mclk", "dma", "pll8k", "pll11k";
>      };
> +
> +  - |
> +    #include <dt-bindings/clock/imx8mm-clock.h>
> +
> +    rpmsg_micfil: rpmsg_micfil {
> +        compatible = "fsl,imx8mm-rpmsg-audio";
> +        model = "micfil-audio";
> +        fsl,platform = "rpmsg-micfil-channel";
> +        fsl,enable-lpa;
> +        fsl,rpmsg-in;
> +        clocks = <&clk IMX8MM_CLK_PDM_IPG>,
> +                 <&clk IMX8MM_CLK_PDM_ROOT>,
> +                 <&clk IMX8MM_CLK_SDMA3_ROOT>,
> +                 <&clk IMX8MM_AUDIO_PLL1_OUT>,
> +                 <&clk IMX8MM_AUDIO_PLL2_OUT>;
> +        clock-names = "ipg", "mclk", "dma", "pll8k", "pll11k";
> +    };
> +
> +...
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 3/5] ASoC: imx-pcm-rpmsg: Register different platform drivers
  2022-08-29  7:51 ` [PATCH 3/5] ASoC: imx-pcm-rpmsg: Register different platform drivers Chancel Liu
@ 2022-08-30  6:31   ` S.J. Wang
  0 siblings, 0 replies; 9+ messages in thread
From: S.J. Wang @ 2022-08-30  6:31 UTC (permalink / raw)
  To: Chancel Liu, lgirdwood, broonie, perex, tiwai, alsa-devel,
	linux-kernel, robh+dt, devicetree, krzysztof.kozlowski+dt,
	Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev

> 
> 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);

Please use separate commit for this change, I think the fsl_rpmsg_dai. channels_max
Should be updated also?

Best regards
Wang shengjiug

>  		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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/5] ASoC: dt-bindings: fsl_rpmsg: Add a property to assign platform driver name
  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
  1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-30  9:28 UTC (permalink / raw)
  To: Chancel Liu, lgirdwood, broonie, perex, tiwai, alsa-devel,
	linux-kernel, robh+dt, devicetree, krzysztof.kozlowski+dt,
	shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, linuxppc-dev

On 29/08/2022 10:51, Chancel Liu wrote:
> Add a string property to assign ASoC platform driver name. It also
> represents the rpmsg channel this sound card sits on. This property
> can be omitted if there is only one sound card and it sits on
> "rpmsg-audio-channel".
> 
> Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
> ---
>  .../devicetree/bindings/sound/fsl,rpmsg.yaml  | 34 +++++++++++++++++--
>  1 file changed, 32 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
> index d370c98a62c7..35e3cb9f768b 100644
> --- a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
> @@ -11,8 +11,11 @@ maintainers:
>  
>  description: |
>    fsl_rpmsg is a virtual audio device. Mapping to real hardware devices
> -  are SAI, DMA controlled by Cortex M core. What we see from Linux
> -  side is a device which provides audio service by rpmsg channel.
> +  are SAI, MICFIL, DMA controlled by Cortex M core. What we see from
> +  Linux side is a device which provides audio service by rpmsg channel.
> +  We can create different sound cards which access different hardwares
> +  such as SAI, MICFIL, .etc through building rpmsg channels between
> +  Cortex-A and Cortex-M.
>  
>  properties:
>    compatible:
> @@ -85,6 +88,14 @@ properties:
>        This is a boolean property. If present, the receiving function
>        will be enabled.
>  
> +  fsl,platform:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description: |
> +      A string property to assign ASoC platform driver name. 

No, this is not a property of hardware. Naming of some drivers in some
systems does not fit DTS and bindings.

> It also
> +      represents the rpmsg channel this sound card sits on. This property
> +      can be omitted if there is only one sound card and it sits on
> +      "rpmsg-audio-channel".
> +
>  required:
>    - compatible
>    - model
> @@ -107,3 +118,22 @@ examples:
>                   <&clk IMX8MN_AUDIO_PLL2_OUT>;
>          clock-names = "ipg", "mclk", "dma", "pll8k", "pll11k";
>      };
> +
> +  - |
> +    #include <dt-bindings/clock/imx8mm-clock.h>
> +
> +    rpmsg_micfil: rpmsg_micfil {

Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

Also: no underscores in node names.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-08-30  9:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 3/5] ASoC: imx-pcm-rpmsg: Register different platform drivers Chancel Liu
2022-08-30  6:31   ` 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

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).