]> git.itanic.dy.fi Git - linux-stable/commit
ASoC: simple-card-utils: check "reg" property on asoc_simple_card_get_dai_id()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 20 Dec 2018 01:45:42 +0000 (10:45 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2019 20:34:53 +0000 (22:34 +0200)
commit0a2e1a5b583b8564834cdbc161cd1614cc834e59
tree30202018c36c8c7742f47c6f9f44cf66b2d55ebe
parent45040e92500cb70bcb906dc6aa0427166097871c
ASoC: simple-card-utils: check "reg" property on asoc_simple_card_get_dai_id()

[ Upstream commit a0c426fe143328760c9fd565cd203a37a7b4fde8 ]

We will get DAI ID from "reg" property if it has on DT, otherwise get
it by counting port/endpoint.

But in below case, we need to get DAI ID = 0 via port reg = <0>, but
current implementation returns ID = 1, because it can't judge ID = 0 was
from "non reg" or "reg = <0>".
Thus, it will count port/endpoint number as "non reg" case.

of_graph_parse_endpoint() implementation itself is not a problem,
but because asoc_simple_card_get_dai_id() need to count port/endpoint
number when "non reg" case, it need to know ID = 0 was from
"non reg" or "reg = <0>".
This patch fix this issue.

port {
reg = <0>;
xxxx: endpoint@0 {
};
=> xxxx: endpoint@1 {
};
};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/generic/simple-card-utils.c