From patchwork Thu Nov 22 00:56:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10693349 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 413D914BD for ; Thu, 22 Nov 2018 00:56:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 295112C5BD for ; Thu, 22 Nov 2018 00:56:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1875B2C697; Thu, 22 Nov 2018 00:56:30 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 6CA902C5BD for ; Thu, 22 Nov 2018 00:56:29 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6A61C2677E8; Thu, 22 Nov 2018 01:56:28 +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 745B4267929; Thu, 22 Nov 2018 01:56:26 +0100 (CET) Received: from JPN01-OS2-obe.outbound.protection.outlook.com (mail-eopbgr1410108.outbound.protection.outlook.com [40.107.141.108]) by alsa0.perex.cz (Postfix) with ESMTP id 534032677E8 for ; Thu, 22 Nov 2018 01:56:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lSGiusiILnYWDH1pnG82cwi4YQ0SyZxQga2kY0ig+Lk=; b=hok9OwnFThjRJ4akAk6Ylj4sHJrNMIAr8gLn2HJYQ4FFlH4ftrAr+sQ49nthAcEARaojIICsxUWPKXxaYKSVXXSX4CQN2/21m2xKTBpj1vPo9gP5k4s1xBfkbn/zsFqjR6SlAblseCMW18uIwPTD/u0BU2td3XdYy2nTSdiRPjs= Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com (20.178.136.81) by TYAPR01MB3263.jpnprd01.prod.outlook.com (20.177.104.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.30; Thu, 22 Nov 2018 00:56:22 +0000 Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67]) by TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67%4]) with mapi id 15.20.1339.027; Thu, 22 Nov 2018 00:56:22 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 05/10] ASoC: audio-graph-scu-card: tidyup "prefix" parsing Thread-Index: AQHUgf4vnttN4nc+REe+ZrdciaY0cA== Date: Thu, 22 Nov 2018 00:56:21 +0000 Message-ID: <87tvkalz05.wl-kuninori.morimoto.gx@renesas.com> References: <871s7endnu.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <871s7endnu.wl-kuninori.morimoto.gx@renesas.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR04CA0020.apcprd04.prod.outlook.com (2603:1096:404:15::32) To TYAPR01MB3328.jpnprd01.prod.outlook.com (2603:1096:404:bb::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [211.11.155.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TYAPR01MB3263; 20:L0k0nZEpaREFokpAH7dXfXaqFFrV0HRqdfXeBXDG0Vmc+SCrWtvq+z+QxqGiIHICgaOED5HOkZ3VTi/DVwEUUPXNJECpsrYk5sgLgzatbw2gOYiQr0sm/91i6juJWZckx0UpokK1LKuxlnPVekJxrFKegLjhWvjGjSDw495gIR0= x-ms-office365-filtering-correlation-id: e14b2198-4208-4e61-1836-08d6501551d8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB3263; x-ms-traffictypediagnostic: TYAPR01MB3263: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231442)(944501410)(52105112)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB3263; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB3263; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(136003)(366004)(376002)(39860400002)(396003)(189003)(199004)(52116002)(97736004)(3846002)(7736002)(66066001)(386003)(11346002)(305945005)(81166006)(102836004)(446003)(6506007)(68736007)(316002)(76176011)(86362001)(106356001)(105586002)(8936002)(2900100001)(71200400001)(486006)(5660300001)(26005)(6512007)(6916009)(2906002)(36756003)(256004)(53936002)(6116002)(476003)(4326008)(186003)(6486002)(71190400001)(8676002)(81156014)(6436002)(478600001)(2616005)(99286004)(14454004)(25786009); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB3263; H:TYAPR01MB3328.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 9LfEY+VyXIa9MYMqRd3mf/zlZkQfHr/0fndCJqDNVoOZunz1eo4/R4+JFfzLwu8pL3Bf46WlHpGAkNcabQ8aLCtFDzDhSAN28Rco+UoFWht94v44lnOKMl5sG4IKkh74sGfqUPGmAhZ+VsDOlbuWi7cih3SxVAh3rco8fmt2nrfBNUqg6G8J0OSkDQzht/Tk8LUrnZUSPHxYGmh/h/5dRMu4gLy8YNhPw6rDWEY/o6AbSixR6AHU96sDCs1PRE16rQj3yTXvxWTR/0yvVzKQ2qwP7DcVrirSOH9kcbG/TcVMojw6B3TlLMHXHWtlJuPD3JTXaSYVOm0U7Sgw0kNpnMssAMXYaNw09YpPjFbPam8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e14b2198-4208-4e61-1836-08d6501551d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 00:56:21.8446 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB3263 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 05/10] ASoC: audio-graph-scu-card: tidyup "prefix" parsing 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 audio-graph-scu-card.c is supporting "prefix" which is used to avoid DAI naming conflict when CPU/Codec matching. But, sound card might have multi sub-devices, and each codec might need each prefix. Now, ASoC is supporting snd_soc_of_parse_node_prefix(), let's support it on audio-graph-scu-card, too. It is keeping existing DT style. It can't support each codec's prefix if sound card had multi sub-devices without this patch. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-scu-card.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c index c469473..fdc61f1 100644 --- a/sound/soc/generic/audio-graph-scu-card.c +++ b/sound/soc/generic/audio-graph-scu-card.c @@ -39,6 +39,8 @@ struct graph_card_data { #define graph_priv_to_dev(priv) (graph_priv_to_card(priv)->dev) #define graph_priv_to_link(priv, i) (graph_priv_to_card(priv)->dai_link + (i)) +#define PREFIX "audio-graph-card," + static int asoc_graph_card_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -98,6 +100,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, struct snd_soc_dai_link *dai_link = graph_priv_to_link(priv, idx); struct graph_dai_props *dai_props = graph_priv_to_props(priv, idx); struct snd_soc_card *card = graph_priv_to_card(priv); + struct device_node *node = of_graph_get_port_parent(ep); int ret; if (is_fe) { @@ -154,10 +157,17 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, if (ret < 0) return ret; + /* check "prefix" from top node */ snd_soc_of_parse_audio_prefix(card, &priv->codec_conf, dai_link->codecs->of_node, "prefix"); + /* check "prefix" from each node if top doesn't have */ + if (!priv->codec_conf.of_node) + snd_soc_of_parse_node_prefix(node, + &priv->codec_conf, + dai_link->codecs->of_node, + PREFIX "prefix"); } ret = asoc_simple_card_of_parse_tdm(ep, &dai_props->dai);