Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: fsl: expose individual DAIs per ASRC/EASRC conversion pair/context
@ 2026-07-20  9:54 shengjiu.wang
  2026-07-20  9:54 ` [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs shengjiu.wang
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: shengjiu.wang @ 2026-07-20  9:54 UTC (permalink / raw)
  To: lgirdwood, broonie, robh, krzk+dt, conor+dt, Frank.Li, s.hauer,
	kernel, festevam, shawnguo, linux-sound, devicetree, imx,
	linux-arm-kernel, linux-kernel, shengjiu.wang, Xiubo.Lee,
	nicoleotsuka, perex, tiwai, linuxppc-dev
  Cc: Shengjiu Wang

From: Shengjiu Wang <shengjiu.wang@nxp.com>

The i.MX ASRC and EASRC hardware each support multiple independent
conversion pairs or contexts, but both drivers previously registered
only a single DAI with generic stream names. This prevented individual
pairs or contexts from being routed to separate audio paths at the same
time.

This series updates the DT bindings and drivers to expose one DAI per
conversion unit:

- fsl,imx-asrc: add a ports container (port@0/1/2 for pairs A/B/C)
  alongside the deprecated single port property
- fsl,easrc: add a ports container (port@0/1/2/3 for contexts A/B/C/D)
- fsl_asrc: register three DAIs (paira/pairb/pairc); pair A keeps the
  original stream names for backward compatibility
- fsl_easrc: register four DAIs (ctxa/ctxb/ctxc/ctxd); context A keeps
  the original stream names for backward compatibility

Shengjiu Wang (4):
  dt-bindings: sound: fsl,imx-asrc: update port binding to support
    multiple pairs
  dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts
  ASoC: fsl_asrc: expose individual DAIs per conversion pair
  ASoC: fsl_easrc: expose individual DAIs per conversion context

 .../devicetree/bindings/sound/fsl,easrc.yaml  |  79 ++++++++++++
 .../bindings/sound/fsl,imx-asrc.yaml          |  78 ++++++++++++
 sound/soc/fsl/fsl_asrc.c                      |  89 ++++++++++----
 sound/soc/fsl/fsl_easrc.c                     | 112 ++++++++++++++----
 4 files changed, 318 insertions(+), 40 deletions(-)

-- 
2.34.1


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

* [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs
  2026-07-20  9:54 [PATCH 0/4] ASoC: fsl: expose individual DAIs per ASRC/EASRC conversion pair/context shengjiu.wang
@ 2026-07-20  9:54 ` shengjiu.wang
  2026-07-20 10:03   ` sashiko-bot
  2026-07-20 14:28   ` Mark Brown
  2026-07-20  9:54 ` [PATCH 2/4] dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts shengjiu.wang
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: shengjiu.wang @ 2026-07-20  9:54 UTC (permalink / raw)
  To: lgirdwood, broonie, robh, krzk+dt, conor+dt, Frank.Li, s.hauer,
	kernel, festevam, shawnguo, linux-sound, devicetree, imx,
	linux-arm-kernel, linux-kernel, shengjiu.wang, Xiubo.Lee,
	nicoleotsuka, perex, tiwai, linuxppc-dev
  Cc: Shengjiu Wang

From: Shengjiu Wang <shengjiu.wang@nxp.com>

The i.MX ASRC hardware supports up to three conversion pairs (A, B, C).
The existing binding exposed only a single generic audio-graph port,
which cannot represent the individual pair endpoints.

Add a ports container that enumerates three named sub-ports:
  port@0 -- pair A
  port@1 -- pair B
  port@2 -- pair C

Each sub-port references audio-graph-port.yaml as before.

For backwards compatibility, keep the old single port property but mark
it deprecated. A schema constraint (not: required: [port, ports]) ensures
that both forms cannot be used at the same time. Update the examples to
show both the new ports form and the deprecated port form.

No existing upstream DTS file for fsl,imx-asrc uses the previously
documented single 'port' node, so this change does not break any
in-tree device tree.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 .../bindings/sound/fsl,imx-asrc.yaml          | 78 +++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
index 608defc93c1e..18d252722aa8 100644
--- a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
@@ -78,9 +78,29 @@ properties:
   power-domains:
     maxItems: 1
 
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+    properties:
+      port@0:
+        $ref: audio-graph-port.yaml#
+        unevaluatedProperties: false
+        description: port for pair A
+
+      port@1:
+        $ref: audio-graph-port.yaml#
+        unevaluatedProperties: false
+        description: port for pair B
+
+      port@2:
+        $ref: audio-graph-port.yaml#
+        unevaluatedProperties: false
+        description: port for pair C
+
   port:
     $ref: audio-graph-port.yaml#
     unevaluatedProperties: false
+    deprecated: true
+    description: deprecated, use ports instead
 
   fsl,asrc-rate:
     $ref: /schemas/types.yaml#/definitions/uint32
@@ -125,6 +145,10 @@ required:
   - fsl,asrc-width
 
 allOf:
+  - not:
+      required:
+        - port
+        - ports
   - $ref: dai-common.yaml#
   - if:
       properties:
@@ -188,3 +212,57 @@ examples:
             };
        };
     };
+
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/imx6qdl-clock.h>
+    asrc1: asrc@2034000 {
+        compatible = "fsl,imx53-asrc";
+        reg = <0x02034000 0x4000>;
+        interrupts = <0 50 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clks IMX6QDL_CLK_ASRC_IPG>,
+                 <&clks IMX6QDL_CLK_ASRC_MEM>, <&clks 0>,
+                 <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
+                 <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
+                 <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
+                 <&clks IMX6QDL_CLK_ASRC>, <&clks 0>, <&clks 0>,
+                 <&clks IMX6QDL_CLK_SPBA>;
+        clock-names = "mem", "ipg", "asrck_0",
+                "asrck_1", "asrck_2", "asrck_3", "asrck_4",
+                "asrck_5", "asrck_6", "asrck_7", "asrck_8",
+                "asrck_9", "asrck_a", "asrck_b", "asrck_c",
+                "asrck_d", "asrck_e", "asrck_f", "spba";
+        dmas = <&sdma 17 23 1>, <&sdma 18 23 1>, <&sdma 19 23 1>,
+               <&sdma 20 23 1>, <&sdma 21 23 1>, <&sdma 22 23 1>;
+        dma-names = "rxa", "rxb", "rxc",
+                    "txa", "txb", "txc";
+        fsl,asrc-rate = <48000>;
+        fsl,asrc-width = <16>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                playback-only;
+                asrc1_endpoint0: endpoint {
+                    remote-endpoint = <&fe00_ep>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                capture-only;
+                asrc1_endpoint1: endpoint {
+                };
+            };
+
+            port@2 {
+                reg = <2>;
+                capture-only;
+                asrc1_endpoint2: endpoint {
+                };
+            };
+        };
+    };
-- 
2.34.1


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

* [PATCH 2/4] dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts
  2026-07-20  9:54 [PATCH 0/4] ASoC: fsl: expose individual DAIs per ASRC/EASRC conversion pair/context shengjiu.wang
  2026-07-20  9:54 ` [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs shengjiu.wang
@ 2026-07-20  9:54 ` shengjiu.wang
  2026-07-20 10:16   ` sashiko-bot
  2026-07-20  9:54 ` [PATCH 3/4] ASoC: fsl_asrc: expose individual DAIs per conversion pair shengjiu.wang
  2026-07-20  9:54 ` [PATCH 4/4] ASoC: fsl_easrc: expose individual DAIs per conversion context shengjiu.wang
  3 siblings, 1 reply; 10+ messages in thread
From: shengjiu.wang @ 2026-07-20  9:54 UTC (permalink / raw)
  To: lgirdwood, broonie, robh, krzk+dt, conor+dt, Frank.Li, s.hauer,
	kernel, festevam, shawnguo, linux-sound, devicetree, imx,
	linux-arm-kernel, linux-kernel, shengjiu.wang, Xiubo.Lee,
	nicoleotsuka, perex, tiwai, linuxppc-dev
  Cc: Shengjiu Wang

From: Shengjiu Wang <shengjiu.wang@nxp.com>

The i.MX EASRC hardware supports up to four conversion contexts
(A, B, C, D). Add a ports container property to the binding to allow
each context to be represented as an individual audio-graph port:

  port@0 -- context A
  port@1 -- context B
  port@2 -- context C
  port@3 -- context D

Each sub-port references audio-graph-port.yaml and follows the standard
audio-graph binding conventions.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 .../devicetree/bindings/sound/fsl,easrc.yaml  | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/fsl,easrc.yaml b/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
index d5727f8bfb0b..0f579870110d 100644
--- a/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
@@ -55,6 +55,29 @@ properties:
       - const: imx/easrc/easrc-imx8mn.bin
     description: The coefficient table for the filters
 
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+    properties:
+      port@0:
+        $ref: audio-graph-port.yaml#
+        unevaluatedProperties: false
+        description: port for context A
+
+      port@1:
+        $ref: audio-graph-port.yaml#
+        unevaluatedProperties: false
+        description: port for context B
+
+      port@2:
+        $ref: audio-graph-port.yaml#
+        unevaluatedProperties: false
+        description: port for context C
+
+      port@3:
+        $ref: audio-graph-port.yaml#
+        unevaluatedProperties: false
+        description: port for context D
+
   fsl,asrc-rate:
     $ref: /schemas/types.yaml#/definitions/uint32
     minimum: 8000
@@ -107,3 +130,59 @@ examples:
         fsl,asrc-rate = <8000>;
         fsl,asrc-format = <2>;
     };
+
+  - |
+    #include <dt-bindings/clock/imx8mn-clock.h>
+
+    easrc1: easrc@300c0000 {
+        compatible = "fsl,imx8mn-easrc";
+        reg = <0x300c0000 0x10000>;
+        interrupts = <0x0 122 0x4>;
+        clocks = <&clk IMX8MN_CLK_ASRC_ROOT>;
+        clock-names = "mem";
+        dmas = <&sdma2 16 23 0> , <&sdma2 17 23 0>,
+               <&sdma2 18 23 0> , <&sdma2 19 23 0>,
+               <&sdma2 20 23 0> , <&sdma2 21 23 0>,
+               <&sdma2 22 23 0> , <&sdma2 23 23 0>;
+        dma-names = "ctx0_rx", "ctx0_tx",
+                    "ctx1_rx", "ctx1_tx",
+                    "ctx2_rx", "ctx2_tx",
+                    "ctx3_rx", "ctx3_tx";
+        firmware-name = "imx/easrc/easrc-imx8mn.bin";
+        fsl,asrc-rate = <8000>;
+        fsl,asrc-format = <2>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                playback-only;
+                easrc1_endpoint0: endpoint {
+                    remote-endpoint = <&fe00_ep>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                capture-only;
+                easrc1_endpoint1: endpoint {
+                };
+            };
+
+            port@2 {
+                reg = <2>;
+                capture-only;
+                easrc1_endpoint2: endpoint {
+                };
+            };
+
+            port@3 {
+                reg = <3>;
+                capture-only;
+                easrc1_endpoint3: endpoint {
+                };
+            };
+        };
+    };
-- 
2.34.1


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

* [PATCH 3/4] ASoC: fsl_asrc: expose individual DAIs per conversion pair
  2026-07-20  9:54 [PATCH 0/4] ASoC: fsl: expose individual DAIs per ASRC/EASRC conversion pair/context shengjiu.wang
  2026-07-20  9:54 ` [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs shengjiu.wang
  2026-07-20  9:54 ` [PATCH 2/4] dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts shengjiu.wang
@ 2026-07-20  9:54 ` shengjiu.wang
  2026-07-20 10:33   ` sashiko-bot
  2026-07-20  9:54 ` [PATCH 4/4] ASoC: fsl_easrc: expose individual DAIs per conversion context shengjiu.wang
  3 siblings, 1 reply; 10+ messages in thread
From: shengjiu.wang @ 2026-07-20  9:54 UTC (permalink / raw)
  To: lgirdwood, broonie, robh, krzk+dt, conor+dt, Frank.Li, s.hauer,
	kernel, festevam, shawnguo, linux-sound, devicetree, imx,
	linux-arm-kernel, linux-kernel, shengjiu.wang, Xiubo.Lee,
	nicoleotsuka, perex, tiwai, linuxppc-dev
  Cc: Shengjiu Wang

From: Shengjiu Wang <shengjiu.wang@nxp.com>

The i.MX ASRC hardware supports three independent conversion pairs
(A, B, C). The driver previously registered a single DAI with generic
stream names "ASRC-Playback" and "ASRC-Capture", which prevents
individual pairs from being routed to separate audio paths simultaneously.

Replace the single fsl_asrc_dai instance with an array of three DAI
drivers, one per pair:

  paira -- ASRC-Playback / ASRC-Capture (backward compatible)
  pairb -- ASRCB-Playback / ASRCB-Capture
  pairc -- ASRCC-Playback / ASRCC-Capture

Pair A retains the original generic stream names to preserve backward
compatibility with existing machine drivers and board configurations.
Each DAI retains the same channel, rate and format capabilities as the
original. Update the devm_snd_soc_register_component() call to register
all three DAIs.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl_asrc.c | 89 +++++++++++++++++++++++++++++++---------
 1 file changed, 69 insertions(+), 20 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 0b28bcfa47fe..f83d6cdc6412 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -803,27 +803,76 @@ static const struct snd_soc_dai_ops fsl_asrc_dai_ops = {
 				 SNDRV_PCM_FMTBIT_S16_LE | \
 				 SNDRV_PCM_FMTBIT_S24_3LE)
 
-static struct snd_soc_dai_driver fsl_asrc_dai = {
-	.playback = {
-		.stream_name = "ASRC-Playback",
-		.channels_min = 1,
-		.channels_max = 10,
-		.rate_min = 5512,
-		.rate_max = 192000,
-		.rates = SNDRV_PCM_RATE_KNOT,
-		.formats = FSL_ASRC_FORMATS |
-			   SNDRV_PCM_FMTBIT_S8,
+static struct snd_soc_dai_driver fsl_asrc_dai[] = {
+	{
+		.name = "paira",
+		.playback = {
+			.stream_name = "ASRC-Playback",
+			.channels_min = 1,
+			.channels_max = 10,
+			.rate_min = 5512,
+			.rate_max = 192000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_ASRC_FORMATS |
+				   SNDRV_PCM_FMTBIT_S8,
+		},
+		.capture = {
+			.stream_name = "ASRC-Capture",
+			.channels_min = 1,
+			.channels_max = 10,
+			.rate_min = 5512,
+			.rate_max = 192000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_ASRC_FORMATS,
+		},
+		.ops = &fsl_asrc_dai_ops,
+	},
+	{
+		.name = "pairb",
+		.playback = {
+			.stream_name = "ASRCB-Playback",
+			.channels_min = 1,
+			.channels_max = 10,
+			.rate_min = 5512,
+			.rate_max = 192000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_ASRC_FORMATS |
+				   SNDRV_PCM_FMTBIT_S8,
+		},
+		.capture = {
+			.stream_name = "ASRCB-Capture",
+			.channels_min = 1,
+			.channels_max = 10,
+			.rate_min = 5512,
+			.rate_max = 192000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_ASRC_FORMATS,
+		},
+		.ops = &fsl_asrc_dai_ops,
 	},
-	.capture = {
-		.stream_name = "ASRC-Capture",
-		.channels_min = 1,
-		.channels_max = 10,
-		.rate_min = 5512,
-		.rate_max = 192000,
-		.rates = SNDRV_PCM_RATE_KNOT,
-		.formats = FSL_ASRC_FORMATS,
+	{
+		.name = "pairc",
+		.playback = {
+			.stream_name = "ASRCC-Playback",
+			.channels_min = 1,
+			.channels_max = 10,
+			.rate_min = 5512,
+			.rate_max = 192000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_ASRC_FORMATS |
+				   SNDRV_PCM_FMTBIT_S8,
+		},
+		.capture = {
+			.stream_name = "ASRCC-Capture",
+			.channels_min = 1,
+			.channels_max = 10,
+			.rate_min = 5512,
+			.rate_max = 192000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_ASRC_FORMATS,
+		},
+		.ops = &fsl_asrc_dai_ops,
 	},
-	.ops = &fsl_asrc_dai_ops,
 };
 
 static bool fsl_asrc_readable_reg(struct device *dev, unsigned int reg)
@@ -1404,7 +1453,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 		goto err_pm_get_sync;
 
 	ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
-					      &fsl_asrc_dai, 1);
+					      fsl_asrc_dai, ARRAY_SIZE(fsl_asrc_dai));
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register ASoC DAI\n");
 		goto err_pm_get_sync;
-- 
2.34.1


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

* [PATCH 4/4] ASoC: fsl_easrc: expose individual DAIs per conversion context
  2026-07-20  9:54 [PATCH 0/4] ASoC: fsl: expose individual DAIs per ASRC/EASRC conversion pair/context shengjiu.wang
                   ` (2 preceding siblings ...)
  2026-07-20  9:54 ` [PATCH 3/4] ASoC: fsl_asrc: expose individual DAIs per conversion pair shengjiu.wang
@ 2026-07-20  9:54 ` shengjiu.wang
  2026-07-20 10:43   ` sashiko-bot
  3 siblings, 1 reply; 10+ messages in thread
From: shengjiu.wang @ 2026-07-20  9:54 UTC (permalink / raw)
  To: lgirdwood, broonie, robh, krzk+dt, conor+dt, Frank.Li, s.hauer,
	kernel, festevam, shawnguo, linux-sound, devicetree, imx,
	linux-arm-kernel, linux-kernel, shengjiu.wang, Xiubo.Lee,
	nicoleotsuka, perex, tiwai, linuxppc-dev
  Cc: Shengjiu Wang

From: Shengjiu Wang <shengjiu.wang@nxp.com>

The i.MX EASRC hardware supports four independent conversion contexts
(A, B, C, D). The driver previously registered a single DAI with generic
stream names "ASRC-Playback" and "ASRC-Capture", which prevents
individual contexts from being routed to separate audio paths
simultaneously.

Replace the single fsl_easrc_dai instance with an array of four DAI
drivers, one per context:

  ctxa -- ASRC-Playback / ASRC-Capture (backward compatible)
  ctxb -- ASRCB-Playback / ASRCB-Capture
  ctxc -- ASRCC-Playback / ASRCC-Capture
  ctxd -- ASRCD-Playback / ASRCD-Capture

Context A retains the original generic stream names to preserve backward
compatibility with existing machine drivers and board configurations.
Each DAI retains the same channel, rate and format capabilities as the
original, including IEC958 subframe support on the capture side. Update
the devm_snd_soc_register_component() call to register all four DAIs.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl_easrc.c | 112 +++++++++++++++++++++++++++++++-------
 1 file changed, 92 insertions(+), 20 deletions(-)

diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
index edfd943197a0..3c5303d9b9cf 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -1600,27 +1600,99 @@ static const struct snd_soc_dai_ops fsl_easrc_dai_ops = {
 	.hw_free	= fsl_easrc_hw_free,
 };
 
-static struct snd_soc_dai_driver fsl_easrc_dai = {
-	.playback = {
-		.stream_name = "ASRC-Playback",
-		.channels_min = 1,
-		.channels_max = 32,
-		.rate_min = 8000,
-		.rate_max = 768000,
-		.rates = SNDRV_PCM_RATE_KNOT,
-		.formats = FSL_EASRC_FORMATS,
+static struct snd_soc_dai_driver fsl_easrc_dai[] = {
+	{
+		.name = "ctxa",
+		.playback = {
+			.stream_name = "ASRC-Playback",
+			.channels_min = 1,
+			.channels_max = 32,
+			.rate_min = 8000,
+			.rate_max = 768000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_EASRC_FORMATS,
+		},
+		.capture = {
+			.stream_name = "ASRC-Capture",
+			.channels_min = 1,
+			.channels_max = 32,
+			.rate_min = 8000,
+			.rate_max = 768000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_EASRC_FORMATS |
+				   SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE,
+		},
+		.ops = &fsl_easrc_dai_ops,
 	},
-	.capture = {
-		.stream_name = "ASRC-Capture",
-		.channels_min = 1,
-		.channels_max = 32,
-		.rate_min = 8000,
-		.rate_max = 768000,
-		.rates = SNDRV_PCM_RATE_KNOT,
-		.formats = FSL_EASRC_FORMATS |
-			   SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE,
+	{
+		.name = "ctxb",
+		.playback = {
+			.stream_name = "ASRCB-Playback",
+			.channels_min = 1,
+			.channels_max = 32,
+			.rate_min = 8000,
+			.rate_max = 768000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_EASRC_FORMATS,
+		},
+		.capture = {
+			.stream_name = "ASRCB-Capture",
+			.channels_min = 1,
+			.channels_max = 32,
+			.rate_min = 8000,
+			.rate_max = 768000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_EASRC_FORMATS |
+				   SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE,
+		},
+		.ops = &fsl_easrc_dai_ops,
+	},
+	{
+		.name = "ctxc",
+		.playback = {
+			.stream_name = "ASRCC-Playback",
+			.channels_min = 1,
+			.channels_max = 32,
+			.rate_min = 8000,
+			.rate_max = 768000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_EASRC_FORMATS,
+		},
+		.capture = {
+			.stream_name = "ASRCC-Capture",
+			.channels_min = 1,
+			.channels_max = 32,
+			.rate_min = 8000,
+			.rate_max = 768000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_EASRC_FORMATS |
+				   SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE,
+		},
+		.ops = &fsl_easrc_dai_ops,
+	},
+	{
+		.name = "ctxd",
+		.playback = {
+			.stream_name = "ASRCD-Playback",
+			.channels_min = 1,
+			.channels_max = 32,
+			.rate_min = 8000,
+			.rate_max = 768000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_EASRC_FORMATS,
+		},
+		.capture = {
+			.stream_name = "ASRCD-Capture",
+			.channels_min = 1,
+			.channels_max = 32,
+			.rate_min = 8000,
+			.rate_max = 768000,
+			.rates = SNDRV_PCM_RATE_KNOT,
+			.formats = FSL_EASRC_FORMATS |
+				   SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE,
+		},
+		.ops = &fsl_easrc_dai_ops,
 	},
-	.ops = &fsl_easrc_dai_ops,
 };
 
 static const struct snd_soc_component_driver fsl_easrc_component = {
@@ -2245,7 +2317,7 @@ static int fsl_easrc_probe(struct platform_device *pdev)
 	regcache_cache_only(easrc->regmap, true);
 
 	ret = devm_snd_soc_register_component(dev, &fsl_easrc_component,
-					      &fsl_easrc_dai, 1);
+					      fsl_easrc_dai, ARRAY_SIZE(fsl_easrc_dai));
 	if (ret) {
 		dev_err(dev, "failed to register ASoC DAI\n");
 		goto err_pm_disable;
-- 
2.34.1


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

* Re: [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs
  2026-07-20  9:54 ` [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs shengjiu.wang
@ 2026-07-20 10:03   ` sashiko-bot
  2026-07-20 14:28   ` Mark Brown
  1 sibling, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-20 10:03 UTC (permalink / raw)
  To: shengjiu.wang; +Cc: devicetree, conor+dt, imx, robh, Frank.Li

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly added example causes `make dt_binding_check` to fail due to a device tree node merge conflict.
--

--- Patch [1]: [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs ---
commit 45674653b1eb8f9efa969b217b62dc494801eaf3
Author: Shengjiu Wang <shengjiu.wang@nxp.com>

dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs

The i.MX ASRC hardware supports up to three conversion pairs. This commit
updates the binding to add a ports container that enumerates three named
sub-ports, while deprecating the old single port property and ensuring
both cannot be used simultaneously.

> diff --git a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
> index 608defc93c1e9..18d252722aa8e 100644
> --- a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml

[ ... ]

> @@ -188,3 +212,57 @@ examples:
>              };
>         };
>      };
> +
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/clock/imx6qdl-clock.h>
> +    asrc1: asrc@2034000 {

[Severity: Low]
Does this identical node name and unit address cause a node merge conflict
during make dt_binding_check?

The dt-extract-example tool processes the examples array by concatenating all
items into a single device tree root node. Because this new example uses the
exact same node name and unit address (asrc@2034000) as the preceding example,
the Device Tree Compiler merges them together.

The resulting merged asrc@2034000 node ends up containing both the port
property from the first example and the ports property from this second
example. 

This violates the newly added schema constraint preventing port and ports
from both being required at the same time, which causes validation to fail.

Could a different unit address be used for this second example to prevent
the nodes from being merged?

> +        compatible = "fsl,imx53-asrc";
> +        reg = <0x02034000 0x4000>;
> +        interrupts = <0 50 IRQ_TYPE_LEVEL_HIGH>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720095450.1618747-1-shengjiu.wang@oss.nxp.com?part=1

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

* Re: [PATCH 2/4] dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts
  2026-07-20  9:54 ` [PATCH 2/4] dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts shengjiu.wang
@ 2026-07-20 10:16   ` sashiko-bot
  0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-20 10:16 UTC (permalink / raw)
  To: shengjiu.wang; +Cc: conor+dt, Frank.Li, devicetree, imx, robh

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The schema fails to restrict the `ports` container to the 4 supported contexts (ports 0-3), allowing invalid extraneous ports to silently pass validation.
--

--- Patch [2]: [PATCH 2/4] dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts ---
commit 0461b121d300fd40233634f4b977c32906d647ce
Author: Shengjiu Wang <shengjiu.wang@nxp.com>

dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts

The i.MX EASRC hardware supports up to four conversion contexts
(A, B, C, D). Add a ports container property to the binding to allow
each context to be represented as an individual audio-graph port.

> diff --git a/Documentation/devicetree/bindings/sound/fsl,easrc.yaml b/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
> index d5727f8bfb0b5..0f579870110d9 100644
> --- a/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
> @@ -55,6 +55,29 @@ properties:
>        - const: imx/easrc/easrc-imx8mn.bin
>      description: The coefficient table for the filters
>  
> +  ports:
> +    $ref: /schemas/graph.yaml#/properties/ports
> +    properties:
> +      port@0:
> +        $ref: audio-graph-port.yaml#
> +        unevaluatedProperties: false
> +        description: port for context A

[Severity: Low]
Is this ports container missing a constraint to reject unsupported unit
addresses?

Since the inherited graph.yaml schema permits any port@.*, a device tree
defining port@4 or higher will currently pass dt-validate without an error,
even though the hardware only supports 4 contexts. 

Would adding patternProperties: "^port@[0-3]$" or unevaluatedProperties: false
to the ports block help catch invalid device tree configurations?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720095450.1618747-1-shengjiu.wang@oss.nxp.com?part=2

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

* Re: [PATCH 3/4] ASoC: fsl_asrc: expose individual DAIs per conversion pair
  2026-07-20  9:54 ` [PATCH 3/4] ASoC: fsl_asrc: expose individual DAIs per conversion pair shengjiu.wang
@ 2026-07-20 10:33   ` sashiko-bot
  0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-20 10:33 UTC (permalink / raw)
  To: shengjiu.wang; +Cc: conor+dt, Frank.Li, imx, devicetree, robh

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The newly registered DAIs (`paira`, `pairb`, `pairc`) share the exact same `dma_params_tx` and `dma_params_rx` structures, causing a data race and potential DMA misconfiguration when multiple streams are configured concurrently.
--

--- Patch [3]: [PATCH 3/4] ASoC: fsl_asrc: expose individual DAIs per conversion pair ---
commit 71178f6edf2667b8ee88b95ef47b739e170cca4b
Author: Shengjiu Wang <shengjiu.wang@nxp.com>

ASoC: fsl_asrc: expose individual DAIs per conversion pair

The i.MX ASRC hardware supports three independent conversion pairs
(A, B, C). This commit replaces the single fsl_asrc_dai instance
with an array of three DAI drivers, one per pair, allowing them
to be routed to separate audio paths simultaneously.

> diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> index 0b28bcfa47fed..f83d6cdc6412d 100644
> --- a/sound/soc/fsl/fsl_asrc.c
> +++ b/sound/soc/fsl/fsl_asrc.c

[ ... ]

> @@ -1404,7 +1453,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
>  		goto err_pm_get_sync;
>  
>  	ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
> -					      &fsl_asrc_dai, 1);
> +					      fsl_asrc_dai, ARRAY_SIZE(fsl_asrc_dai));

[Severity: High]
Since this registers multiple DAIs to enable concurrent stream access, can this
cause a data race with the shared DMA parameters?

In fsl_asrc_dai_probe(), all three DAIs are assigned pointers to the exact same
shared DMA parameter structures:

	snd_soc_dai_init_dma_data(dai, &asrc->dma_params_tx,
				  &asrc->dma_params_rx);

When multiple streams are configured concurrently, they will race to overwrite
these shared parameters without locking.

For example, in fsl_asrc_dma_hw_params():

	dma_params_fe = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
	dma_params_fe->addr = asrc->paddr + asrc->get_fifo_addr(!dir, index);
	dma_params_fe->maxburst = dma_params_be->maxburst;

Could this concurrent mutation cause DMA channels to be programmed with incorrect
FIFO addresses or maxburst values, resulting in audio cross-talk or DMA engine
errors?

>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to register ASoC DAI\n");
>  		goto err_pm_get_sync;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720095450.1618747-1-shengjiu.wang@oss.nxp.com?part=3

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

* Re: [PATCH 4/4] ASoC: fsl_easrc: expose individual DAIs per conversion context
  2026-07-20  9:54 ` [PATCH 4/4] ASoC: fsl_easrc: expose individual DAIs per conversion context shengjiu.wang
@ 2026-07-20 10:43   ` sashiko-bot
  0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-20 10:43 UTC (permalink / raw)
  To: shengjiu.wang; +Cc: imx, devicetree, Frank.Li, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Concurrent streams will cause a data race on the shared `dma_params_tx` and `dma_params_rx` structures, leading to incorrect DMA FIFO address configuration and state corruption.
--

--- Patch [4]: [PATCH 4/4] ASoC: fsl_easrc: expose individual DAIs per conversion context ---
commit 8f522766ccdfc101a1c60ab6f34e2623d03f39d0
Author: Shengjiu Wang <shengjiu.wang@nxp.com>

ASoC: fsl_easrc: expose individual DAIs per conversion context

The i.MX EASRC hardware supports four independent conversion contexts
(A, B, C, D). The driver previously registered a single DAI with generic
stream names "ASRC-Playback" and "ASRC-Capture", which prevents
individual contexts from being routed to separate audio paths
simultaneously. This commit replaces the single fsl_easrc_dai instance 
with an array of four DAI drivers.

> diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
> index 15a3424967601..dd0c3046a0075 100644
> --- a/sound/soc/fsl/fsl_easrc.c
> +++ b/sound/soc/fsl/fsl_easrc.c

[ ... ]

> @@ -2245,7 +2317,7 @@ static int fsl_easrc_probe(struct platform_device *pdev)
>  	regcache_cache_only(easrc->regmap, true);
>  
>  	ret = devm_snd_soc_register_component(dev, &fsl_easrc_component,
> -					      &fsl_easrc_dai, 1);
> +					      fsl_easrc_dai, ARRAY_SIZE(fsl_easrc_dai));

[Severity: High]
When multiple DAIs are registered and active concurrently, can this cause a
data race on the shared DMA parameters?

Since all four DAIs share the same operations, fsl_easrc_dai_probe()
initializes them all with the exact same pointers:

fsl_easrc_dai_probe() {
    ...
    snd_soc_dai_init_dma_data(cpu_dai,
                              &easrc->dma_params_tx,
                              &easrc->dma_params_rx);
    ...
}

If an application opens multiple PCM devices simultaneously, won't their
concurrent hardware parameters operations modify the shared parameters
without locking?

fsl_asrc_dma_hw_params() {
    ...
    dma_params_fe = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
    dma_params_fe->addr = asrc->paddr + asrc->get_fifo_addr(!dir, index);
    dma_params_fe->maxburst = dma_params_be->maxburst;
    ...
}

Could this lead to incorrect DMA FIFO address configuration and state corruption
across the different DAI contexts?

>  	if (ret) {
>  		dev_err(dev, "failed to register ASoC DAI\n");
>  		goto err_pm_disable;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720095450.1618747-1-shengjiu.wang@oss.nxp.com?part=4

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

* Re: [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs
  2026-07-20  9:54 ` [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs shengjiu.wang
  2026-07-20 10:03   ` sashiko-bot
@ 2026-07-20 14:28   ` Mark Brown
  1 sibling, 0 replies; 10+ messages in thread
From: Mark Brown @ 2026-07-20 14:28 UTC (permalink / raw)
  To: shengjiu.wang
  Cc: lgirdwood, robh, krzk+dt, conor+dt, Frank.Li, s.hauer, kernel,
	festevam, shawnguo, linux-sound, devicetree, imx,
	linux-arm-kernel, linux-kernel, shengjiu.wang, Xiubo.Lee,
	nicoleotsuka, perex, tiwai, linuxppc-dev, Shengjiu Wang

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

On Mon, Jul 20, 2026 at 05:54:47PM +0800, shengjiu.wang@oss.nxp.com wrote:
> From: Shengjiu Wang <shengjiu.wang@nxp.com>
> 
> The i.MX ASRC hardware supports up to three conversion pairs (A, B, C).
> The existing binding exposed only a single generic audio-graph port,
> which cannot represent the individual pair endpoints.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2026-07-20 14:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20  9:54 [PATCH 0/4] ASoC: fsl: expose individual DAIs per ASRC/EASRC conversion pair/context shengjiu.wang
2026-07-20  9:54 ` [PATCH 1/4] dt-bindings: sound: fsl,imx-asrc: update port binding to support multiple pairs shengjiu.wang
2026-07-20 10:03   ` sashiko-bot
2026-07-20 14:28   ` Mark Brown
2026-07-20  9:54 ` [PATCH 2/4] dt-bindings: sound: fsl,easrc: add ports binding for multiple contexts shengjiu.wang
2026-07-20 10:16   ` sashiko-bot
2026-07-20  9:54 ` [PATCH 3/4] ASoC: fsl_asrc: expose individual DAIs per conversion pair shengjiu.wang
2026-07-20 10:33   ` sashiko-bot
2026-07-20  9:54 ` [PATCH 4/4] ASoC: fsl_easrc: expose individual DAIs per conversion context shengjiu.wang
2026-07-20 10:43   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox