diff mbox series

[1/5] ASoC: dt-bindings: fsl_rpmsg: Add a property to assign platform driver name

Message ID 20220829075144.2405000-2-chancel.liu@nxp.com
State New
Headers show
Series Create a new sound card to access MICFIL based on rpmsg channel | expand

Commit Message

Chancel Liu Aug. 29, 2022, 7:51 a.m. UTC
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(-)

Comments

Shengjiu Wang Aug. 30, 2022, 6:28 a.m. UTC | #1
> 
> 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
Krzysztof Kozlowski Aug. 30, 2022, 9:28 a.m. UTC | #2
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
diff mbox series

Patch

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";
+    };
+
+...