* [PATCH v2 0/5] ASoC: fsl_asrc/fsl_easrc: expose per-pair/context DAIs and fix DMA race
@ 2026-07-23 2:23 shengjiu.wang
2026-07-23 2:23 ` [PATCH v2 1/5] ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths shengjiu.wang
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: shengjiu.wang @ 2026-07-23 2:23 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>
This series extends the i.MX ASRC and EASRC drivers to expose one DAI
per hardware conversion pair/context, allowing multiple independent
conversion paths to be active simultaneously.
Patches 1-2 update the DT bindings to add a ports container so each
conversion path can be wired independently in the audio graph. The old
single port property is kept but marked deprecated.
Patch 3 moves dma_params into struct fsl_asrc_pair so each pair owns its
own copy, and registers it with the cpu DAI using per-direction setters in
fsl_asrc_dma_startup(). This removes the per-DAI probe callbacks from
fsl_asrc.c and fsl_easrc.c, which are no longer needed.
Patches 4-5 expose the individual DAIs: fsl_asrc registers three DAIs
(asrc-0/1/2) and fsl_easrc registers four (easrc-0/1/2/3). The first
DAI in each driver retains the original generic stream names for
backward compatibility with existing machine drivers.
Changes since v1:
- Patch 3 is new: moves dma_params into struct fsl_asrc_pair (one per pair)
- Per-direction snd_soc_dai_dma_data_set_playback/capture used instead
of snd_soc_dai_init_dma_data to avoid clearing the other direction
- dma_params_tx/rx removed from struct fsl_asrc; single dma_params per
pair suffices because each pair is unidirectional
- per-DAI probe callbacks removed (startup now sets dma_data)
- Cover letter and commit messages updated to reflect the above
- DAI names changed: paira/pairb/pairc -> asrc-0/asrc-1/asrc-2,
ctxa/ctxb/ctxc/ctxd -> easrc-0/easrc-1/easrc-2/easrc-3; use index-based
naming consistent with port@N in the DT binding
- Stream names changed: ASRCB/ASRCC/ASRCD -> ASRC1/ASRC2/ASRC3; align with the
index-based DAI names above
- Binding port descriptions updated: pair A/B/C -> conversion path 0/1/2;
hardware-agnostic wording to match port@N numbering
Shengjiu Wang (5):
ASoC: dt-bindings: fsl,imx-asrc: update port binding to support
multiple paths
ASoC: dt-bindings: fsl,easrc: add ports binding for multiple
conversion paths
ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct
ASoC: fsl_asrc: expose individual DAIs per conversion path
ASoC: fsl_easrc: expose individual DAIs per conversion path
.../devicetree/bindings/sound/fsl,easrc.yaml | 68 ++++++++++
.../bindings/sound/fsl,imx-asrc.yaml | 70 ++++++++++
sound/soc/fsl/fsl_asrc.c | 100 +++++++++-----
sound/soc/fsl/fsl_asrc_common.h | 7 +-
sound/soc/fsl/fsl_asrc_dma.c | 14 ++
sound/soc/fsl/fsl_easrc.c | 123 +++++++++++++-----
6 files changed, 316 insertions(+), 66 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/5] ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths
2026-07-23 2:23 [PATCH v2 0/5] ASoC: fsl_asrc/fsl_easrc: expose per-pair/context DAIs and fix DMA race shengjiu.wang
@ 2026-07-23 2:23 ` shengjiu.wang
2026-07-23 2:29 ` sashiko-bot
2026-07-23 2:23 ` [PATCH v2 2/5] ASoC: dt-bindings: fsl,easrc: add ports binding for multiple conversion paths shengjiu.wang
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: shengjiu.wang @ 2026-07-23 2:23 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 independent conversion paths when multiple pairs
are in use simultaneously.
Add a ports container that enumerates up to three sub-ports, each
representing an independent conversion path:
port@0 -- conversion path 0
port@1 -- conversion path 1
port@2 -- conversion path 2
Each sub-port references audio-graph-port.yaml as before. Hardware pairs
are allocated dynamically at stream open time; each active stream
direction (playback or capture) on a port consumes one hardware pair.
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 | 70 +++++++++++++++++++
1 file changed, 70 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
index 608defc93c1e..ecb0aacba456 100644
--- a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
@@ -78,9 +78,19 @@ properties:
power-domains:
maxItems: 1
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+ patternProperties:
+ "^port@[0-2]$":
+ $ref: audio-graph-port.yaml#
+ unevaluatedProperties: false
+ description: port for an independent conversion path
+
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 +135,10 @@ required:
- fsl,asrc-width
allOf:
+ - not:
+ required:
+ - port
+ - ports
- $ref: dai-common.yaml#
- if:
properties:
@@ -188,3 +202,59 @@ examples:
};
};
};
+
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/imx6qdl-clock.h>
+ asrc1: asrc@2034000 {
+ compatible = "fsl,imx53-asrc";
+ reg = <0x02034000 0x4000>;
+ interrupts = <GIC_SPI 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 {
+ remote-endpoint = <&fe01_ep>;
+ };
+ };
+
+ port@2 {
+ reg = <2>;
+ capture-only;
+ asrc1_endpoint2: endpoint {
+ remote-endpoint = <&fe02_ep>;
+ };
+ };
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 2/5] ASoC: dt-bindings: fsl,easrc: add ports binding for multiple conversion paths
2026-07-23 2:23 [PATCH v2 0/5] ASoC: fsl_asrc/fsl_easrc: expose per-pair/context DAIs and fix DMA race shengjiu.wang
2026-07-23 2:23 ` [PATCH v2 1/5] ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths shengjiu.wang
@ 2026-07-23 2:23 ` shengjiu.wang
2026-07-23 4:34 ` Frank Li
2026-07-23 2:23 ` [PATCH v2 3/5] ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct shengjiu.wang
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: shengjiu.wang @ 2026-07-23 2:23 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 independent conversion path to be represented as an individual
audio-graph port:
port@0 -- conversion path 0
port@1 -- conversion path 1
port@2 -- conversion path 2
port@3 -- conversion path 3
Each sub-port references audio-graph-port.yaml and follows the standard
audio-graph binding conventions. Contexts are allocated dynamically at
stream open time; each active stream direction (playback or capture) on
a port consumes one hardware context.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
.../devicetree/bindings/sound/fsl,easrc.yaml | 68 +++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/fsl,easrc.yaml b/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
index d5727f8bfb0b..e6d7cae5983d 100644
--- a/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
@@ -55,6 +55,14 @@ properties:
- const: imx/easrc/easrc-imx8mn.bin
description: The coefficient table for the filters
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+ patternProperties:
+ "^port@[0-3]$":
+ $ref: audio-graph-port.yaml#
+ unevaluatedProperties: false
+ description: port for an independent conversion path
+
fsl,asrc-rate:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 8000
@@ -107,3 +115,63 @@ examples:
fsl,asrc-rate = <8000>;
fsl,asrc-format = <2>;
};
+
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/imx8mn-clock.h>
+
+ easrc1: easrc@300c0000 {
+ compatible = "fsl,imx8mn-easrc";
+ reg = <0x300c0000 0x10000>;
+ interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+ 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>;
+ playback-only;
+ easrc1_endpoint1: endpoint {
+ remote-endpoint = <&fe01_ep>;
+ };
+ };
+
+ port@2 {
+ reg = <2>;
+ capture-only;
+ easrc1_endpoint2: endpoint {
+ remote-endpoint = <&fe02_ep>;
+ };
+ };
+
+ port@3 {
+ reg = <3>;
+ capture-only;
+ easrc1_endpoint3: endpoint {
+ remote-endpoint = <&fe03_ep>;
+ };
+ };
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 3/5] ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct
2026-07-23 2:23 [PATCH v2 0/5] ASoC: fsl_asrc/fsl_easrc: expose per-pair/context DAIs and fix DMA race shengjiu.wang
2026-07-23 2:23 ` [PATCH v2 1/5] ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths shengjiu.wang
2026-07-23 2:23 ` [PATCH v2 2/5] ASoC: dt-bindings: fsl,easrc: add ports binding for multiple conversion paths shengjiu.wang
@ 2026-07-23 2:23 ` shengjiu.wang
2026-07-23 2:41 ` sashiko-bot
2026-07-23 2:23 ` [PATCH v2 4/5] ASoC: fsl_asrc: expose individual DAIs per conversion path shengjiu.wang
2026-07-23 2:23 ` [PATCH v2 5/5] ASoC: fsl_easrc: " shengjiu.wang
4 siblings, 1 reply; 10+ messages in thread
From: shengjiu.wang @ 2026-07-23 2:23 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 shared dma_params_tx/rx fields in struct fsl_asrc were a single
instance written by every concurrent fsl_asrc_dma_hw_params() call.
With multiple DAIs registered (one per pair/context), parallel stream
open+hw_params races would corrupt addr and maxburst for all active
streams.
Fix by moving dma_params into struct fsl_asrc_pair so each pair owns
its own copy. Initialise them in fsl_asrc_dma_startup() where
the pair is allocated, which makes the per-DAI probe callbacks in
fsl_asrc.c and fsl_easrc.c redundant; remove those as well.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
sound/soc/fsl/fsl_asrc.c | 11 -----------
sound/soc/fsl/fsl_asrc_common.h | 7 +++----
sound/soc/fsl/fsl_asrc_dma.c | 14 ++++++++++++++
sound/soc/fsl/fsl_easrc.c | 11 -----------
4 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 0b28bcfa47fe..986a2e26819a 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -781,18 +781,7 @@ static int fsl_asrc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
return 0;
}
-static int fsl_asrc_dai_probe(struct snd_soc_dai *dai)
-{
- struct fsl_asrc *asrc = snd_soc_dai_get_drvdata(dai);
-
- snd_soc_dai_init_dma_data(dai, &asrc->dma_params_tx,
- &asrc->dma_params_rx);
-
- return 0;
-}
-
static const struct snd_soc_dai_ops fsl_asrc_dai_ops = {
- .probe = fsl_asrc_dai_probe,
.startup = fsl_asrc_dai_startup,
.hw_params = fsl_asrc_dai_hw_params,
.hw_free = fsl_asrc_dai_hw_free,
diff --git a/sound/soc/fsl/fsl_asrc_common.h b/sound/soc/fsl/fsl_asrc_common.h
index c8a1a2b5915d..4e6b00cb5d63 100644
--- a/sound/soc/fsl/fsl_asrc_common.h
+++ b/sound/soc/fsl/fsl_asrc_common.h
@@ -53,6 +53,7 @@ struct fsl_asrc_m2m_cap {
* @dma_data: private dma data
* @pos: hardware pointer position
* @req_dma_chan: flag to release dev_to_dev chan
+ * @dma_params: DMA parameters for transmit/receive channel
* @private: pair private area
* @complete: dma task complete
* @sample_format: format of m2m
@@ -76,6 +77,8 @@ struct fsl_asrc_pair {
unsigned int pos;
bool req_dma_chan;
+ struct snd_dmaengine_dai_dma_data dma_params;
+
void *private;
/* used for m2m */
@@ -92,8 +95,6 @@ struct fsl_asrc_pair {
/**
* fsl_asrc: ASRC common data
*
- * @dma_params_rx: DMA parameters for receive channel
- * @dma_params_tx: DMA parameters for transmit channel
* @pdev: platform device pointer
* @regmap: regmap handler
* @paddr: physical address to the base address of registers
@@ -128,8 +129,6 @@ struct fsl_asrc_pair {
* @private: private data structure
*/
struct fsl_asrc {
- struct snd_dmaengine_dai_dma_data dma_params_rx;
- struct snd_dmaengine_dai_dma_data dma_params_tx;
struct platform_device *pdev;
struct regmap *regmap;
unsigned long paddr;
diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index 38f2b7c63133..64d66420e7ad 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -390,6 +390,20 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component,
runtime->private_data = pair;
+ /*
+ * Point the cpu DAI dma_data at the per-pair params so that
+ * concurrent hw_params calls on different pairs each write to
+ * their own struct and do not race on addr/maxburst. Use the
+ * per-direction setters so that a concurrent open of the other
+ * direction on the same DAI does not NULL out its pointer.
+ */
+ if (tx)
+ snd_soc_dai_dma_data_set_playback(snd_soc_rtd_to_cpu(rtd, 0),
+ &pair->dma_params);
+ else
+ snd_soc_dai_dma_data_set_capture(snd_soc_rtd_to_cpu(rtd, 0),
+ &pair->dma_params);
+
/* Request a dummy pair, which will be released later.
* Request pair function needs channel num as input, for this
* dummy pair, we just request "1" channel temporarily.
diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
index edfd943197a0..e68f6cbdd653 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -1582,18 +1582,7 @@ static int fsl_easrc_hw_free(struct snd_pcm_substream *substream,
return 0;
}
-static int fsl_easrc_dai_probe(struct snd_soc_dai *cpu_dai)
-{
- struct fsl_asrc *easrc = dev_get_drvdata(cpu_dai->dev);
-
- snd_soc_dai_init_dma_data(cpu_dai,
- &easrc->dma_params_tx,
- &easrc->dma_params_rx);
- return 0;
-}
-
static const struct snd_soc_dai_ops fsl_easrc_dai_ops = {
- .probe = fsl_easrc_dai_probe,
.startup = fsl_easrc_startup,
.trigger = fsl_easrc_trigger,
.hw_params = fsl_easrc_hw_params,
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 4/5] ASoC: fsl_asrc: expose individual DAIs per conversion path
2026-07-23 2:23 [PATCH v2 0/5] ASoC: fsl_asrc/fsl_easrc: expose per-pair/context DAIs and fix DMA race shengjiu.wang
` (2 preceding siblings ...)
2026-07-23 2:23 ` [PATCH v2 3/5] ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct shengjiu.wang
@ 2026-07-23 2:23 ` shengjiu.wang
2026-07-23 2:45 ` sashiko-bot
2026-07-23 2:23 ` [PATCH v2 5/5] ASoC: fsl_easrc: " shengjiu.wang
4 siblings, 1 reply; 10+ messages in thread
From: shengjiu.wang @ 2026-07-23 2:23 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
multiple independent conversion paths from being used simultaneously.
Replace the single fsl_asrc_dai instance with an array of three DAI
drivers to allow up to three independent conversion paths to be active
at the same time:
asrc-0 -- ASRC-Playback / ASRC-Capture (backward compatible)
asrc-1 -- ASRC1-Playback / ASRC1-Capture
asrc-2 -- ASRC2-Playback / ASRC2-Capture
asrc-0 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 986a2e26819a..4cb24b8de462 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -792,27 +792,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 = "asrc-0",
+ .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 = "asrc-1",
+ .playback = {
+ .stream_name = "ASRC1-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 = "ASRC1-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 = "asrc-2",
+ .playback = {
+ .stream_name = "ASRC2-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 = "ASRC2-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)
@@ -1393,7 +1442,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 v2 5/5] ASoC: fsl_easrc: expose individual DAIs per conversion path
2026-07-23 2:23 [PATCH v2 0/5] ASoC: fsl_asrc/fsl_easrc: expose per-pair/context DAIs and fix DMA race shengjiu.wang
` (3 preceding siblings ...)
2026-07-23 2:23 ` [PATCH v2 4/5] ASoC: fsl_asrc: expose individual DAIs per conversion path shengjiu.wang
@ 2026-07-23 2:23 ` shengjiu.wang
4 siblings, 0 replies; 10+ messages in thread
From: shengjiu.wang @ 2026-07-23 2:23 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
multiple independent conversion paths from being used simultaneously.
Replace the single fsl_easrc_dai instance with an array of four DAI
drivers to allow up to four independent conversion paths to be active
at the same time:
easrc-0 -- ASRC-Playback / ASRC-Capture (backward compatible)
easrc-1 -- ASRC1-Playback / ASRC1-Capture
easrc-2 -- ASRC2-Playback / ASRC2-Capture
easrc-3 -- ASRC3-Playback / ASRC3-Capture
easrc-0 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 e68f6cbdd653..8571fa0bfabd 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -1589,27 +1589,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 = "easrc-0",
+ .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 = "easrc-1",
+ .playback = {
+ .stream_name = "ASRC1-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 = "ASRC1-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 = "easrc-2",
+ .playback = {
+ .stream_name = "ASRC2-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 = "ASRC2-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 = "easrc-3",
+ .playback = {
+ .stream_name = "ASRC3-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 = "ASRC3-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 = {
@@ -2234,7 +2306,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 v2 1/5] ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths
2026-07-23 2:23 ` [PATCH v2 1/5] ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths shengjiu.wang
@ 2026-07-23 2:29 ` sashiko-bot
0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-23 2:29 UTC (permalink / raw)
To: shengjiu.wang; +Cc: Frank.Li, devicetree, robh, conor+dt, imx
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Validation fails on example code: dtc merges both asrc@2034000 nodes, triggering the mutual exclusion constraint.
--
--- Patch [1]: [PATCH v2 1/5] ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths ---
commit e164bae1625f2a8ec5fb2503565d3f37194aee90
Author: Shengjiu Wang <shengjiu.wang@nxp.com>
ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths
The commit adds a `ports` container to support multiple independent conversion
paths for the i.MX ASRC hardware. It enforces that both the deprecated `port`
and new `ports` cannot be used at the same time, and adds a second example
demonstrating the new configuration.
> diff --git a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
> --- a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
[ ... ]
> @@ -125,6 +135,10 @@ required:
> - fsl,asrc-width
>
> allOf:
> + - not:
> + required:
> + - port
> + - ports
> - $ref: dai-common.yaml#
> - if:
> properties:
[ ... ]
> @@ -188,3 +202,59 @@ examples:
> };
> };
> };
> +
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/clock/imx6qdl-clock.h>
> + asrc1: asrc@2034000 {
[Severity: Low]
Does this node name cause a build failure during dt_binding_check?
Because dt_binding_check concatenates all entries in the `examples` array into a
single DTS context for validation, using the same node name and unit address
(asrc@2034000) as the first example causes dtc to merge the two example nodes.
This results in a single merged node containing both the `port` property from
the first example and the `ports` property from this new example, which then
triggers the new mutual exclusion constraint (`not: required: [port, ports]`).
Would it be better to change the unit address for this second example (e.g.,
asrc@2038000) to prevent dtc from merging them?
> + compatible = "fsl,imx53-asrc";
> + reg = <0x02034000 0x4000>;
> + interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&clks IMX6QDL_CLK_ASRC_IPG>,
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723022313.1905051-1-shengjiu.wang@oss.nxp.com?part=1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/5] ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct
2026-07-23 2:23 ` [PATCH v2 3/5] ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct shengjiu.wang
@ 2026-07-23 2:41 ` sashiko-bot
0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-23 2:41 UTC (permalink / raw)
To: shengjiu.wang; +Cc: imx, Frank.Li, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] Mapping a dynamically allocated per-substream structure to a globally shared CPU DAI pointer reintroduces concurrent stream data races and causes a Use-After-Free (UAF) vulnerability.
--
--- Patch [3]: [PATCH v2 3/5] ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct ---
commit 00cf71a6ea96804fe20d59cf4d7658270bb9bebf
Author: Shengjiu Wang <shengjiu.wang@nxp.com>
ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct
This patch moves the dma_params fields into struct fsl_asrc_pair so each
concurrent stream pair owns its own copy. It removes the per-DAI probe
callbacks and assigns the per-pair DMA parameters to the CPU DAI during
startup.
> diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
> index 38f2b7c63133a..64d66420e7ada 100644
> --- a/sound/soc/fsl/fsl_asrc_dma.c
> +++ b/sound/soc/fsl/fsl_asrc_dma.c
[ ... ]
> @@ -390,6 +390,20 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component,
>
> runtime->private_data = pair;
>
> + /*
> + * Point the cpu DAI dma_data at the per-pair params so that
> + * concurrent hw_params calls on different pairs each write to
> + * their own struct and do not race on addr/maxburst. Use the
> + * per-direction setters so that a concurrent open of the other
> + * direction on the same DAI does not NULL out its pointer.
> + */
> + if (tx)
> + snd_soc_dai_dma_data_set_playback(snd_soc_rtd_to_cpu(rtd, 0),
> + &pair->dma_params);
> + else
> + snd_soc_dai_dma_data_set_capture(snd_soc_rtd_to_cpu(rtd, 0),
> + &pair->dma_params);
[Severity: Critical]
Does setting the shared CPU DAI dma_data to a per-substream allocated
structure reintroduce data races and create a use-after-free regression?
Since snd_soc_dai is a singleton per component, concurrent streams might
overwrite this single pointer. If we have two concurrent streams mapping to
ASRC, stream 2 could overwrite the shared CPU DAI playback_dma_data to
point to its own pair2.
If stream 2 then closes or fails in startup, pair2 is freed:
sound/soc/fsl/fsl_asrc_dma.c:fsl_asrc_dma_shutdown() {
...
kfree(pair);
...
}
The shared CPU DAI pointer is never nullified, leaving it dangling. If
stream 1 subsequently calls hw_params(), it would fetch this dangling
pointer:
sound/soc/fsl/fsl_asrc_dma.c: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 cross-stream corruption or a use-after-free vulnerability
by writing to and reading from the freed memory?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723022313.1905051-1-shengjiu.wang@oss.nxp.com?part=3
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/5] ASoC: fsl_asrc: expose individual DAIs per conversion path
2026-07-23 2:23 ` [PATCH v2 4/5] ASoC: fsl_asrc: expose individual DAIs per conversion path shengjiu.wang
@ 2026-07-23 2:45 ` sashiko-bot
0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-23 2:45 UTC (permalink / raw)
To: shengjiu.wang; +Cc: devicetree, Frank.Li, robh, conor+dt, imx
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Calling `hw_params` multiple times leaks channel availability, exhausts pair slots, and leaves dangling pointers leading to Use-After-Free.
--
--- Patch [4]: [PATCH v2 4/5] ASoC: fsl_asrc: expose individual DAIs per conversion path ---
commit f590fa927b95ce1e6a86c0ad704e429857c29260
Author: Shengjiu Wang <shengjiu.wang@nxp.com>
ASoC: fsl_asrc: expose individual DAIs per conversion path
The i.MX ASRC hardware supports three independent conversion pairs. This
commit replaces the single fsl_asrc_dai instance with an array of three DAI
drivers to allow independent conversion paths to be active simultaneously,
retaining backward compatibility for asrc-0.
> diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> index 2755ee57c6a17..a5d6c4c1e9292 100644
> --- a/sound/soc/fsl/fsl_asrc.c
> +++ b/sound/soc/fsl/fsl_asrc.c
[ ... ]
> @@ -792,27 +792,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 = {
[ ... ]
> +static struct snd_soc_dai_driver fsl_asrc_dai[] = {
> + {
> + .name = "asrc-0",
> + .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,
[Severity: High]
This is a pre-existing issue, but since this patch exposes multiple DAIs that
share these operations, could calling hw_params multiple times on an open
stream lead to a use-after-free?
ALSA allows userspace to call SNDRV_PCM_IOCTL_HW_PARAMS multiple times.
Looking at fsl_asrc_dai_hw_params(), it unconditionally requests a new pair:
sound/soc/fsl/fsl_asrc.c:fsl_asrc_dai_hw_params() {
...
ret = fsl_asrc_request_pair(channels, pair);
if (ret) {
...
}
In fsl_asrc_request_pair(), the loop finds the next NULL slot, skipping any
slot that already contains the same pair pointer:
sound/soc/fsl/fsl_asrc.c:fsl_asrc_request_pair() {
...
for (i = ASRC_PAIR_A; i < ASRC_PAIR_MAX_NUM; i++) {
if (asrc->pair[i] != NULL)
continue;
index = i;
...
}
Does this populate multiple slots in asrc->pair[] with the same pointer while
overwriting pair->index with the newest index?
If so, when the stream is closed, fsl_asrc_dma_shutdown() clears only the
latest index before freeing the pair. Older slots might permanently retain
pointers to the freed memory, leading to a use-after-free when fsl_asrc_isr()
or fsl_asrc_m2m_suspend() iterates over the pairs.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723022313.1905051-1-shengjiu.wang@oss.nxp.com?part=4
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 2/5] ASoC: dt-bindings: fsl,easrc: add ports binding for multiple conversion paths
2026-07-23 2:23 ` [PATCH v2 2/5] ASoC: dt-bindings: fsl,easrc: add ports binding for multiple conversion paths shengjiu.wang
@ 2026-07-23 4:34 ` Frank Li
0 siblings, 0 replies; 10+ messages in thread
From: Frank Li @ 2026-07-23 4:34 UTC (permalink / raw)
To: shengjiu.wang
Cc: 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, Shengjiu Wang
On Thu, Jul 23, 2026 at 10:23:10AM +0800, shengjiu.wang@oss.nxp.com wrote:
> 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 independent conversion path to be represented as an individual
> audio-graph port:
>
> port@0 -- conversion path 0
> port@1 -- conversion path 1
> port@2 -- conversion path 2
> port@3 -- conversion path 3
>
> Each sub-port references audio-graph-port.yaml and follows the standard
> audio-graph binding conventions. Contexts are allocated dynamically at
> stream open time; each active stream direction (playback or capture) on
> a port consumes one hardware context.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
> .../devicetree/bindings/sound/fsl,easrc.yaml | 68 +++++++++++++++++++
> 1 file changed, 68 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/sound/fsl,easrc.yaml b/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
> index d5727f8bfb0b..e6d7cae5983d 100644
> --- a/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,easrc.yaml
> @@ -55,6 +55,14 @@ properties:
> - const: imx/easrc/easrc-imx8mn.bin
> description: The coefficient table for the filters
>
> + ports:
> + $ref: /schemas/graph.yaml#/properties/ports
> + patternProperties:
> + "^port@[0-3]$":
> + $ref: audio-graph-port.yaml#
> + unevaluatedProperties: false
> + description: port for an independent conversion path
> +
> fsl,asrc-rate:
> $ref: /schemas/types.yaml#/definitions/uint32
> minimum: 8000
> @@ -107,3 +115,63 @@ examples:
> fsl,asrc-rate = <8000>;
> fsl,asrc-format = <2>;
> };
> +
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/clock/imx8mn-clock.h>
> +
> + easrc1: easrc@300c0000 {
Needn't label in example.
> + compatible = "fsl,imx8mn-easrc";
> + reg = <0x300c0000 0x10000>;
> + interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
> + 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 {
Needn't label.
Frank
> + remote-endpoint = <&fe00_ep>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + playback-only;
> + easrc1_endpoint1: endpoint {
> + remote-endpoint = <&fe01_ep>;
> + };
> + };
> +
> + port@2 {
> + reg = <2>;
> + capture-only;
> + easrc1_endpoint2: endpoint {
> + remote-endpoint = <&fe02_ep>;
> + };
> + };
> +
> + port@3 {
> + reg = <3>;
> + capture-only;
> + easrc1_endpoint3: endpoint {
> + remote-endpoint = <&fe03_ep>;
> + };
> + };
> + };
> + };
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-07-23 4:34 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 2:23 [PATCH v2 0/5] ASoC: fsl_asrc/fsl_easrc: expose per-pair/context DAIs and fix DMA race shengjiu.wang
2026-07-23 2:23 ` [PATCH v2 1/5] ASoC: dt-bindings: fsl,imx-asrc: update port binding to support multiple paths shengjiu.wang
2026-07-23 2:29 ` sashiko-bot
2026-07-23 2:23 ` [PATCH v2 2/5] ASoC: dt-bindings: fsl,easrc: add ports binding for multiple conversion paths shengjiu.wang
2026-07-23 4:34 ` Frank Li
2026-07-23 2:23 ` [PATCH v2 3/5] ASoC: fsl_asrc/fsl_easrc: move DMA params into pair/context struct shengjiu.wang
2026-07-23 2:41 ` sashiko-bot
2026-07-23 2:23 ` [PATCH v2 4/5] ASoC: fsl_asrc: expose individual DAIs per conversion path shengjiu.wang
2026-07-23 2:45 ` sashiko-bot
2026-07-23 2:23 ` [PATCH v2 5/5] ASoC: fsl_easrc: " shengjiu.wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox