Skip to content

Commit 9b064d2

Browse files
prabhakarladbroonie
authored andcommitted
ASoC: rsnd: Fix probe failure on HiHope boards due to endpoint parsing
On the HiHope boards, we have a single port with a single endpoint defined as below: .... rsnd_port: port { rsnd_endpoint: endpoint { remote-endpoint = <&dw_hdmi0_snd_in>; dai-format = "i2s"; bitclock-master = <&rsnd_endpoint>; frame-master = <&rsnd_endpoint>; playback = <&ssi2>; }; }; .... With commit 547b02f ("ASoC: rsnd: enable multi Component support for Audio Graph Card/Card2"), support for multiple ports was added. This caused probe failures on HiHope boards, as the endpoint could not be retrieved due to incorrect device node pointers being used. This patch fixes the issue by updating the `rsnd_dai_of_node()` and `rsnd_dai_probe()` functions to use the correct device node pointers based on the port names ('port' or 'ports'). It ensures that the endpoint is properly parsed for both single and multi-port configurations, restoring compatibility with HiHope boards. Fixes: 547b02f ("ASoC: rsnd: enable multi Component support for Audio Graph Card/Card2") Signed-off-by: Lad Prabhakar <[email protected]> Acked-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ca2803f commit 9b064d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sound/soc/sh/rcar/core.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,9 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph)
12811281
if (!of_node_name_eq(ports, "ports") &&
12821282
!of_node_name_eq(ports, "port"))
12831283
continue;
1284-
priv->component_dais[i] = of_graph_get_endpoint_count(ports);
1284+
priv->component_dais[i] =
1285+
of_graph_get_endpoint_count(of_node_name_eq(ports, "ports") ?
1286+
ports : np);
12851287
nr += priv->component_dais[i];
12861288
i++;
12871289
if (i >= RSND_MAX_COMPONENT) {
@@ -1493,7 +1495,8 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
14931495
if (!of_node_name_eq(ports, "ports") &&
14941496
!of_node_name_eq(ports, "port"))
14951497
continue;
1496-
for_each_endpoint_of_node(ports, dai_np) {
1498+
for_each_endpoint_of_node(of_node_name_eq(ports, "ports") ?
1499+
ports : np, dai_np) {
14971500
__rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i);
14981501
if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) {
14991502
rdai = rsnd_rdai_get(priv, dai_i);

0 commit comments

Comments
 (0)