ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() ID method
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 14 Dec 2018 02:29:42 +0000 (11:29 +0900)
committerMark Brown <broonie@kernel.org>
Fri, 14 Dec 2018 11:44:34 +0000 (11:44 +0000)
commitb8b89f5ee0b2555fa5a9d778685d2d6fb5122bb9
tree7c083695ffc902919668d767309bd3b8c317b333
parentde17f14ea576d8a0f2932404467fa916542da94d
ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() ID method

commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup
asoc_simple_card_get_dai_id() counting") fixuped getting DAI ID method.
It will get DAI ID from OF graph "port", but, we want to consider about
"endpoint", too.
And, we also want to keep compatibility.

This patch fixup it as

if (driver has specified DAI ID)
use it as DAI ID
else if (OF graph endpoint has reg)
use it as DAI ID
else if (OF graph port has reg)
use it as DAI ID
else
use endpoint count as DAI ID

Fixes: commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting")
Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/generic/simple-card-utils.c