linux/sound/soc/generic
Shengjiu Wang 0e9fc79132
ASoC: simple-card-utils: Check value of is_playback_only and is_capture_only
The audio-graph-card2 gets the value of 'playback-only' and
'capture_only' property in below sequence, if there is 'playback_only' or
'capture_only' property in port_cpu and port_codec nodes, but no these
properties in ep_cpu and ep_codec nodes, the value of playback_only and
capture_only will be flushed to zero in the end.

graph_util_parse_link_direction(lnk,            &playback_only, &capture_only);
graph_util_parse_link_direction(ports_cpu,      &playback_only, &capture_only);
graph_util_parse_link_direction(ports_codec,    &playback_only, &capture_only);
graph_util_parse_link_direction(port_cpu,       &playback_only, &capture_only);
graph_util_parse_link_direction(port_codec,     &playback_only, &capture_only);
graph_util_parse_link_direction(ep_cpu,         &playback_only, &capture_only);
graph_util_parse_link_direction(ep_codec,       &playback_only, &capture_only);

So check the value of is_playback_only and is_capture_only in
graph_util_parse_link_direction() function, if they are true, then rewrite
the values, and no need to check the np variable as
of_property_read_bool() will ignore if it was NULL.

Fixes: 3cc393d223 ("ASoC: simple-card-utils: Fix pointer check in graph_util_parse_link_direction")
Fixes: 22a507d768 ("ASoC: simple-card-utils: Check device node before overwrite direction")
Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20260318102850.2794029-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-18 13:26:49 +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
audio-graph-card.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08: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 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
simple-card-utils.c ASoC: simple-card-utils: Check value of is_playback_only and is_capture_only 2026-03-18 13:26:49 +00:00
simple-card.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
test-component.c ASoC: test-component: Use kcalloc() instead of kzalloc() 2025-08-20 15:09:24 +01:00