On 06/07/2026 14:00, Konrad Dybcio wrote:
On 7/5/26 10:06 PM, David Heidelberg via B4 Relay wrote:
From: David Heidelberg <[email protected]>

Introduce support for sound card and wire two CS35L36 audio codecs for
top and bottom speakers.

Inspired by commit from Joel Selvaraj.

Signed-off-by: David Heidelberg <[email protected]>
---

[...]

+       /* CS35L36, Bottom Speaker */
+       cs35l36_bottom: audio-codec@40 {
+               compatible = "cirrus,cs35l36";
+               reg = <0x40>;
+               reset-gpios = <&tlmm 112 GPIO_ACTIVE_HIGH>;
+               #sound-dai-cells = <0>;
+               sound-name-prefix = "Right"; /* Bottom */

One comment's enough (either above the node or here)

[...]

+       mm1-dai-link {
+               link-name = "MultiMedia1";
+
+               cpu {
+                       sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
+               };
+       };
+
+       cs35l36-dai-link {
+               link-name = "Speaker Playback";
+
+               cpu {
+                       sound-dai = <&q6afedai QUATERNARY_TDM_RX_0>;
+               };
+
+               platform {
+                       sound-dai = <&q6routing>;
+               };
+
+               codec {
+                       sound-dai = <&cs35l36_bottom>, <&cs35l36_top>;
+               };

nit: 'co'dec < 'cp'u < 'p'latform

also 'c's35l36-dai-link < `m`m1-dai-link

... aaaand **sorting nodes** broke audio.

Moving `mm1-dai-link` behind `cs35l36-dai-link` broke the audio.

For now I'm keeping m1-dai-link at the begging and added the comment why is it there, but I guess would be nice to have this solved properly.

---
What actually happens in the core. In soc_probe_component() the ASoC core creates a component's widgets, probes it, and immediately adds that component's own routes. Card-level routes, including the DT audio-routing ones, are only added after every component is probed. So a component whose routes point at another component's widgets, which is exactly what q6routing does with MM_DL* and MM_UL*, only works if the other component happens to be probed earlier. Probe order is
  the DT link order, so this becomes a hidden DT contract.

Upstream does not actually sort these nodes. The binding matches .*-dai-link$ and the reference boards rely on the order: db845c lists mm1 to mm4 and then hdmi-dai-link, sm8250-mtp lists mm1 to mm3 and then wcd-..., wsa-..., va-dai-link. Neither is alphabetical. So "sorted by name" is not the convention being followed for these children, and cs35l36-dai-link sorting before mm1-dai-link is precisely why an alphabetical rework breaks.

  Where a fix would belong. Two options, in order of preference:

- In the ASoC core: defer component routes until after soc_probe_link_components() finishes, next to where the card routes are added. That removes the dependency for every driver with cross-component routes. It is a small change, but it touches every card, so it needs a wide audience on alsa-devel. - In qcom_snd_parse_of(): it already knows which links are frontends (no codec and no platform child, marked dynamic) and which are backends (no_pcm). Two passes over the children, frontends first, make the order independent of the DT. That is local and would be acceptable to the Qualcomm audio maintainers, but it papers
    over a core problem.


otherwise:

Reviewed-by: Konrad Dybcio <[email protected]>
Konrad



Reply via email to