* [PATCH v3 0/4] ASoC: fsl_asrc: support the i.MX952 platform
@ 2026-02-03 3:13 Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 1/4] ASoC: dt-bindings: fsl,imx-asrc: Add support for " Shengjiu Wang
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Shengjiu Wang @ 2026-02-03 3:13 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
Update dt binding document and update driver to suppot ASRC on i.MX952.
Changes in v3:
- add Reviewed-by from Daniel in patch 1/4
- swap the patch 2/4 and patch 3/4
- use regmap_read_poll_timeout in the fsl_asrc_m2m_output_ready()
- refine the code in asrc_m2m_device_run()
Changes in v2:
- update commit message for add more infos
- split original patch 2/3 to two patches: patch 2/4 3/4
- use size_add() in patch 4/4
Shengjiu Wang (4):
ASoC: dt-bindings: fsl,imx-asrc: Add support for i.MX952 platform
ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M
ASoC: fsl_asrc: Add support for i.MX952 platform
ASoC: fsl_asrc_dma: allocate memory from dma device
.../bindings/sound/fsl,imx-asrc.yaml | 1 +
sound/soc/fsl/fsl_asrc.c | 39 +++++++++++++++
sound/soc/fsl/fsl_asrc.h | 18 +++++++
sound/soc/fsl/fsl_asrc_common.h | 4 ++
sound/soc/fsl/fsl_asrc_dma.c | 48 ++++++++++++++++---
sound/soc/fsl/fsl_asrc_m2m.c | 8 +++-
6 files changed, 110 insertions(+), 8 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 1/4] ASoC: dt-bindings: fsl,imx-asrc: Add support for i.MX952 platform
2026-02-03 3:13 [PATCH v3 0/4] ASoC: fsl_asrc: support the i.MX952 platform Shengjiu Wang
@ 2026-02-03 3:13 ` Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M Shengjiu Wang
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Shengjiu Wang @ 2026-02-03 3:13 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
Add new compatible string 'fsl,imx952-asrc' for i.MX952 platform,
below are the differences that make this ASRC not fallback compatible
with other platforms.
1) There is a power domain on i.MX952 for the wakeupmix system where
ASRC is in. But it is enabled by default, ASRC device don't need
to enable it, so it is optional for i.MX952.
2) The clock sources of ASRC are different on i.MX952.
3) There is a limitation on i.MX952 that DMA request is not cleared at the
end of conversion with dma slave mode. Which causes sample is dropped from
the input fifo on the second time if DMA is triggered before the client
device and DMA may copy wrong data from output fifo as the output fifo is
not ready in the beginning. So there is specially handling in the driver.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
---
Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
index c9152bac7421..608defc93c1e 100644
--- a/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml
@@ -25,6 +25,7 @@ properties:
- fsl,imx53-asrc
- fsl,imx8qm-asrc
- fsl,imx8qxp-asrc
+ - fsl,imx952-asrc
- items:
- enum:
- fsl,imx6sx-asrc
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M
2026-02-03 3:13 [PATCH v3 0/4] ASoC: fsl_asrc: support the i.MX952 platform Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 1/4] ASoC: dt-bindings: fsl,imx-asrc: Add support for " Shengjiu Wang
@ 2026-02-03 3:13 ` Shengjiu Wang
2026-02-03 8:35 ` Daniel Baluta
2026-02-03 17:53 ` Frank Li
2026-02-03 3:13 ` [PATCH v3 3/4] ASoC: fsl_asrc: Add support for i.MX952 platform Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 4/4] ASoC: fsl_asrc_dma: allocate memory from dma device Shengjiu Wang
3 siblings, 2 replies; 12+ messages in thread
From: Shengjiu Wang @ 2026-02-03 3:13 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
There is a limitation on i.MX952 that dma request is not cleared at the
end of conversion with dma slave mode. Which causes sample is dropped
from the input fifo on the second time if dma is triggered before the
client device and EDMA may copy wrong data from output fifo as the output
fifo is not ready in the beginning.
The solution is to trigger asrc before dma on i.MX952, and add delay to
wait output data is generated then start the EDMA for output, otherwise
the m2m function has noise issues.
So add an option to start ASRC first for M2M before ASRC is enabled on
i.MX952.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
sound/soc/fsl/fsl_asrc.c | 23 +++++++++++++++++++++++
sound/soc/fsl/fsl_asrc.h | 4 ++++
sound/soc/fsl/fsl_asrc_common.h | 4 ++++
sound/soc/fsl/fsl_asrc_m2m.c | 8 +++++++-
4 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 92fb16f7be45..b6d4f1e09e2e 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -1078,6 +1078,27 @@ static unsigned int fsl_asrc_get_output_fifo_size(struct fsl_asrc_pair *pair)
return val >> ASRFSTi_OUTPUT_FIFO_SHIFT;
}
+static bool fsl_asrc_m2m_output_ready(struct fsl_asrc_pair *pair)
+{
+ struct fsl_asrc *asrc = pair->asrc;
+ enum asrc_pair_index index = pair->index;
+ int retry = 1000;
+ u32 val;
+ int ret;
+
+ /* Check output fifo status if it exceeds the watermark. */
+ ret = regmap_read_poll_timeout(asrc->regmap, REG_ASRFST(index), val,
+ (ASRFSTi_OUTPUT_FIFO_FILL(val) >= ASRC_M2M_OUTPUTFIFO_WML) ||
+ (--retry == 0), 0, USEC_PER_SEC);
+
+ if (ret || !retry) {
+ pair_warn("output is not ready\n");
+ return false;
+ }
+
+ return true;
+}
+
static int fsl_asrc_m2m_prepare(struct fsl_asrc_pair *pair)
{
struct fsl_asrc_pair_priv *pair_priv = pair->private;
@@ -1275,6 +1296,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
asrc_priv->soc = of_device_get_match_data(&pdev->dev);
asrc->use_edma = asrc_priv->soc->use_edma;
+ asrc->start_before_dma = asrc_priv->soc->start_before_dma;
asrc->get_dma_channel = fsl_asrc_get_dma_channel;
asrc->request_pair = fsl_asrc_request_pair;
asrc->release_pair = fsl_asrc_release_pair;
@@ -1289,6 +1311,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
asrc->m2m_get_maxburst = fsl_asrc_m2m_get_maxburst;
asrc->m2m_pair_resume = fsl_asrc_m2m_pair_resume;
asrc->m2m_get_cap = fsl_asrc_m2m_get_cap;
+ asrc->m2m_output_ready = fsl_asrc_m2m_output_ready;
if (of_device_is_compatible(np, "fsl,imx35-asrc")) {
asrc_priv->clk_map[IN] = input_clk_map_imx35;
diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h
index 1c492eb237f5..60b6865ca952 100644
--- a/sound/soc/fsl/fsl_asrc.h
+++ b/sound/soc/fsl/fsl_asrc.h
@@ -257,6 +257,8 @@
#define ASRFSTi_OUTPUT_FIFO_WIDTH 7
#define ASRFSTi_OUTPUT_FIFO_SHIFT 12
#define ASRFSTi_OUTPUT_FIFO_MASK (((1 << ASRFSTi_OUTPUT_FIFO_WIDTH) - 1) << ASRFSTi_OUTPUT_FIFO_SHIFT)
+#define ASRFSTi_OUTPUT_FIFO_FILL(v) \
+ (((v) & ASRFSTi_OUTPUT_FIFO_MASK) >> ASRFSTi_OUTPUT_FIFO_SHIFT)
#define ASRFSTi_IAEi_SHIFT 11
#define ASRFSTi_IAEi_MASK (1 << ASRFSTi_IAEi_SHIFT)
#define ASRFSTi_IAEi (1 << ASRFSTi_IAEi_SHIFT)
@@ -432,10 +434,12 @@ struct dma_block {
*
* @use_edma: using edma as dma device or not
* @channel_bits: width of ASRCNCR register for each pair
+ * @start_before_dma: start asrc before dma
*/
struct fsl_asrc_soc_data {
bool use_edma;
unsigned int channel_bits;
+ bool start_before_dma;
};
/**
diff --git a/sound/soc/fsl/fsl_asrc_common.h b/sound/soc/fsl/fsl_asrc_common.h
index 0cd595b0f629..c8a1a2b5915d 100644
--- a/sound/soc/fsl/fsl_asrc_common.h
+++ b/sound/soc/fsl/fsl_asrc_common.h
@@ -107,6 +107,7 @@ struct fsl_asrc_pair {
* @asrc_rate: default sample rate for ASoC Back-Ends
* @asrc_format: default sample format for ASoC Back-Ends
* @use_edma: edma is used
+ * @start_before_dma: start asrc before dma
* @get_dma_channel: function pointer
* @request_pair: function pointer
* @release_pair: function pointer
@@ -116,6 +117,7 @@ struct fsl_asrc_pair {
* @m2m_start: function pointer
* @m2m_unprepare: function pointer
* @m2m_stop: function pointer
+ * @m2m_output_ready: function pointer, check output fifo ready or not
* @m2m_calc_out_len: function pointer
* @m2m_get_maxburst: function pointer
* @m2m_pair_suspend: function pointer
@@ -143,6 +145,7 @@ struct fsl_asrc {
int asrc_rate;
snd_pcm_format_t asrc_format;
bool use_edma;
+ bool start_before_dma;
struct dma_chan *(*get_dma_channel)(struct fsl_asrc_pair *pair, bool dir);
int (*request_pair)(int channels, struct fsl_asrc_pair *pair);
@@ -154,6 +157,7 @@ struct fsl_asrc {
int (*m2m_start)(struct fsl_asrc_pair *pair);
int (*m2m_unprepare)(struct fsl_asrc_pair *pair);
int (*m2m_stop)(struct fsl_asrc_pair *pair);
+ bool (*m2m_output_ready)(struct fsl_asrc_pair *pair);
int (*m2m_calc_out_len)(struct fsl_asrc_pair *pair, int input_buffer_length);
int (*m2m_get_maxburst)(u8 dir, struct fsl_asrc_pair *pair);
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
index f46881f71e43..77999526dd9e 100644
--- a/sound/soc/fsl/fsl_asrc_m2m.c
+++ b/sound/soc/fsl/fsl_asrc_m2m.c
@@ -253,15 +253,21 @@ static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task
reinit_completion(&pair->complete[IN]);
reinit_completion(&pair->complete[OUT]);
+ if (asrc->start_before_dma)
+ asrc->m2m_start(pair);
+
/* Submit DMA request */
dmaengine_submit(pair->desc[IN]);
dma_async_issue_pending(pair->desc[IN]->chan);
if (out_dma_len > 0) {
+ if (asrc->start_before_dma && asrc->m2m_output_ready)
+ asrc->m2m_output_ready(pair);
dmaengine_submit(pair->desc[OUT]);
dma_async_issue_pending(pair->desc[OUT]->chan);
}
- asrc->m2m_start(pair);
+ if (!asrc->start_before_dma)
+ asrc->m2m_start(pair);
if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) {
dev_err(dev, "out DMA task timeout\n");
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 3/4] ASoC: fsl_asrc: Add support for i.MX952 platform
2026-02-03 3:13 [PATCH v3 0/4] ASoC: fsl_asrc: support the i.MX952 platform Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 1/4] ASoC: dt-bindings: fsl,imx-asrc: Add support for " Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M Shengjiu Wang
@ 2026-02-03 3:13 ` Shengjiu Wang
2026-02-03 8:36 ` Daniel Baluta
2026-02-03 3:13 ` [PATCH v3 4/4] ASoC: fsl_asrc_dma: allocate memory from dma device Shengjiu Wang
3 siblings, 1 reply; 12+ messages in thread
From: Shengjiu Wang @ 2026-02-03 3:13 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
Add a compatible string, clock mapping table and enable the option
'start_before_dma' to support ASRC on the i.MX952 platform.
The clock mapping table is to map the clock sources on i.MX952 to the
clock ids in the driver, the clock ids are for all the clock sources on
all supported platforms.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
sound/soc/fsl/fsl_asrc.c | 16 ++++++++++++++++
sound/soc/fsl/fsl_asrc.h | 14 ++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index b6d4f1e09e2e..7f25c4d066a0 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -106,6 +106,12 @@ static unsigned char clk_map_imx8qxp[2][ASRC_CLK_MAP_LEN] = {
},
};
+static unsigned char clk_map_imx952[ASRC_CLK_MAP_LEN] = {
+ 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x0,
+ 0x0, 0x1, 0x2, 0x3, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x4, 0x5, 0x6, 0x8, 0xf, 0xf,
+ 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7, 0x9, 0xa, 0xb, 0xc, 0xd, 0xf, 0xf, 0xf, 0xf,
+};
+
/*
* According to RM, the divider range is 1 ~ 8,
* prescaler is power of 2 from 1 ~ 128.
@@ -1338,6 +1344,9 @@ static int fsl_asrc_probe(struct platform_device *pdev)
asrc_priv->clk_map[IN] = clk_map_imx8qxp[map_idx];
asrc_priv->clk_map[OUT] = clk_map_imx8qxp[map_idx];
}
+ } else if (of_device_is_compatible(np, "fsl,imx952-asrc")) {
+ asrc_priv->clk_map[IN] = clk_map_imx952;
+ asrc_priv->clk_map[OUT] = clk_map_imx952;
}
asrc->channel_avail = 10;
@@ -1576,11 +1585,18 @@ static const struct fsl_asrc_soc_data fsl_asrc_imx8qxp_data = {
.channel_bits = 4,
};
+static const struct fsl_asrc_soc_data fsl_asrc_imx952_data = {
+ .use_edma = true,
+ .channel_bits = 4,
+ .start_before_dma = true,
+};
+
static const struct of_device_id fsl_asrc_ids[] = {
{ .compatible = "fsl,imx35-asrc", .data = &fsl_asrc_imx35_data },
{ .compatible = "fsl,imx53-asrc", .data = &fsl_asrc_imx53_data },
{ .compatible = "fsl,imx8qm-asrc", .data = &fsl_asrc_imx8qm_data },
{ .compatible = "fsl,imx8qxp-asrc", .data = &fsl_asrc_imx8qxp_data },
+ { .compatible = "fsl,imx952-asrc", .data = &fsl_asrc_imx952_data },
{}
};
MODULE_DEVICE_TABLE(of, fsl_asrc_ids);
diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h
index 60b6865ca952..7a81366a0ee4 100644
--- a/sound/soc/fsl/fsl_asrc.h
+++ b/sound/soc/fsl/fsl_asrc.h
@@ -326,6 +326,13 @@ enum asrc_inclk {
INCLK_SAI6_TX_BCLK = 0x22,
INCLK_HDMI_RX_SAI0_RX_BCLK = 0x24,
INCLK_HDMI_TX_SAI0_TX_BCLK = 0x25,
+
+ INCLK_SAI2_TX_BCLK = 0x26,
+ INCLK_SAI3_TX_BCLK = 0x27,
+ INCLK_SAI4_RX_BCLK = 0x28,
+ INCLK_SAI4_TX_BCLK = 0x29,
+ INCLK_SAI5_RX_BCLK = 0x2a,
+ INCLK_SAI5_TX_BCLK = 0x2b,
};
enum asrc_outclk {
@@ -366,6 +373,13 @@ enum asrc_outclk {
OUTCLK_SAI6_TX_BCLK = 0x22,
OUTCLK_HDMI_RX_SAI0_RX_BCLK = 0x24,
OUTCLK_HDMI_TX_SAI0_TX_BCLK = 0x25,
+
+ OUTCLK_SAI2_TX_BCLK = 0x26,
+ OUTCLK_SAI3_TX_BCLK = 0x27,
+ OUTCLK_SAI4_RX_BCLK = 0x28,
+ OUTCLK_SAI4_TX_BCLK = 0x29,
+ OUTCLK_SAI5_RX_BCLK = 0x2a,
+ OUTCLK_SAI5_TX_BCLK = 0x2b,
};
#define ASRC_CLK_MAX_NUM 16
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 4/4] ASoC: fsl_asrc_dma: allocate memory from dma device
2026-02-03 3:13 [PATCH v3 0/4] ASoC: fsl_asrc: support the i.MX952 platform Shengjiu Wang
` (2 preceding siblings ...)
2026-02-03 3:13 ` [PATCH v3 3/4] ASoC: fsl_asrc: Add support for i.MX952 platform Shengjiu Wang
@ 2026-02-03 3:13 ` Shengjiu Wang
2026-02-04 16:37 ` Frank Li
3 siblings, 1 reply; 12+ messages in thread
From: Shengjiu Wang @ 2026-02-03 3:13 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
The dma-coherent property is used to indicate a device is capable of
coherent DMA operations. On i.MX952, one of EDMA devices support such
feature, in order to support the EDMA device, the memory needs to be
allocated from the DMA device.
The code change here is to make this driver compatible for non
dma-coherent and dma-coherent dma devices.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
sound/soc/fsl/fsl_asrc_dma.c | 48 ++++++++++++++++++++++++++++++------
1 file changed, 41 insertions(+), 7 deletions(-)
diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index 7dacc06b2f02..348b0aabfa68 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -449,18 +449,52 @@ fsl_asrc_dma_pcm_pointer(struct snd_soc_component *component,
static int fsl_asrc_dma_pcm_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd)
{
- struct snd_card *card = rtd->card->snd_card;
+ struct device *dev = component->dev;
+ struct fsl_asrc *asrc = dev_get_drvdata(dev);
+ struct fsl_asrc_pair *pair;
struct snd_pcm *pcm = rtd->pcm;
+ struct dma_chan *chan;
int ret;
- ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
- if (ret) {
- dev_err(card->dev, "failed to set DMA mask\n");
- return ret;
+ pair = kzalloc(size_add(sizeof(*pair), asrc->pair_priv_size), GFP_KERNEL);
+ if (!pair)
+ return -ENOMEM;
+
+ pair->asrc = asrc;
+ pair->private = (void *)pair + sizeof(struct fsl_asrc_pair);
+
+ /* Request a pair, which will be released later.
+ * Request pair function needs channel num as input, for this
+ * pair, we just request "1" channel temporarily.
+ */
+ ret = asrc->request_pair(1, pair);
+ if (ret < 0) {
+ dev_err(dev, "failed to request asrc pair\n");
+ goto req_pair_err;
+ }
+
+ /* Request a dma channel, which will be released later. */
+ chan = asrc->get_dma_channel(pair, IN);
+ if (!chan) {
+ dev_err(dev, "failed to get dma channel\n");
+ ret = -EINVAL;
+ goto dma_chan_err;
}
- return snd_pcm_set_fixed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
- card->dev, FSL_ASRC_DMABUF_SIZE);
+ ret = snd_pcm_set_fixed_buffer_all(pcm,
+ SNDRV_DMA_TYPE_DEV,
+ chan->device->dev,
+ FSL_ASRC_DMABUF_SIZE);
+
+ dma_release_channel(chan);
+
+dma_chan_err:
+ asrc->release_pair(pair);
+
+req_pair_err:
+ kfree(pair);
+
+ return ret;
}
struct snd_soc_component_driver fsl_asrc_component = {
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M
2026-02-03 3:13 ` [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M Shengjiu Wang
@ 2026-02-03 8:35 ` Daniel Baluta
2026-02-03 17:53 ` Frank Li
1 sibling, 0 replies; 12+ messages in thread
From: Daniel Baluta @ 2026-02-03 8:35 UTC (permalink / raw)
To: Shengjiu Wang
Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
On Tue, Feb 3, 2026 at 5:13 AM Shengjiu Wang <shengjiu.wang@nxp.com> wrote:
>
> There is a limitation on i.MX952 that dma request is not cleared at the
> end of conversion with dma slave mode. Which causes sample is dropped
> from the input fifo on the second time if dma is triggered before the
> client device and EDMA may copy wrong data from output fifo as the output
> fifo is not ready in the beginning.
>
> The solution is to trigger asrc before dma on i.MX952, and add delay to
> wait output data is generated then start the EDMA for output, otherwise
> the m2m function has noise issues.
>
> So add an option to start ASRC first for M2M before ASRC is enabled on
> i.MX952.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 3/4] ASoC: fsl_asrc: Add support for i.MX952 platform
2026-02-03 3:13 ` [PATCH v3 3/4] ASoC: fsl_asrc: Add support for i.MX952 platform Shengjiu Wang
@ 2026-02-03 8:36 ` Daniel Baluta
0 siblings, 0 replies; 12+ messages in thread
From: Daniel Baluta @ 2026-02-03 8:36 UTC (permalink / raw)
To: Shengjiu Wang
Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
On Tue, Feb 3, 2026 at 5:13 AM Shengjiu Wang <shengjiu.wang@nxp.com> wrote:
>
> Add a compatible string, clock mapping table and enable the option
> 'start_before_dma' to support ASRC on the i.MX952 platform.
>
> The clock mapping table is to map the clock sources on i.MX952 to the
> clock ids in the driver, the clock ids are for all the clock sources on
> all supported platforms.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M
2026-02-03 3:13 ` [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M Shengjiu Wang
2026-02-03 8:35 ` Daniel Baluta
@ 2026-02-03 17:53 ` Frank Li
2026-02-04 1:41 ` Shengjiu Wang
1 sibling, 1 reply; 12+ messages in thread
From: Frank Li @ 2026-02-03 17:53 UTC (permalink / raw)
To: Shengjiu Wang
Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
On Tue, Feb 03, 2026 at 11:13:43AM +0800, Shengjiu Wang wrote:
> There is a limitation on i.MX952 that dma request is not cleared at the
> end of conversion with dma slave mode. Which causes sample is dropped
> from the input fifo on the second time if dma is triggered before the
> client device and EDMA may copy wrong data from output fifo as the output
> fifo is not ready in the beginning.
>
> The solution is to trigger asrc before dma on i.MX952, and add delay to
> wait output data is generated then start the EDMA for output, otherwise
> the m2m function has noise issues.
>
> So add an option to start ASRC first for M2M before ASRC is enabled on
> i.MX952.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
> sound/soc/fsl/fsl_asrc.c | 23 +++++++++++++++++++++++
> sound/soc/fsl/fsl_asrc.h | 4 ++++
> sound/soc/fsl/fsl_asrc_common.h | 4 ++++
> sound/soc/fsl/fsl_asrc_m2m.c | 8 +++++++-
> 4 files changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> index 92fb16f7be45..b6d4f1e09e2e 100644
> --- a/sound/soc/fsl/fsl_asrc.c
> +++ b/sound/soc/fsl/fsl_asrc.c
> @@ -1078,6 +1078,27 @@ static unsigned int fsl_asrc_get_output_fifo_size(struct fsl_asrc_pair *pair)
> return val >> ASRFSTi_OUTPUT_FIFO_SHIFT;
> }
>
> +static bool fsl_asrc_m2m_output_ready(struct fsl_asrc_pair *pair)
> +{
> + struct fsl_asrc *asrc = pair->asrc;
> + enum asrc_pair_index index = pair->index;
> + int retry = 1000;
> + u32 val;
> + int ret;
> +
> + /* Check output fifo status if it exceeds the watermark. */
> + ret = regmap_read_poll_timeout(asrc->regmap, REG_ASRFST(index), val,
> + (ASRFSTi_OUTPUT_FIFO_FILL(val) >= ASRC_M2M_OUTPUTFIFO_WML) ||
> + (--retry == 0), 0, USEC_PER_SEC);
are sure need "retry"? there are timeout, which should be equal to 'retry'.
Frank
> +
> + if (ret || !retry) {
> + pair_warn("output is not ready\n");
> + return false;
> + }
> +
> + return true;
> +}
> +
> static int fsl_asrc_m2m_prepare(struct fsl_asrc_pair *pair)
> {
> struct fsl_asrc_pair_priv *pair_priv = pair->private;
> @@ -1275,6 +1296,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
>
> asrc_priv->soc = of_device_get_match_data(&pdev->dev);
> asrc->use_edma = asrc_priv->soc->use_edma;
> + asrc->start_before_dma = asrc_priv->soc->start_before_dma;
> asrc->get_dma_channel = fsl_asrc_get_dma_channel;
> asrc->request_pair = fsl_asrc_request_pair;
> asrc->release_pair = fsl_asrc_release_pair;
> @@ -1289,6 +1311,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
> asrc->m2m_get_maxburst = fsl_asrc_m2m_get_maxburst;
> asrc->m2m_pair_resume = fsl_asrc_m2m_pair_resume;
> asrc->m2m_get_cap = fsl_asrc_m2m_get_cap;
> + asrc->m2m_output_ready = fsl_asrc_m2m_output_ready;
>
> if (of_device_is_compatible(np, "fsl,imx35-asrc")) {
> asrc_priv->clk_map[IN] = input_clk_map_imx35;
> diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h
> index 1c492eb237f5..60b6865ca952 100644
> --- a/sound/soc/fsl/fsl_asrc.h
> +++ b/sound/soc/fsl/fsl_asrc.h
> @@ -257,6 +257,8 @@
> #define ASRFSTi_OUTPUT_FIFO_WIDTH 7
> #define ASRFSTi_OUTPUT_FIFO_SHIFT 12
> #define ASRFSTi_OUTPUT_FIFO_MASK (((1 << ASRFSTi_OUTPUT_FIFO_WIDTH) - 1) << ASRFSTi_OUTPUT_FIFO_SHIFT)
> +#define ASRFSTi_OUTPUT_FIFO_FILL(v) \
> + (((v) & ASRFSTi_OUTPUT_FIFO_MASK) >> ASRFSTi_OUTPUT_FIFO_SHIFT)
> #define ASRFSTi_IAEi_SHIFT 11
> #define ASRFSTi_IAEi_MASK (1 << ASRFSTi_IAEi_SHIFT)
> #define ASRFSTi_IAEi (1 << ASRFSTi_IAEi_SHIFT)
> @@ -432,10 +434,12 @@ struct dma_block {
> *
> * @use_edma: using edma as dma device or not
> * @channel_bits: width of ASRCNCR register for each pair
> + * @start_before_dma: start asrc before dma
> */
> struct fsl_asrc_soc_data {
> bool use_edma;
> unsigned int channel_bits;
> + bool start_before_dma;
> };
>
> /**
> diff --git a/sound/soc/fsl/fsl_asrc_common.h b/sound/soc/fsl/fsl_asrc_common.h
> index 0cd595b0f629..c8a1a2b5915d 100644
> --- a/sound/soc/fsl/fsl_asrc_common.h
> +++ b/sound/soc/fsl/fsl_asrc_common.h
> @@ -107,6 +107,7 @@ struct fsl_asrc_pair {
> * @asrc_rate: default sample rate for ASoC Back-Ends
> * @asrc_format: default sample format for ASoC Back-Ends
> * @use_edma: edma is used
> + * @start_before_dma: start asrc before dma
> * @get_dma_channel: function pointer
> * @request_pair: function pointer
> * @release_pair: function pointer
> @@ -116,6 +117,7 @@ struct fsl_asrc_pair {
> * @m2m_start: function pointer
> * @m2m_unprepare: function pointer
> * @m2m_stop: function pointer
> + * @m2m_output_ready: function pointer, check output fifo ready or not
> * @m2m_calc_out_len: function pointer
> * @m2m_get_maxburst: function pointer
> * @m2m_pair_suspend: function pointer
> @@ -143,6 +145,7 @@ struct fsl_asrc {
> int asrc_rate;
> snd_pcm_format_t asrc_format;
> bool use_edma;
> + bool start_before_dma;
>
> struct dma_chan *(*get_dma_channel)(struct fsl_asrc_pair *pair, bool dir);
> int (*request_pair)(int channels, struct fsl_asrc_pair *pair);
> @@ -154,6 +157,7 @@ struct fsl_asrc {
> int (*m2m_start)(struct fsl_asrc_pair *pair);
> int (*m2m_unprepare)(struct fsl_asrc_pair *pair);
> int (*m2m_stop)(struct fsl_asrc_pair *pair);
> + bool (*m2m_output_ready)(struct fsl_asrc_pair *pair);
>
> int (*m2m_calc_out_len)(struct fsl_asrc_pair *pair, int input_buffer_length);
> int (*m2m_get_maxburst)(u8 dir, struct fsl_asrc_pair *pair);
> diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
> index f46881f71e43..77999526dd9e 100644
> --- a/sound/soc/fsl/fsl_asrc_m2m.c
> +++ b/sound/soc/fsl/fsl_asrc_m2m.c
> @@ -253,15 +253,21 @@ static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task
> reinit_completion(&pair->complete[IN]);
> reinit_completion(&pair->complete[OUT]);
>
> + if (asrc->start_before_dma)
> + asrc->m2m_start(pair);
> +
> /* Submit DMA request */
> dmaengine_submit(pair->desc[IN]);
> dma_async_issue_pending(pair->desc[IN]->chan);
> if (out_dma_len > 0) {
> + if (asrc->start_before_dma && asrc->m2m_output_ready)
> + asrc->m2m_output_ready(pair);
> dmaengine_submit(pair->desc[OUT]);
> dma_async_issue_pending(pair->desc[OUT]->chan);
> }
>
> - asrc->m2m_start(pair);
> + if (!asrc->start_before_dma)
> + asrc->m2m_start(pair);
>
> if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) {
> dev_err(dev, "out DMA task timeout\n");
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M
2026-02-03 17:53 ` Frank Li
@ 2026-02-04 1:41 ` Shengjiu Wang
2026-02-04 16:30 ` Frank Li
0 siblings, 1 reply; 12+ messages in thread
From: Shengjiu Wang @ 2026-02-04 1:41 UTC (permalink / raw)
To: Frank Li
Cc: Shengjiu Wang, lgirdwood, broonie, robh, krzk+dt, conor+dt,
shawnguo, s.hauer, kernel, festevam, linux-sound, devicetree, imx,
linux-arm-kernel, linux-kernel, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
On Wed, Feb 4, 2026 at 1:53 AM Frank Li <Frank.li@nxp.com> wrote:
>
> On Tue, Feb 03, 2026 at 11:13:43AM +0800, Shengjiu Wang wrote:
> > There is a limitation on i.MX952 that dma request is not cleared at the
> > end of conversion with dma slave mode. Which causes sample is dropped
> > from the input fifo on the second time if dma is triggered before the
> > client device and EDMA may copy wrong data from output fifo as the output
> > fifo is not ready in the beginning.
> >
> > The solution is to trigger asrc before dma on i.MX952, and add delay to
> > wait output data is generated then start the EDMA for output, otherwise
> > the m2m function has noise issues.
> >
> > So add an option to start ASRC first for M2M before ASRC is enabled on
> > i.MX952.
> >
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> > ---
> > sound/soc/fsl/fsl_asrc.c | 23 +++++++++++++++++++++++
> > sound/soc/fsl/fsl_asrc.h | 4 ++++
> > sound/soc/fsl/fsl_asrc_common.h | 4 ++++
> > sound/soc/fsl/fsl_asrc_m2m.c | 8 +++++++-
> > 4 files changed, 38 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> > index 92fb16f7be45..b6d4f1e09e2e 100644
> > --- a/sound/soc/fsl/fsl_asrc.c
> > +++ b/sound/soc/fsl/fsl_asrc.c
> > @@ -1078,6 +1078,27 @@ static unsigned int fsl_asrc_get_output_fifo_size(struct fsl_asrc_pair *pair)
> > return val >> ASRFSTi_OUTPUT_FIFO_SHIFT;
> > }
> >
> > +static bool fsl_asrc_m2m_output_ready(struct fsl_asrc_pair *pair)
> > +{
> > + struct fsl_asrc *asrc = pair->asrc;
> > + enum asrc_pair_index index = pair->index;
> > + int retry = 1000;
> > + u32 val;
> > + int ret;
> > +
> > + /* Check output fifo status if it exceeds the watermark. */
> > + ret = regmap_read_poll_timeout(asrc->regmap, REG_ASRFST(index), val,
> > + (ASRFSTi_OUTPUT_FIFO_FILL(val) >= ASRC_M2M_OUTPUTFIFO_WML) ||
> > + (--retry == 0), 0, USEC_PER_SEC);
>
> are sure need "retry"? there are timeout, which should be equal to 'retry'.
Yes, "retry" is what I want, timeout is not what I expected.
Best regards
Shengjiu Wang
>
> Frank
> > +
> > + if (ret || !retry) {
> > + pair_warn("output is not ready\n");
> > + return false;
> > + }
> > +
> > + return true;
> > +}
> > +
> > static int fsl_asrc_m2m_prepare(struct fsl_asrc_pair *pair)
> > {
> > struct fsl_asrc_pair_priv *pair_priv = pair->private;
> > @@ -1275,6 +1296,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
> >
> > asrc_priv->soc = of_device_get_match_data(&pdev->dev);
> > asrc->use_edma = asrc_priv->soc->use_edma;
> > + asrc->start_before_dma = asrc_priv->soc->start_before_dma;
> > asrc->get_dma_channel = fsl_asrc_get_dma_channel;
> > asrc->request_pair = fsl_asrc_request_pair;
> > asrc->release_pair = fsl_asrc_release_pair;
> > @@ -1289,6 +1311,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
> > asrc->m2m_get_maxburst = fsl_asrc_m2m_get_maxburst;
> > asrc->m2m_pair_resume = fsl_asrc_m2m_pair_resume;
> > asrc->m2m_get_cap = fsl_asrc_m2m_get_cap;
> > + asrc->m2m_output_ready = fsl_asrc_m2m_output_ready;
> >
> > if (of_device_is_compatible(np, "fsl,imx35-asrc")) {
> > asrc_priv->clk_map[IN] = input_clk_map_imx35;
> > diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h
> > index 1c492eb237f5..60b6865ca952 100644
> > --- a/sound/soc/fsl/fsl_asrc.h
> > +++ b/sound/soc/fsl/fsl_asrc.h
> > @@ -257,6 +257,8 @@
> > #define ASRFSTi_OUTPUT_FIFO_WIDTH 7
> > #define ASRFSTi_OUTPUT_FIFO_SHIFT 12
> > #define ASRFSTi_OUTPUT_FIFO_MASK (((1 << ASRFSTi_OUTPUT_FIFO_WIDTH) - 1) << ASRFSTi_OUTPUT_FIFO_SHIFT)
> > +#define ASRFSTi_OUTPUT_FIFO_FILL(v) \
> > + (((v) & ASRFSTi_OUTPUT_FIFO_MASK) >> ASRFSTi_OUTPUT_FIFO_SHIFT)
> > #define ASRFSTi_IAEi_SHIFT 11
> > #define ASRFSTi_IAEi_MASK (1 << ASRFSTi_IAEi_SHIFT)
> > #define ASRFSTi_IAEi (1 << ASRFSTi_IAEi_SHIFT)
> > @@ -432,10 +434,12 @@ struct dma_block {
> > *
> > * @use_edma: using edma as dma device or not
> > * @channel_bits: width of ASRCNCR register for each pair
> > + * @start_before_dma: start asrc before dma
> > */
> > struct fsl_asrc_soc_data {
> > bool use_edma;
> > unsigned int channel_bits;
> > + bool start_before_dma;
> > };
> >
> > /**
> > diff --git a/sound/soc/fsl/fsl_asrc_common.h b/sound/soc/fsl/fsl_asrc_common.h
> > index 0cd595b0f629..c8a1a2b5915d 100644
> > --- a/sound/soc/fsl/fsl_asrc_common.h
> > +++ b/sound/soc/fsl/fsl_asrc_common.h
> > @@ -107,6 +107,7 @@ struct fsl_asrc_pair {
> > * @asrc_rate: default sample rate for ASoC Back-Ends
> > * @asrc_format: default sample format for ASoC Back-Ends
> > * @use_edma: edma is used
> > + * @start_before_dma: start asrc before dma
> > * @get_dma_channel: function pointer
> > * @request_pair: function pointer
> > * @release_pair: function pointer
> > @@ -116,6 +117,7 @@ struct fsl_asrc_pair {
> > * @m2m_start: function pointer
> > * @m2m_unprepare: function pointer
> > * @m2m_stop: function pointer
> > + * @m2m_output_ready: function pointer, check output fifo ready or not
> > * @m2m_calc_out_len: function pointer
> > * @m2m_get_maxburst: function pointer
> > * @m2m_pair_suspend: function pointer
> > @@ -143,6 +145,7 @@ struct fsl_asrc {
> > int asrc_rate;
> > snd_pcm_format_t asrc_format;
> > bool use_edma;
> > + bool start_before_dma;
> >
> > struct dma_chan *(*get_dma_channel)(struct fsl_asrc_pair *pair, bool dir);
> > int (*request_pair)(int channels, struct fsl_asrc_pair *pair);
> > @@ -154,6 +157,7 @@ struct fsl_asrc {
> > int (*m2m_start)(struct fsl_asrc_pair *pair);
> > int (*m2m_unprepare)(struct fsl_asrc_pair *pair);
> > int (*m2m_stop)(struct fsl_asrc_pair *pair);
> > + bool (*m2m_output_ready)(struct fsl_asrc_pair *pair);
> >
> > int (*m2m_calc_out_len)(struct fsl_asrc_pair *pair, int input_buffer_length);
> > int (*m2m_get_maxburst)(u8 dir, struct fsl_asrc_pair *pair);
> > diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
> > index f46881f71e43..77999526dd9e 100644
> > --- a/sound/soc/fsl/fsl_asrc_m2m.c
> > +++ b/sound/soc/fsl/fsl_asrc_m2m.c
> > @@ -253,15 +253,21 @@ static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task
> > reinit_completion(&pair->complete[IN]);
> > reinit_completion(&pair->complete[OUT]);
> >
> > + if (asrc->start_before_dma)
> > + asrc->m2m_start(pair);
> > +
> > /* Submit DMA request */
> > dmaengine_submit(pair->desc[IN]);
> > dma_async_issue_pending(pair->desc[IN]->chan);
> > if (out_dma_len > 0) {
> > + if (asrc->start_before_dma && asrc->m2m_output_ready)
> > + asrc->m2m_output_ready(pair);
> > dmaengine_submit(pair->desc[OUT]);
> > dma_async_issue_pending(pair->desc[OUT]->chan);
> > }
> >
> > - asrc->m2m_start(pair);
> > + if (!asrc->start_before_dma)
> > + asrc->m2m_start(pair);
> >
> > if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) {
> > dev_err(dev, "out DMA task timeout\n");
> > --
> > 2.34.1
> >
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M
2026-02-04 1:41 ` Shengjiu Wang
@ 2026-02-04 16:30 ` Frank Li
2026-02-05 2:36 ` Shengjiu Wang
0 siblings, 1 reply; 12+ messages in thread
From: Frank Li @ 2026-02-04 16:30 UTC (permalink / raw)
To: Shengjiu Wang
Cc: Shengjiu Wang, lgirdwood, broonie, robh, krzk+dt, conor+dt,
shawnguo, s.hauer, kernel, festevam, linux-sound, devicetree, imx,
linux-arm-kernel, linux-kernel, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
On Wed, Feb 04, 2026 at 09:41:55AM +0800, Shengjiu Wang wrote:
> On Wed, Feb 4, 2026 at 1:53 AM Frank Li <Frank.li@nxp.com> wrote:
> >
> > On Tue, Feb 03, 2026 at 11:13:43AM +0800, Shengjiu Wang wrote:
> > > There is a limitation on i.MX952 that dma request is not cleared at the
> > > end of conversion with dma slave mode. Which causes sample is dropped
> > > from the input fifo on the second time if dma is triggered before the
> > > client device and EDMA may copy wrong data from output fifo as the output
> > > fifo is not ready in the beginning.
> > >
> > > The solution is to trigger asrc before dma on i.MX952, and add delay to
> > > wait output data is generated then start the EDMA for output, otherwise
> > > the m2m function has noise issues.
> > >
> > > So add an option to start ASRC first for M2M before ASRC is enabled on
> > > i.MX952.
> > >
> > > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> > > ---
> > > sound/soc/fsl/fsl_asrc.c | 23 +++++++++++++++++++++++
> > > sound/soc/fsl/fsl_asrc.h | 4 ++++
> > > sound/soc/fsl/fsl_asrc_common.h | 4 ++++
> > > sound/soc/fsl/fsl_asrc_m2m.c | 8 +++++++-
> > > 4 files changed, 38 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> > > index 92fb16f7be45..b6d4f1e09e2e 100644
> > > --- a/sound/soc/fsl/fsl_asrc.c
> > > +++ b/sound/soc/fsl/fsl_asrc.c
> > > @@ -1078,6 +1078,27 @@ static unsigned int fsl_asrc_get_output_fifo_size(struct fsl_asrc_pair *pair)
> > > return val >> ASRFSTi_OUTPUT_FIFO_SHIFT;
> > > }
> > >
> > > +static bool fsl_asrc_m2m_output_ready(struct fsl_asrc_pair *pair)
> > > +{
> > > + struct fsl_asrc *asrc = pair->asrc;
> > > + enum asrc_pair_index index = pair->index;
> > > + int retry = 1000;
> > > + u32 val;
> > > + int ret;
> > > +
> > > + /* Check output fifo status if it exceeds the watermark. */
> > > + ret = regmap_read_poll_timeout(asrc->regmap, REG_ASRFST(index), val,
> > > + (ASRFSTi_OUTPUT_FIFO_FILL(val) >= ASRC_M2M_OUTPUTFIFO_WML) ||
> > > + (--retry == 0), 0, USEC_PER_SEC);
> >
> > are sure need "retry"? there are timeout, which should be equal to 'retry'.
>
> Yes, "retry" is what I want, timeout is not what I expected.
Okay, but it will be strange. you polling a register, you suppose it will
be finished below 1000 IO read, which is certain time in SoC, for example
1ms. Compare to timeout us value, 1000 is hard to understand why you choose
this value.
Frank
>
> Best regards
> Shengjiu Wang
>
> >
> > Frank
> > > +
> > > + if (ret || !retry) {
> > > + pair_warn("output is not ready\n");
> > > + return false;
> > > + }
> > > +
> > > + return true;
> > > +}
> > > +
> > > static int fsl_asrc_m2m_prepare(struct fsl_asrc_pair *pair)
> > > {
> > > struct fsl_asrc_pair_priv *pair_priv = pair->private;
> > > @@ -1275,6 +1296,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
> > >
> > > asrc_priv->soc = of_device_get_match_data(&pdev->dev);
> > > asrc->use_edma = asrc_priv->soc->use_edma;
> > > + asrc->start_before_dma = asrc_priv->soc->start_before_dma;
> > > asrc->get_dma_channel = fsl_asrc_get_dma_channel;
> > > asrc->request_pair = fsl_asrc_request_pair;
> > > asrc->release_pair = fsl_asrc_release_pair;
> > > @@ -1289,6 +1311,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
> > > asrc->m2m_get_maxburst = fsl_asrc_m2m_get_maxburst;
> > > asrc->m2m_pair_resume = fsl_asrc_m2m_pair_resume;
> > > asrc->m2m_get_cap = fsl_asrc_m2m_get_cap;
> > > + asrc->m2m_output_ready = fsl_asrc_m2m_output_ready;
> > >
> > > if (of_device_is_compatible(np, "fsl,imx35-asrc")) {
> > > asrc_priv->clk_map[IN] = input_clk_map_imx35;
> > > diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h
> > > index 1c492eb237f5..60b6865ca952 100644
> > > --- a/sound/soc/fsl/fsl_asrc.h
> > > +++ b/sound/soc/fsl/fsl_asrc.h
> > > @@ -257,6 +257,8 @@
> > > #define ASRFSTi_OUTPUT_FIFO_WIDTH 7
> > > #define ASRFSTi_OUTPUT_FIFO_SHIFT 12
> > > #define ASRFSTi_OUTPUT_FIFO_MASK (((1 << ASRFSTi_OUTPUT_FIFO_WIDTH) - 1) << ASRFSTi_OUTPUT_FIFO_SHIFT)
> > > +#define ASRFSTi_OUTPUT_FIFO_FILL(v) \
> > > + (((v) & ASRFSTi_OUTPUT_FIFO_MASK) >> ASRFSTi_OUTPUT_FIFO_SHIFT)
> > > #define ASRFSTi_IAEi_SHIFT 11
> > > #define ASRFSTi_IAEi_MASK (1 << ASRFSTi_IAEi_SHIFT)
> > > #define ASRFSTi_IAEi (1 << ASRFSTi_IAEi_SHIFT)
> > > @@ -432,10 +434,12 @@ struct dma_block {
> > > *
> > > * @use_edma: using edma as dma device or not
> > > * @channel_bits: width of ASRCNCR register for each pair
> > > + * @start_before_dma: start asrc before dma
> > > */
> > > struct fsl_asrc_soc_data {
> > > bool use_edma;
> > > unsigned int channel_bits;
> > > + bool start_before_dma;
> > > };
> > >
> > > /**
> > > diff --git a/sound/soc/fsl/fsl_asrc_common.h b/sound/soc/fsl/fsl_asrc_common.h
> > > index 0cd595b0f629..c8a1a2b5915d 100644
> > > --- a/sound/soc/fsl/fsl_asrc_common.h
> > > +++ b/sound/soc/fsl/fsl_asrc_common.h
> > > @@ -107,6 +107,7 @@ struct fsl_asrc_pair {
> > > * @asrc_rate: default sample rate for ASoC Back-Ends
> > > * @asrc_format: default sample format for ASoC Back-Ends
> > > * @use_edma: edma is used
> > > + * @start_before_dma: start asrc before dma
> > > * @get_dma_channel: function pointer
> > > * @request_pair: function pointer
> > > * @release_pair: function pointer
> > > @@ -116,6 +117,7 @@ struct fsl_asrc_pair {
> > > * @m2m_start: function pointer
> > > * @m2m_unprepare: function pointer
> > > * @m2m_stop: function pointer
> > > + * @m2m_output_ready: function pointer, check output fifo ready or not
> > > * @m2m_calc_out_len: function pointer
> > > * @m2m_get_maxburst: function pointer
> > > * @m2m_pair_suspend: function pointer
> > > @@ -143,6 +145,7 @@ struct fsl_asrc {
> > > int asrc_rate;
> > > snd_pcm_format_t asrc_format;
> > > bool use_edma;
> > > + bool start_before_dma;
> > >
> > > struct dma_chan *(*get_dma_channel)(struct fsl_asrc_pair *pair, bool dir);
> > > int (*request_pair)(int channels, struct fsl_asrc_pair *pair);
> > > @@ -154,6 +157,7 @@ struct fsl_asrc {
> > > int (*m2m_start)(struct fsl_asrc_pair *pair);
> > > int (*m2m_unprepare)(struct fsl_asrc_pair *pair);
> > > int (*m2m_stop)(struct fsl_asrc_pair *pair);
> > > + bool (*m2m_output_ready)(struct fsl_asrc_pair *pair);
> > >
> > > int (*m2m_calc_out_len)(struct fsl_asrc_pair *pair, int input_buffer_length);
> > > int (*m2m_get_maxburst)(u8 dir, struct fsl_asrc_pair *pair);
> > > diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
> > > index f46881f71e43..77999526dd9e 100644
> > > --- a/sound/soc/fsl/fsl_asrc_m2m.c
> > > +++ b/sound/soc/fsl/fsl_asrc_m2m.c
> > > @@ -253,15 +253,21 @@ static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task
> > > reinit_completion(&pair->complete[IN]);
> > > reinit_completion(&pair->complete[OUT]);
> > >
> > > + if (asrc->start_before_dma)
> > > + asrc->m2m_start(pair);
> > > +
> > > /* Submit DMA request */
> > > dmaengine_submit(pair->desc[IN]);
> > > dma_async_issue_pending(pair->desc[IN]->chan);
> > > if (out_dma_len > 0) {
> > > + if (asrc->start_before_dma && asrc->m2m_output_ready)
> > > + asrc->m2m_output_ready(pair);
> > > dmaengine_submit(pair->desc[OUT]);
> > > dma_async_issue_pending(pair->desc[OUT]->chan);
> > > }
> > >
> > > - asrc->m2m_start(pair);
> > > + if (!asrc->start_before_dma)
> > > + asrc->m2m_start(pair);
> > >
> > > if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) {
> > > dev_err(dev, "out DMA task timeout\n");
> > > --
> > > 2.34.1
> > >
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 4/4] ASoC: fsl_asrc_dma: allocate memory from dma device
2026-02-03 3:13 ` [PATCH v3 4/4] ASoC: fsl_asrc_dma: allocate memory from dma device Shengjiu Wang
@ 2026-02-04 16:37 ` Frank Li
0 siblings, 0 replies; 12+ messages in thread
From: Frank Li @ 2026-02-04 16:37 UTC (permalink / raw)
To: Shengjiu Wang
Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, shawnguo, s.hauer,
kernel, festevam, linux-sound, devicetree, imx, linux-arm-kernel,
linux-kernel, shengjiu.wang, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
On Tue, Feb 03, 2026 at 11:13:45AM +0800, Shengjiu Wang wrote:
> The dma-coherent property is used to indicate a device is capable of
> coherent DMA operations. On i.MX952, one of EDMA devices support such
> feature, in order to support the EDMA device, the memory needs to be
> allocated from the DMA device.
>
> The code change here is to make this driver compatible for non
> dma-coherent and dma-coherent dma devices.
Make this driver to support both non dma-coherent and dma-coherent dma
engine.
Remove dma coerce_mask_and coherent() because DMA provider already set it
according to its capability.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Frank
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
> sound/soc/fsl/fsl_asrc_dma.c | 48 ++++++++++++++++++++++++++++++------
> 1 file changed, 41 insertions(+), 7 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
> index 7dacc06b2f02..348b0aabfa68 100644
> --- a/sound/soc/fsl/fsl_asrc_dma.c
> +++ b/sound/soc/fsl/fsl_asrc_dma.c
> @@ -449,18 +449,52 @@ fsl_asrc_dma_pcm_pointer(struct snd_soc_component *component,
> static int fsl_asrc_dma_pcm_new(struct snd_soc_component *component,
> struct snd_soc_pcm_runtime *rtd)
> {
> - struct snd_card *card = rtd->card->snd_card;
> + struct device *dev = component->dev;
> + struct fsl_asrc *asrc = dev_get_drvdata(dev);
> + struct fsl_asrc_pair *pair;
> struct snd_pcm *pcm = rtd->pcm;
> + struct dma_chan *chan;
> int ret;
>
> - ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> - if (ret) {
> - dev_err(card->dev, "failed to set DMA mask\n");
> - return ret;
> + pair = kzalloc(size_add(sizeof(*pair), asrc->pair_priv_size), GFP_KERNEL);
> + if (!pair)
> + return -ENOMEM;
> +
> + pair->asrc = asrc;
> + pair->private = (void *)pair + sizeof(struct fsl_asrc_pair);
> +
> + /* Request a pair, which will be released later.
> + * Request pair function needs channel num as input, for this
> + * pair, we just request "1" channel temporarily.
> + */
> + ret = asrc->request_pair(1, pair);
> + if (ret < 0) {
> + dev_err(dev, "failed to request asrc pair\n");
> + goto req_pair_err;
> + }
> +
> + /* Request a dma channel, which will be released later. */
> + chan = asrc->get_dma_channel(pair, IN);
> + if (!chan) {
> + dev_err(dev, "failed to get dma channel\n");
> + ret = -EINVAL;
> + goto dma_chan_err;
> }
>
> - return snd_pcm_set_fixed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
> - card->dev, FSL_ASRC_DMABUF_SIZE);
> + ret = snd_pcm_set_fixed_buffer_all(pcm,
> + SNDRV_DMA_TYPE_DEV,
> + chan->device->dev,
> + FSL_ASRC_DMABUF_SIZE);
> +
> + dma_release_channel(chan);
> +
> +dma_chan_err:
> + asrc->release_pair(pair);
> +
> +req_pair_err:
> + kfree(pair);
> +
> + return ret;
> }
>
> struct snd_soc_component_driver fsl_asrc_component = {
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M
2026-02-04 16:30 ` Frank Li
@ 2026-02-05 2:36 ` Shengjiu Wang
0 siblings, 0 replies; 12+ messages in thread
From: Shengjiu Wang @ 2026-02-05 2:36 UTC (permalink / raw)
To: Frank Li
Cc: Shengjiu Wang, lgirdwood, broonie, robh, krzk+dt, conor+dt,
shawnguo, s.hauer, kernel, festevam, linux-sound, devicetree, imx,
linux-arm-kernel, linux-kernel, Xiubo.Lee, nicoleotsuka, perex,
tiwai, linuxppc-dev
On Thu, Feb 5, 2026 at 12:30 AM Frank Li <Frank.li@nxp.com> wrote:
>
> On Wed, Feb 04, 2026 at 09:41:55AM +0800, Shengjiu Wang wrote:
> > On Wed, Feb 4, 2026 at 1:53 AM Frank Li <Frank.li@nxp.com> wrote:
> > >
> > > On Tue, Feb 03, 2026 at 11:13:43AM +0800, Shengjiu Wang wrote:
> > > > There is a limitation on i.MX952 that dma request is not cleared at the
> > > > end of conversion with dma slave mode. Which causes sample is dropped
> > > > from the input fifo on the second time if dma is triggered before the
> > > > client device and EDMA may copy wrong data from output fifo as the output
> > > > fifo is not ready in the beginning.
> > > >
> > > > The solution is to trigger asrc before dma on i.MX952, and add delay to
> > > > wait output data is generated then start the EDMA for output, otherwise
> > > > the m2m function has noise issues.
> > > >
> > > > So add an option to start ASRC first for M2M before ASRC is enabled on
> > > > i.MX952.
> > > >
> > > > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> > > > ---
> > > > sound/soc/fsl/fsl_asrc.c | 23 +++++++++++++++++++++++
> > > > sound/soc/fsl/fsl_asrc.h | 4 ++++
> > > > sound/soc/fsl/fsl_asrc_common.h | 4 ++++
> > > > sound/soc/fsl/fsl_asrc_m2m.c | 8 +++++++-
> > > > 4 files changed, 38 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> > > > index 92fb16f7be45..b6d4f1e09e2e 100644
> > > > --- a/sound/soc/fsl/fsl_asrc.c
> > > > +++ b/sound/soc/fsl/fsl_asrc.c
> > > > @@ -1078,6 +1078,27 @@ static unsigned int fsl_asrc_get_output_fifo_size(struct fsl_asrc_pair *pair)
> > > > return val >> ASRFSTi_OUTPUT_FIFO_SHIFT;
> > > > }
> > > >
> > > > +static bool fsl_asrc_m2m_output_ready(struct fsl_asrc_pair *pair)
> > > > +{
> > > > + struct fsl_asrc *asrc = pair->asrc;
> > > > + enum asrc_pair_index index = pair->index;
> > > > + int retry = 1000;
> > > > + u32 val;
> > > > + int ret;
> > > > +
> > > > + /* Check output fifo status if it exceeds the watermark. */
> > > > + ret = regmap_read_poll_timeout(asrc->regmap, REG_ASRFST(index), val,
> > > > + (ASRFSTi_OUTPUT_FIFO_FILL(val) >= ASRC_M2M_OUTPUTFIFO_WML) ||
> > > > + (--retry == 0), 0, USEC_PER_SEC);
> > >
> > > are sure need "retry"? there are timeout, which should be equal to 'retry'.
> >
> > Yes, "retry" is what I want, timeout is not what I expected.
>
> Okay, but it will be strange. you polling a register, you suppose it will
> be finished below 1000 IO read, which is certain time in SoC, for example
> 1ms. Compare to timeout us value, 1000 is hard to understand why you choose
> this value.
It can be removed by reducing the timeout time.
will update in the next version.
best regards
Shengjiu Wang
>
> Frank
> >
> > Best regards
> > Shengjiu Wang
> >
> > >
> > > Frank
> > > > +
> > > > + if (ret || !retry) {
> > > > + pair_warn("output is not ready\n");
> > > > + return false;
> > > > + }
> > > > +
> > > > + return true;
> > > > +}
> > > > +
> > > > static int fsl_asrc_m2m_prepare(struct fsl_asrc_pair *pair)
> > > > {
> > > > struct fsl_asrc_pair_priv *pair_priv = pair->private;
> > > > @@ -1275,6 +1296,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
> > > >
> > > > asrc_priv->soc = of_device_get_match_data(&pdev->dev);
> > > > asrc->use_edma = asrc_priv->soc->use_edma;
> > > > + asrc->start_before_dma = asrc_priv->soc->start_before_dma;
> > > > asrc->get_dma_channel = fsl_asrc_get_dma_channel;
> > > > asrc->request_pair = fsl_asrc_request_pair;
> > > > asrc->release_pair = fsl_asrc_release_pair;
> > > > @@ -1289,6 +1311,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
> > > > asrc->m2m_get_maxburst = fsl_asrc_m2m_get_maxburst;
> > > > asrc->m2m_pair_resume = fsl_asrc_m2m_pair_resume;
> > > > asrc->m2m_get_cap = fsl_asrc_m2m_get_cap;
> > > > + asrc->m2m_output_ready = fsl_asrc_m2m_output_ready;
> > > >
> > > > if (of_device_is_compatible(np, "fsl,imx35-asrc")) {
> > > > asrc_priv->clk_map[IN] = input_clk_map_imx35;
> > > > diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h
> > > > index 1c492eb237f5..60b6865ca952 100644
> > > > --- a/sound/soc/fsl/fsl_asrc.h
> > > > +++ b/sound/soc/fsl/fsl_asrc.h
> > > > @@ -257,6 +257,8 @@
> > > > #define ASRFSTi_OUTPUT_FIFO_WIDTH 7
> > > > #define ASRFSTi_OUTPUT_FIFO_SHIFT 12
> > > > #define ASRFSTi_OUTPUT_FIFO_MASK (((1 << ASRFSTi_OUTPUT_FIFO_WIDTH) - 1) << ASRFSTi_OUTPUT_FIFO_SHIFT)
> > > > +#define ASRFSTi_OUTPUT_FIFO_FILL(v) \
> > > > + (((v) & ASRFSTi_OUTPUT_FIFO_MASK) >> ASRFSTi_OUTPUT_FIFO_SHIFT)
> > > > #define ASRFSTi_IAEi_SHIFT 11
> > > > #define ASRFSTi_IAEi_MASK (1 << ASRFSTi_IAEi_SHIFT)
> > > > #define ASRFSTi_IAEi (1 << ASRFSTi_IAEi_SHIFT)
> > > > @@ -432,10 +434,12 @@ struct dma_block {
> > > > *
> > > > * @use_edma: using edma as dma device or not
> > > > * @channel_bits: width of ASRCNCR register for each pair
> > > > + * @start_before_dma: start asrc before dma
> > > > */
> > > > struct fsl_asrc_soc_data {
> > > > bool use_edma;
> > > > unsigned int channel_bits;
> > > > + bool start_before_dma;
> > > > };
> > > >
> > > > /**
> > > > diff --git a/sound/soc/fsl/fsl_asrc_common.h b/sound/soc/fsl/fsl_asrc_common.h
> > > > index 0cd595b0f629..c8a1a2b5915d 100644
> > > > --- a/sound/soc/fsl/fsl_asrc_common.h
> > > > +++ b/sound/soc/fsl/fsl_asrc_common.h
> > > > @@ -107,6 +107,7 @@ struct fsl_asrc_pair {
> > > > * @asrc_rate: default sample rate for ASoC Back-Ends
> > > > * @asrc_format: default sample format for ASoC Back-Ends
> > > > * @use_edma: edma is used
> > > > + * @start_before_dma: start asrc before dma
> > > > * @get_dma_channel: function pointer
> > > > * @request_pair: function pointer
> > > > * @release_pair: function pointer
> > > > @@ -116,6 +117,7 @@ struct fsl_asrc_pair {
> > > > * @m2m_start: function pointer
> > > > * @m2m_unprepare: function pointer
> > > > * @m2m_stop: function pointer
> > > > + * @m2m_output_ready: function pointer, check output fifo ready or not
> > > > * @m2m_calc_out_len: function pointer
> > > > * @m2m_get_maxburst: function pointer
> > > > * @m2m_pair_suspend: function pointer
> > > > @@ -143,6 +145,7 @@ struct fsl_asrc {
> > > > int asrc_rate;
> > > > snd_pcm_format_t asrc_format;
> > > > bool use_edma;
> > > > + bool start_before_dma;
> > > >
> > > > struct dma_chan *(*get_dma_channel)(struct fsl_asrc_pair *pair, bool dir);
> > > > int (*request_pair)(int channels, struct fsl_asrc_pair *pair);
> > > > @@ -154,6 +157,7 @@ struct fsl_asrc {
> > > > int (*m2m_start)(struct fsl_asrc_pair *pair);
> > > > int (*m2m_unprepare)(struct fsl_asrc_pair *pair);
> > > > int (*m2m_stop)(struct fsl_asrc_pair *pair);
> > > > + bool (*m2m_output_ready)(struct fsl_asrc_pair *pair);
> > > >
> > > > int (*m2m_calc_out_len)(struct fsl_asrc_pair *pair, int input_buffer_length);
> > > > int (*m2m_get_maxburst)(u8 dir, struct fsl_asrc_pair *pair);
> > > > diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
> > > > index f46881f71e43..77999526dd9e 100644
> > > > --- a/sound/soc/fsl/fsl_asrc_m2m.c
> > > > +++ b/sound/soc/fsl/fsl_asrc_m2m.c
> > > > @@ -253,15 +253,21 @@ static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task
> > > > reinit_completion(&pair->complete[IN]);
> > > > reinit_completion(&pair->complete[OUT]);
> > > >
> > > > + if (asrc->start_before_dma)
> > > > + asrc->m2m_start(pair);
> > > > +
> > > > /* Submit DMA request */
> > > > dmaengine_submit(pair->desc[IN]);
> > > > dma_async_issue_pending(pair->desc[IN]->chan);
> > > > if (out_dma_len > 0) {
> > > > + if (asrc->start_before_dma && asrc->m2m_output_ready)
> > > > + asrc->m2m_output_ready(pair);
> > > > dmaengine_submit(pair->desc[OUT]);
> > > > dma_async_issue_pending(pair->desc[OUT]->chan);
> > > > }
> > > >
> > > > - asrc->m2m_start(pair);
> > > > + if (!asrc->start_before_dma)
> > > > + asrc->m2m_start(pair);
> > > >
> > > > if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) {
> > > > dev_err(dev, "out DMA task timeout\n");
> > > > --
> > > > 2.34.1
> > > >
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-02-05 2:36 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03 3:13 [PATCH v3 0/4] ASoC: fsl_asrc: support the i.MX952 platform Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 1/4] ASoC: dt-bindings: fsl,imx-asrc: Add support for " Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 2/4] ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M Shengjiu Wang
2026-02-03 8:35 ` Daniel Baluta
2026-02-03 17:53 ` Frank Li
2026-02-04 1:41 ` Shengjiu Wang
2026-02-04 16:30 ` Frank Li
2026-02-05 2:36 ` Shengjiu Wang
2026-02-03 3:13 ` [PATCH v3 3/4] ASoC: fsl_asrc: Add support for i.MX952 platform Shengjiu Wang
2026-02-03 8:36 ` Daniel Baluta
2026-02-03 3:13 ` [PATCH v3 4/4] ASoC: fsl_asrc_dma: allocate memory from dma device Shengjiu Wang
2026-02-04 16:37 ` Frank Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox