public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
* [PATCH 0/5] ASoC: fsl-asoc-card: Add some improvements
@ 2026-04-24 10:38 Shengjiu Wang
  2026-04-24 10:38 ` [PATCH 1/5] ASoC: fsl-asoc-card: enable dpcm_merged_chan flag for ASRC frontend Shengjiu Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Shengjiu Wang @ 2026-04-24 10:38 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

This patch series addresses several issues in the Freescale Generic ASoC
Sound Card driver related to hardware limitations, DPCM path switching,
and codec-specific constraints.

The fsl-asoc-card driver provides a generic machine driver for i.MX SoCs,
supporting various codecs and optional ASRC (Asynchronous Sample Rate
Converter) for sample rate conversion. During testing several issues were
identified:

1. Missing channel constraint propagation in DPCM mode
2. DPCM path switching causing audio dropouts
3. Hardware channel alignment requirements
4. Clock generation limitations preventing certain audio formats
5. Codec-specific PLL frequency violations

Shengjiu Wang (5):
  ASoC: fsl-asoc-card: enable dpcm_merged_chan flag for ASRC frontend
  ASoC: fsl-asoc-card: enable ignore_pmdown_time for ASRC case
  ASoC: fsl-asoc-card: add channel and rate constraints for CS42888
  ASoC: fsl-asoc-card: exclude S20_3LE format due to clock limitations
  ASoC: fsl-asoc-card: reduce WM8904 PLL ratio to meet frequency limit

 sound/soc/fsl/fsl-asoc-card.c | 88 ++++++++++++++++++++++++++++++++++-
 1 file changed, 87 insertions(+), 1 deletion(-)

-- 
2.34.1



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

* [PATCH 1/5] ASoC: fsl-asoc-card: enable dpcm_merged_chan flag for ASRC frontend
  2026-04-24 10:38 [PATCH 0/5] ASoC: fsl-asoc-card: Add some improvements Shengjiu Wang
@ 2026-04-24 10:38 ` Shengjiu Wang
  2026-04-24 10:38 ` [PATCH 2/5] ASoC: fsl-asoc-card: enable ignore_pmdown_time for ASRC case Shengjiu Wang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Shengjiu Wang @ 2026-04-24 10:38 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

When using ASRC in DPCM mode, the backend DAI (codec) may have channel
constraints that differ from the frontend. For example, the ASRC can
support 1-8 channels, but the codec might only support stereo (2 channels).

Without dpcm_merged_chan, userspace can open the frontend with unsupported
channel counts, leading to errors when the backend is configured.

Enable dpcm_merged_chan to merge backend channel constraints to the
frontend, ensuring userspace only sees valid channel configurations.

This fixes issues where applications attempt to use channel counts
that the backend codec doesn't support.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 70a6159430ed..41cd2fc2ea56 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -989,6 +989,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 
 	if (asrc_pdev) {
 		/* DPCM DAI Links only if ASRC exists */
+		priv->dai_link[1].dpcm_merged_chan = 1;
 		priv->dai_link[1].cpus->of_node = asrc_np;
 		priv->dai_link[1].platforms->of_node = asrc_np;
 		for_each_link_codecs((&(priv->dai_link[2])), codec_idx, codec_comp) {
-- 
2.34.1



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

* [PATCH 2/5] ASoC: fsl-asoc-card: enable ignore_pmdown_time for ASRC case
  2026-04-24 10:38 [PATCH 0/5] ASoC: fsl-asoc-card: Add some improvements Shengjiu Wang
  2026-04-24 10:38 ` [PATCH 1/5] ASoC: fsl-asoc-card: enable dpcm_merged_chan flag for ASRC frontend Shengjiu Wang
@ 2026-04-24 10:38 ` Shengjiu Wang
  2026-04-24 10:38 ` [PATCH 3/5] ASoC: fsl-asoc-card: add channel and rate constraints for CS42888 Shengjiu Wang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Shengjiu Wang @ 2026-04-24 10:38 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

Problem:
When switching from ASRC path (hw:0,1) to direct path (hw:0,0),
audio stops after 5 seconds due to DAPM powering down shared widgets.

Scenario:
1. Play on hw:0,1 (ASRC): ASRC-Playback → CPU-Playback → Codec
2. Stop playback
3. Play on hw:0,0 (Direct): CPU-Playback → Codec
4. After 5s: No sound (DAPM powered down CPU-Playback)

Root Cause:
DAPM sees ASRC-Playback disconnected and powers down the entire
path including CPU-Playback, even though CPU-Playback is still
needed for the direct path.

Solution:
Enable ignore_pmdown_time for DPCM links to prevent premature
widget power-down when switching between paths.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 41cd2fc2ea56..e08e135886f7 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -990,6 +990,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 	if (asrc_pdev) {
 		/* DPCM DAI Links only if ASRC exists */
 		priv->dai_link[1].dpcm_merged_chan = 1;
+		priv->dai_link[1].ignore_pmdown_time = 1;
 		priv->dai_link[1].cpus->of_node = asrc_np;
 		priv->dai_link[1].platforms->of_node = asrc_np;
 		for_each_link_codecs((&(priv->dai_link[2])), codec_idx, codec_comp) {
@@ -999,6 +1000,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 		}
 		priv->dai_link[2].cpus->of_node = cpu_np;
 		priv->dai_link[2].dai_fmt = priv->dai_fmt;
+		priv->dai_link[2].ignore_pmdown_time = 1;
 		priv->card.num_links = 3;
 
 		ret = of_property_read_u32(asrc_np, "fsl,asrc-rate",
-- 
2.34.1



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

* [PATCH 3/5] ASoC: fsl-asoc-card: add channel and rate constraints for CS42888
  2026-04-24 10:38 [PATCH 0/5] ASoC: fsl-asoc-card: Add some improvements Shengjiu Wang
  2026-04-24 10:38 ` [PATCH 1/5] ASoC: fsl-asoc-card: enable dpcm_merged_chan flag for ASRC frontend Shengjiu Wang
  2026-04-24 10:38 ` [PATCH 2/5] ASoC: fsl-asoc-card: enable ignore_pmdown_time for ASRC case Shengjiu Wang
@ 2026-04-24 10:38 ` Shengjiu Wang
  2026-04-24 16:09   ` Mark Brown
  2026-04-24 10:38 ` [PATCH 4/5] ASoC: fsl-asoc-card: exclude S20_3LE format due to clock limitations Shengjiu Wang
  2026-04-24 10:38 ` [PATCH 5/5] ASoC: fsl-asoc-card: reduce WM8904 PLL ratio to meet frequency limit Shengjiu Wang
  4 siblings, 1 reply; 8+ messages in thread
From: Shengjiu Wang @ 2026-04-24 10:38 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

The CS42888 codec has 4 I2S lanes with 2 channels per lane. Using odd
channel counts (3, 5, 7) causes data misalignment in the I2S frame,
resulting in incorrect channel mapping. Only mono and even channel
counts (1, 2, 4, 6, 8) work correctly.

Additionally, the fixed system clock on i.MX platforms limits supported
sample rates. With 12.288 MHz MCLK, only 48kHz family rates (48k, 96k,
192k) achieve valid MCLK:LRCK ratios. With 11.2896 MHz MCLK, only 44k
family rates are supported.

Add a startup callback to apply PCM constraints for both channels and
rates, preventing userspace from requesting unsupported configurations.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 67 +++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index e08e135886f7..50d7a5f2d79e 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -40,6 +40,18 @@
 /* Default DAI format without Master and Slave flag */
 #define DAI_FMT_BASE (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF)
 
+static const u32 cs42888_rates_48k[] = {
+	48000, 96000, 192000,
+};
+
+static const u32 cs42888_rates_44k[] = {
+	44100, 88200, 176400,
+};
+
+static const u32 cs42888_channels[] = {
+	1, 2, 4, 6, 8,
+};
+
 /**
  * struct codec_priv - CODEC private data
  * @mclk: Main clock of the CODEC
@@ -93,6 +105,10 @@ struct cpu_priv {
  * @asrc_rate: ASRC sample rate used by Back-Ends
  * @asrc_format: ASRC sample format used by Back-Ends
  * @dai_fmt: DAI format between CPU and CODEC
+ * @support_rates: array of supported rates
+ * @support_channels: array of supported channels
+ * @num_rates: Number of entries in support_rates array
+ * @num_channels: Number of entries in support_channels array
  * @name: Card name
  */
 
@@ -110,6 +126,10 @@ struct fsl_asoc_card_priv {
 	u32 asrc_rate;
 	snd_pcm_format_t asrc_format;
 	u32 dai_fmt;
+	const u32 *support_rates;
+	const u32 *support_channels;
+	u32 num_rates;
+	u32 num_channels;
 	char name[32];
 };
 
@@ -291,7 +311,41 @@ static int fsl_asoc_card_hw_free(struct snd_pcm_substream *substream)
 	return 0;
 }
 
+static int fsl_asoc_card_startup(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+	struct snd_pcm_runtime *runtime = substream->runtime;
+	static struct snd_pcm_hw_constraint_list constraint_rates;
+	static struct snd_pcm_hw_constraint_list constraint_channels;
+	int ret;
+
+	constraint_channels.list = priv->support_channels;
+	constraint_channels.count = priv->num_channels;
+	constraint_rates.list = priv->support_rates;
+	constraint_rates.count = priv->num_rates;
+
+	if (constraint_channels.count) {
+		ret = snd_pcm_hw_constraint_list(runtime, 0,
+						 SNDRV_PCM_HW_PARAM_CHANNELS,
+						 &constraint_channels);
+		if (ret)
+			return ret;
+	}
+
+	if (constraint_rates.count) {
+		ret = snd_pcm_hw_constraint_list(runtime, 0,
+						 SNDRV_PCM_HW_PARAM_RATE,
+						 &constraint_rates);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_ops fsl_asoc_card_ops = {
+	.startup = fsl_asoc_card_startup,
 	.hw_params = fsl_asoc_card_hw_params,
 	.hw_free = fsl_asoc_card_hw_free,
 };
@@ -753,6 +807,19 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 		priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;
 		priv->cpu_priv.slot_width = 32;
 		priv->dai_fmt |= SND_SOC_DAIFMT_CBC_CFC;
+		priv->support_channels = cs42888_channels;
+		priv->num_channels = ARRAY_SIZE(cs42888_channels);
+		if (priv->codec_priv[0].mclk_freq % 12288000 == 0) {
+			priv->support_rates = cs42888_rates_48k;
+			priv->num_rates = ARRAY_SIZE(cs42888_rates_48k);
+		} else if (priv->codec_priv[0].mclk_freq % 11289600 == 0) {
+			priv->support_rates = cs42888_rates_44k;
+			priv->num_rates = ARRAY_SIZE(cs42888_rates_44k);
+		} else {
+			/* Unknown MCLK, no rate constraints */
+			dev_warn(&pdev->dev, "Unknown MCLK frequency %lu, no rate constraints\n",
+				 priv->codec_priv[0].mclk_freq);
+		}
 	} else if (of_device_is_compatible(np, "fsl,imx-audio-cs427x")) {
 		codec_dai_name[0] = "cs4271-hifi";
 		priv->codec_priv[0].mclk_id = CS427x_SYSCLK_MCLK;
-- 
2.34.1



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

* [PATCH 4/5] ASoC: fsl-asoc-card: exclude S20_3LE format due to clock limitations
  2026-04-24 10:38 [PATCH 0/5] ASoC: fsl-asoc-card: Add some improvements Shengjiu Wang
                   ` (2 preceding siblings ...)
  2026-04-24 10:38 ` [PATCH 3/5] ASoC: fsl-asoc-card: add channel and rate constraints for CS42888 Shengjiu Wang
@ 2026-04-24 10:38 ` Shengjiu Wang
  2026-04-24 10:38 ` [PATCH 5/5] ASoC: fsl-asoc-card: reduce WM8904 PLL ratio to meet frequency limit Shengjiu Wang
  4 siblings, 0 replies; 8+ messages in thread
From: Shengjiu Wang @ 2026-04-24 10:38 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

The S20_3LE format (20-bit samples in 3 bytes) requires bit clock
frequencies that cannot be generated by i.MX SAI/ESAI hardware.

SAI/ESAI derive BCLK from MCLK using integer dividers only. S20_3LE
requires non-integer divider ratios with standard MCLK frequencies.
For example, 48kHz stereo needs 1.920 MHz BCLK, which requires a
divider of 6.4 from 12.288 MHz MCLK (not an integer).

Add a format constraint to exclude S20_3LE, preventing clock
configuration failures. Users should use S16_LE, S24_LE, or S32_LE
instead.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 50d7a5f2d79e..36c789f15582 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -320,6 +320,16 @@ static int fsl_asoc_card_startup(struct snd_pcm_substream *substream)
 	static struct snd_pcm_hw_constraint_list constraint_channels;
 	int ret;
 
+	/*
+	 * Remove S20_3LE as the clock (sysclk, bclk) can't be acquired
+	 * due to non-integer divider ratios.
+	 */
+	ret = snd_pcm_hw_constraint_mask64(runtime,
+					   SNDRV_PCM_HW_PARAM_FORMAT,
+					   ~SNDRV_PCM_FMTBIT_S20_3LE);
+	if (ret)
+		return ret;
+
 	constraint_channels.list = priv->support_channels;
 	constraint_channels.count = priv->num_channels;
 	constraint_rates.list = priv->support_rates;
-- 
2.34.1



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

* [PATCH 5/5] ASoC: fsl-asoc-card: reduce WM8904 PLL ratio to meet frequency limit
  2026-04-24 10:38 [PATCH 0/5] ASoC: fsl-asoc-card: Add some improvements Shengjiu Wang
                   ` (3 preceding siblings ...)
  2026-04-24 10:38 ` [PATCH 4/5] ASoC: fsl-asoc-card: exclude S20_3LE format due to clock limitations Shengjiu Wang
@ 2026-04-24 10:38 ` Shengjiu Wang
  4 siblings, 0 replies; 8+ messages in thread
From: Shengjiu Wang @ 2026-04-24 10:38 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

WM8904 has a 27 MHz PLL frequency limit. The current S24_LE PLL ratio
of 384 exceeds this at high sample rates (96 kHz × 384 = 36.864 MHz).

Reduce the ratio to 192 for WM8904, keeping PLL within limits at all
supported rates (96 kHz × 192 = 18.432 MHz).

Add codec-specific pll_ratio_s24 field, default 384, override to 192
for WM8904.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 36c789f15582..e72ce2fa9e9e 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -60,6 +60,9 @@ static const u32 cs42888_channels[] = {
  * @mclk_id: MCLK (or main clock) id for set_sysclk()
  * @fll_id: FLL (or secordary clock) id for set_sysclk()
  * @pll_id: PLL id for set_pll()
+ * @pll_ratio_s24: PLL output ratio for S24_LE format (PLL_freq = sample_rate × ratio)
+ *                 Default is 384, but some codecs (e.g., WM8904) require lower values
+ *                 to stay within PLL frequency limits
  */
 struct codec_priv {
 	struct clk *mclk;
@@ -68,6 +71,7 @@ struct codec_priv {
 	u32 mclk_id;
 	int fll_id;
 	int pll_id;
+	int pll_ratio_s24;
 };
 
 /**
@@ -242,7 +246,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
 
 		if (codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) {
 			if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE)
-				pll_out = priv->sample_rate * 384;
+				pll_out = priv->sample_rate * codec_priv->pll_ratio_s24;
 			else
 				pll_out = priv->sample_rate * 256;
 
@@ -806,6 +810,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 	for (codec_idx = 0; codec_idx < 2; codec_idx++) {
 		priv->codec_priv[codec_idx].fll_id = -1;
 		priv->codec_priv[codec_idx].pll_id = -1;
+		priv->codec_priv[codec_idx].pll_ratio_s24 = 384;
 	}
 
 	/* Diversify the card configurations */
@@ -912,6 +917,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 		priv->codec_priv[0].mclk_id = WM8904_FLL_MCLK;
 		priv->codec_priv[0].fll_id = WM8904_CLK_FLL;
 		priv->codec_priv[0].pll_id = WM8904_FLL_MCLK;
+		priv->codec_priv[0].pll_ratio_s24 = 192;
 		priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP;
 	} else if (of_device_is_compatible(np, "fsl,imx-audio-spdif")) {
 		ret = fsl_asoc_card_spdif_init(codec_np, cpu_np, codec_dai_name, priv);
-- 
2.34.1



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

* Re: [PATCH 3/5] ASoC: fsl-asoc-card: add channel and rate constraints for CS42888
  2026-04-24 10:38 ` [PATCH 3/5] ASoC: fsl-asoc-card: add channel and rate constraints for CS42888 Shengjiu Wang
@ 2026-04-24 16:09   ` Mark Brown
  2026-04-27 10:47     ` Shengjiu Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2026-04-24 16:09 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

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

On Fri, Apr 24, 2026 at 06:38:04PM +0800, Shengjiu Wang wrote:

> The CS42888 codec has 4 I2S lanes with 2 channels per lane. Using odd
> channel counts (3, 5, 7) causes data misalignment in the I2S frame,
> resulting in incorrect channel mapping. Only mono and even channel
> counts (1, 2, 4, 6, 8) work correctly.

> +static int fsl_asoc_card_startup(struct snd_pcm_substream *substream)
> +{
> +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> +	struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card);
> +	struct snd_pcm_runtime *runtime = substream->runtime;
> +	static struct snd_pcm_hw_constraint_list constraint_rates;
> +	static struct snd_pcm_hw_constraint_list constraint_channels;

This makes the constraints global for all substreams, given that the
Freescale SoCs tend to have multiple DAIs and have things like direct
PDM inputs I'd expect it'd be relatively common to have disjoint
constraints.

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

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

* Re: [PATCH 3/5] ASoC: fsl-asoc-card: add channel and rate constraints for CS42888
  2026-04-24 16:09   ` Mark Brown
@ 2026-04-27 10:47     ` Shengjiu Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Shengjiu Wang @ 2026-04-27 10:47 UTC (permalink / raw)
  To: Mark Brown
  Cc: Shengjiu Wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

On Sat, Apr 25, 2026 at 12:09 AM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Apr 24, 2026 at 06:38:04PM +0800, Shengjiu Wang wrote:
>
> > The CS42888 codec has 4 I2S lanes with 2 channels per lane. Using odd
> > channel counts (3, 5, 7) causes data misalignment in the I2S frame,
> > resulting in incorrect channel mapping. Only mono and even channel
> > counts (1, 2, 4, 6, 8) work correctly.
>
> > +static int fsl_asoc_card_startup(struct snd_pcm_substream *substream)
> > +{
> > +     struct snd_soc_pcm_runtime *rtd = substream->private_data;
> > +     struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card);
> > +     struct snd_pcm_runtime *runtime = substream->runtime;
> > +     static struct snd_pcm_hw_constraint_list constraint_rates;
> > +     static struct snd_pcm_hw_constraint_list constraint_channels;
>
> This makes the constraints global for all substreams, given that the
> Freescale SoCs tend to have multiple DAIs and have things like direct
> PDM inputs I'd expect it'd be relatively common to have disjoint
> constraints.

Thanks for the comments.  I will refine it.

Best regards
Shengjiu Wang


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

end of thread, other threads:[~2026-04-27 10:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24 10:38 [PATCH 0/5] ASoC: fsl-asoc-card: Add some improvements Shengjiu Wang
2026-04-24 10:38 ` [PATCH 1/5] ASoC: fsl-asoc-card: enable dpcm_merged_chan flag for ASRC frontend Shengjiu Wang
2026-04-24 10:38 ` [PATCH 2/5] ASoC: fsl-asoc-card: enable ignore_pmdown_time for ASRC case Shengjiu Wang
2026-04-24 10:38 ` [PATCH 3/5] ASoC: fsl-asoc-card: add channel and rate constraints for CS42888 Shengjiu Wang
2026-04-24 16:09   ` Mark Brown
2026-04-27 10:47     ` Shengjiu Wang
2026-04-24 10:38 ` [PATCH 4/5] ASoC: fsl-asoc-card: exclude S20_3LE format due to clock limitations Shengjiu Wang
2026-04-24 10:38 ` [PATCH 5/5] ASoC: fsl-asoc-card: reduce WM8904 PLL ratio to meet frequency limit Shengjiu Wang

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