• Kuninori Morimoto's avatar
    ASoC: simple-card-utils: check "reg" property on asoc_simple_card_get_dai_id() · a0c426fe
    Kuninori Morimoto authored
    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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    a0c426fe
simple-card-utils.c 12.5 KB