Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ASoC: simple-card: make sysclk ordering configurable
@ 2026-02-10 16:45 Stefano Radaelli
  2026-02-10 16:45 ` [PATCH v2 1/2] dt-bindings: sound: simple-card: add sysclk-cpu-first flag Stefano Radaelli
  2026-02-10 16:45 ` [PATCH v2 2/2] ASoC: simple-card-utils: add selectable sysclk ordering Stefano Radaelli
  0 siblings, 2 replies; 5+ messages in thread
From: Stefano Radaelli @ 2026-02-10 16:45 UTC (permalink / raw)
  To: Kuninori Morimoto, linux-sound, linux-kernel
  Cc: Mark Brown, Liam Girdwood, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jaroslav Kysela, Takashi Iwai, alexander.h,
	pierluigi.p, Stefano Radaelli

This patch series addresses an issue in simple-audio-card where the
ordering of sysclk configuration between CPU and codec DAIs can affect
the initial playback behaviour on some platforms.

Some CPU DAIs finalize the MCLK rate as part of their set_sysclk()
callback. If the codec sysclk is configured before the CPU DAI applies
the final MCLK rate, the codec may base its internal clocking on a
non-final MCLK value, resulting in incorrect clocking on the first
playback after boot.

This was observed on i.MX95 systems using fsl_sai, but the issue is
generic and can affect any setup where the CPU DAI adjusts the MCLK rate
in set_sysclk().

Instead of changing the ordering unconditionally, this series keeps the
existing default behaviour (codec-first) and introduces a DT flag that
allows selecting CPU-first sysclk ordering where required. This makes
the behaviour configurable on a per-card or per-link basis while
avoiding regressions on existing systems.

Patch 1 documents the new DT binding.
Patch 2 implements the selectable sysclk ordering in simple-audio-card.

v2:
- Do not change the default sysclk ordering
- Make the ordering selectable via DT flag
- Add DT binding documentation

v1:
Link: https://patchwork.kernel.org/project/alsa-devel/patch/20260206134014.143057-1-stefano.r@variscite.com/

Stefano Radaelli (2):
  dt-bindings: sound: simple-card: add sysclk-cpu-first flag
  ASoC: simple-card-utils: add selectable sysclk ordering

 .../bindings/sound/simple-card.yaml           | 11 ++++++
 include/sound/simple_card_utils.h             |  1 +
 sound/soc/generic/simple-card-utils.c         | 39 +++++++++++++------
 sound/soc/generic/simple-card.c               |  7 ++++
 4 files changed, 47 insertions(+), 11 deletions(-)


base-commit: b7ff7151e653aa296ab6c5495b2c1ab7c21eb250
-- 
2.47.3


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

end of thread, other threads:[~2026-02-11  9:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 16:45 [PATCH v2 0/2] ASoC: simple-card: make sysclk ordering configurable Stefano Radaelli
2026-02-10 16:45 ` [PATCH v2 1/2] dt-bindings: sound: simple-card: add sysclk-cpu-first flag Stefano Radaelli
2026-02-11  6:23   ` Krzysztof Kozlowski
2026-02-11  9:18     ` Stefano Radaelli
2026-02-10 16:45 ` [PATCH v2 2/2] ASoC: simple-card-utils: add selectable sysclk ordering Stefano Radaelli

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