From patchwork Wed Jul 15 07:08:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6793561 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EB6CBC05AC for ; Wed, 15 Jul 2015 07:09:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 091D7204EB for ; Wed, 15 Jul 2015 07:09:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BB52920519 for ; Wed, 15 Jul 2015 07:09:13 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E231A265826; Wed, 15 Jul 2015 09:09:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 2252D26586D; Wed, 15 Jul 2015 09:08:47 +0200 (CEST) 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 C66DA26586D; Wed, 15 Jul 2015 09:08:46 +0200 (CEST) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id CDA7D265846 for ; Wed, 15 Jul 2015 09:08:11 +0200 (CEST) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 15 Jul 2015 16:08:10 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 84E5F448D1; Wed, 15 Jul 2015 16:08:10 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 6A9C52806D; Wed, 15 Jul 2015 16:08:10 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 69BAE2806F; Wed, 15 Jul 2015 16:08:10 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id SAG23074; Wed, 15 Jul 2015 16:08:10 +0900 X-IronPort-AV: E=Sophos;i="5.15,477,1432566000"; d="scan'";a="191575190" Received: from mail-pu1apc01lp0019.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.19]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jul 2015 16:08:07 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.144) by HK2PR06MB0594.apcprd06.prod.outlook.com (10.161.187.145) with Microsoft SMTP Server (TLS) id 15.1.213.14; Wed, 15 Jul 2015 07:08:05 +0000 Message-ID: <87a8uxx5nf.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <87d1ztx5pb.wl%kuninori.morimoto.gx@renesas.com> References: <87d1ztx5pb.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 15 Jul 2015 07:08:05 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0029.jpnprd01.prod.outlook.com (25.164.162.13) To HK2PR06MB0594.apcprd06.prod.outlook.com (25.161.187.145) X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0594; 2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ES6vYzhjwxBtJpI0Rjr3TAqtvMq/KMOkWj59ghGUKa; 4:noJ2ZHGNC+HhPU3BzjD7/Y7VpXAYGjdf0gmKNNmpMFO+5s0zZN1Rh/afEdcxMtZDLXcSTyZ4dcsAM+TAnQpDA3FDlbvmTKqv63vYw7UZ/MIxb29/ryAX02Emtv9MY2RDR+2iIR+/EMD4XDw1C6XEQOQILSEi0nOLq6WeJKK7qYJK7bePehWREp3CRrvU3ZNp/fEKhWBRfyWboaKsQ8sFBm//YHnKKeEEfUfQ4l0sSCCPj9frmknzLv0iZT2fReEA3eXBmMVyPsDBz749pjaSRjt899TvH2qqgIsvZjb3crc= HK2PR06MB0594: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:HK2PR06MB0594; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0594; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(19580405001)(5001960100002)(4001350100001)(87976001)(92566002)(19580395003)(53416004)(2950100001)(50466002)(42186005)(86362001)(110136002)(107886002)(83506001)(50986999)(46406003)(76176999)(23726002)(54356999)(46102003)(77096005)(36756003)(62966003)(33646002)(229853001)(47776003)(40100003)(77156002)(189998001)(66066001)(122386002)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0594; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0594; 23:7Na21pxh6KfuefAKGbAcH42PwUMILhFu8sDAfssvm3pdObXnzF1/CvwcQdE8Dgp28/pOf2XvWameFmN1lDvbxG+KtF9F/22idqZf4cQPAyAcywbGs2TQZ4OI0HmqI3/k/3ZFlakFrlZ/jzZLSclmRhyi/CLsZqJnj6zwUzqPq8I3GioNaAyjX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IQk5Ka1oxR7xLDgw5OKTrsEUilD+oOa/YZgNSoUn7r0PgZlUMuTgDbYp2SR5Rs6sjytcYgJH3NxAaoNzDCn4+TEnuScF5VyLeQUZ4BzGMi0aEyIEoY1KmxS2sVGBDMHSvRrjP7A= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2015 07:08:05.0869 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0594 Cc: Linux-ALSA , shiiba , Liam Girdwood , komatsu , kobayashi , Simon Subject: [alsa-devel] [PATCH 02/35] ASoC: rsrc-card: use snd_soc_of_parse_audio_route/prefix for routing 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 using common audio routing path method makes sense. Let's use snd_soc_of_parse_audio_route/prefix. Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- .../bindings/sound/renesas,rsrc-card.txt | 7 +++++++ sound/soc/sh/rcar/rsrc-card.c | 22 ++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt index c641550..962748a 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt @@ -6,6 +6,7 @@ Required properties: - compatible : "renesas,rsrc-card," Examples with soctypes are: + - "renesas,rsrc-card" - "renesas,rsrc-card,lager" - "renesas,rsrc-card,koelsch" Optional properties: @@ -29,6 +30,12 @@ Optional subnode properties: - frame-inversion : bool property. Add this if the dai-link uses frame clock inversion. - convert-rate : platform specified sampling rate convert +- audio-prefix : see audio-routing +- audio-routing : A list of the connections between audio components. + Each entry is a pair of strings, the first being the connection's sink, + the second being the connection's source. Valid names for sources. + use audio-prefix if some components is using same sink/sources naming. + it can be used if compatible was "renesas,rsrc-card"; Required CPU/CODEC subnodes properties: diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index 84e9357..d61db9c 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -41,6 +41,7 @@ static const struct rsrc_card_of_data routes_of_ssi0_ak4642 = { static const struct of_device_id rsrc_card_of_match[] = { { .compatible = "renesas,rsrc-card,lager", .data = &routes_of_ssi0_ak4642 }, { .compatible = "renesas,rsrc-card,koelsch", .data = &routes_of_ssi0_ak4642 }, + { .compatible = "renesas,rsrc-card", }, {}, }; MODULE_DEVICE_TABLE(of, rsrc_card_of_match); @@ -242,8 +243,15 @@ static int rsrc_card_parse_links(struct device_node *np, snd_soc_of_get_dai_name(np, &dai_link->codec_dai_name); /* additional name prefix */ - priv->codec_conf.of_node = dai_link->codec_of_node; - priv->codec_conf.name_prefix = of_data->prefix; + if (of_data) { + priv->codec_conf.of_node = dai_link->codec_of_node; + priv->codec_conf.name_prefix = of_data->prefix; + } else { + snd_soc_of_parse_audio_prefix(&priv->snd_card, + &priv->codec_conf, + dai_link->codec_of_node, + "audio-prefix"); + } /* set dai_name */ snprintf(dai_props->dai_name, DAI_NAME_NUM, "be.%s", @@ -361,8 +369,14 @@ static int rsrc_card_parse_of(struct device_node *node, priv->snd_card.num_links = num; priv->snd_card.codec_conf = &priv->codec_conf; priv->snd_card.num_configs = 1; - priv->snd_card.of_dapm_routes = of_data->routes; - priv->snd_card.num_of_dapm_routes = of_data->num_routes; + + if (of_data) { + priv->snd_card.of_dapm_routes = of_data->routes; + priv->snd_card.num_of_dapm_routes = of_data->num_routes; + } else { + snd_soc_of_parse_audio_routing(&priv->snd_card, + "audio-routing"); + } /* Parse the card name from DT */ snd_soc_of_parse_card_name(&priv->snd_card, "card-name");