From patchwork Thu Dec 13 01:35:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10727485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7EFA36C5 for ; Thu, 13 Dec 2018 01:35:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DE2D2B809 for ; Thu, 13 Dec 2018 01:35:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 618052B86C; Thu, 13 Dec 2018 01:35:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B44242B809 for ; Thu, 13 Dec 2018 01:35:47 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9D512267C65; Thu, 13 Dec 2018 02:35:46 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5330E267C7B; Thu, 13 Dec 2018 02:35:44 +0100 (CET) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa0.perex.cz (Postfix) with ESMTP id 92887267C65 for ; Thu, 13 Dec 2018 02:35:40 +0100 (CET) Date: 13 Dec 2018 10:35:38 +0900 X-IronPort-AV: E=Sophos;i="5.56,346,1539615600"; d="scan'208";a="2673824" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 13 Dec 2018 10:35:38 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 6CD114053622; Thu, 13 Dec 2018 10:35:38 +0900 (JST) Message-ID: <87efam2p5t.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown , Tony Lindgren In-Reply-To: <87ftv22p6q.wl-kuninori.morimoto.gx@renesas.com> References: <87ftv22p6q.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 1/7 v2] ASoC: simple-card-utils: care endpoint reg for asoc_simple_card_get_dai_id() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") fixuped getting DAI ID method. But, we need to consider about endpoint case, too. This patch fixup it. For example) MIXer case DAI0 -+- CPU <--> Codec - DAI0 DAI1 / /* CPU has 2 DAIs */ CPU { port { cpu-ep0: endpint@0 { reg = <0>; /* for DAI0 */ remote-endpoint = ; }; cpu-ep1: endpint@1 { reg = <1>; /* for DAI1 */ remote-endpoint = ; }; }; } /* Codec has 1 DAI */ Codec { port { reg = <0>; /* both are for DAI0 */ codec-ep0: endpint@0 { remote-endpoint = ; }; codec-ep1: endpint@1 { remote-endpoint = ; }; }; } Fixes: commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") Reported-by: Tony Lindgren Signed-off-by: Kuninori Morimoto Tested-by: Tony Lindgren --- sound/soc/generic/simple-card-utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 17d8aee..fec3bf7 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -284,6 +284,9 @@ static int asoc_simple_card_get_dai_id(struct device_node *ep) if (ret) return -ENXIO; + if (info.id) + return info.id; + return info.port; }