[PATCH v2 0/2] ASoC: simple-card: make sysclk ordering configurable

Stefano Radaelli posted 2 patches 8 hours ago
.../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(-)
[PATCH v2 0/2] ASoC: simple-card: make sysclk ordering configurable
Posted by Stefano Radaelli 8 hours ago
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