Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Stefano Radaelli <stefano.radaelli21@gmail.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alexander.h@variscite.com, pierluigi.p@variscite.com,
	Stefano Radaelli <stefano.r@variscite.com>
Subject: [PATCH v2 1/2] dt-bindings: sound: simple-card: add sysclk-cpu-first flag
Date: Tue, 10 Feb 2026 17:45:05 +0100	[thread overview]
Message-ID: <20260210164506.161810-2-stefano.r@variscite.com> (raw)
In-Reply-To: <20260210164506.161810-1-stefano.r@variscite.com>

From: Stefano Radaelli <stefano.r@variscite.com>

The simple-audio-card driver can program sysclk for CPU and codec DAIs
during hw_params. Some setups require calling the CPU DAI sysclk first
so that the codec sees the final MCLK rate.

Document a new boolean DT flag, sysclk-cpu-first, which allows selecting
CPU-first sysclk ordering where needed. The property is supported both
as a top-level simple-audio-card property (prefixed) and on dai-link
subnodes (non-prefixed).

Signed-off-by: Stefano Radaelli <stefano.r@variscite.com>
---
 .../devicetree/bindings/sound/simple-card.yaml        | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/simple-card.yaml b/Documentation/devicetree/bindings/sound/simple-card.yaml
index 533d0a1da56e..ddad440636be 100644
--- a/Documentation/devicetree/bindings/sound/simple-card.yaml
+++ b/Documentation/devicetree/bindings/sound/simple-card.yaml
@@ -35,6 +35,13 @@ definitions:
     description: see tdm-slot.txt.
     $ref: /schemas/types.yaml#/definitions/uint32
 
+  sysclk-cpu-first:
+    description:
+      When mclk-fs is used, configure CPU DAI sysclk before codec DAI sysclk
+      so the codec sees the final MCLK rate.
+      This property only affects the mclk-fs code path.
+    $ref: /schemas/types.yaml#/definitions/flag
+
   system-clock-frequency:
     description: |
       If a clock is specified and a multiplication factor is given with
@@ -194,6 +201,8 @@ properties:
     $ref: "#/definitions/format"
   simple-audio-card,mclk-fs:
     $ref: "#/definitions/mclk-fs"
+  simple-audio-card,sysclk-cpu-first:
+    $ref: "#/definitions/sysclk-cpu-first"
   simple-audio-card,aux-devs:
     $ref: "#/definitions/aux-devs"
   simple-audio-card,additional-devs:
@@ -251,6 +260,8 @@ patternProperties:
         $ref: "#/definitions/format"
       mclk-fs:
         $ref: "#/definitions/mclk-fs"
+      sysclk-cpu-first:
+        $ref: "#/definitions/sysclk-cpu-first"
       aux-devs:
         $ref: "#/definitions/aux-devs"
       convert-rate:
-- 
2.47.3


  reply	other threads:[~2026-02-10 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10 16:45 [PATCH v2 0/2] ASoC: simple-card: make sysclk ordering configurable Stefano Radaelli
2026-02-10 16:45 ` Stefano Radaelli [this message]
2026-02-11  6:23   ` [PATCH v2 1/2] dt-bindings: sound: simple-card: add sysclk-cpu-first flag 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260210164506.161810-2-stefano.r@variscite.com \
    --to=stefano.radaelli21@gmail.com \
    --cc=alexander.h@variscite.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierluigi.p@variscite.com \
    --cc=robh@kernel.org \
    --cc=stefano.r@variscite.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox