]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: simple-card-utils: fix graph_util_is_ports0() for DT overlays
authorSen Wang <sen@ti.com>
Mon, 9 Mar 2026 04:21:09 +0000 (23:21 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 10 Mar 2026 01:02:43 +0000 (01:02 +0000)
commit4185b95f8a42d92d68c49289b4644546b51e252b
tree590b400d2392e3853c5b583e64613881a452cabf
parent634672f9d6d8a75568834be7748685a3eacc406e
ASoC: simple-card-utils: fix graph_util_is_ports0() for DT overlays

graph_util_is_ports0() identifies DPCM front-end (ports@0) vs back-end
(ports@1) by calling of_get_child_by_name() to find the first "ports"
child and comparing pointers. This relies on child iteration order
matching DTS source order.

When the DPCM topology comes from a DT overlay, __of_attach_node()
inserts new children at the head of the sibling list, reversing the
order. of_get_child_by_name() then returns ports@1 instead of ports@0,
causing all front-end links to be classified as back-ends. The card
registers with no PCM devices.

Fix this by matching the unit address directly from the node name
instead of relying on sibling order.

Fixes: 92939252458f ("ASoC: simple-card-utils: add asoc_graph_is_ports0()")
Signed-off-by: Sen Wang <sen@ti.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20260309042109.2576612-1-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/generic/simple-card-utils.c