linux/sound/soc/generic
Sen Wang ce0b8fd5e3 ASoC: simple-card-utils: fix graph_util_is_ports0() for DT overlays
[ Upstream commit 4185b95f8a ]

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: 9293925245 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-19 16:08:15 +01:00
..
audio-graph-card.c ASoC: audio-graph-card: use snd_soc_ret() 2025-02-06 17:26:23 +00:00
audio-graph-card2-custom-sample.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
audio-graph-card2-custom-sample1.dtsi ASoC: audio-graph-card2-custom-sample1.dtsi: Separate Sample DT 2025-03-03 12:59:52 +00:00
audio-graph-card2-custom-sample2.dtsi ASoC: audio-graph-card2-custom-sample2.dtsi: Separate Sample DT 2025-03-03 12:59:53 +00:00
audio-graph-card2.c ASoC: audio-graph-card2: use snd_soc_ret() 2025-02-06 17:26:24 +00:00
Kconfig ASoC: generic: Standardize ASoC menu 2025-06-24 01:01:36 +01:00
Makefile ASoC: generic: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:19 +09:00
simple-card-utils.c ASoC: simple-card-utils: fix graph_util_is_ports0() for DT overlays 2026-03-19 16:08:15 +01:00
simple-card.c ASoC: simple-card-utils: use snd_soc_ret() 2025-02-06 17:26:22 +00:00
test-component.c ASoC: test-component: Use kcalloc() instead of kzalloc() 2025-08-20 15:09:24 +01:00