From patchwork Tue May 31 09:14:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143973 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2866860777 for ; Tue, 31 May 2016 09:14:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A8182793B for ; Tue, 31 May 2016 09:14:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F6CF28185; Tue, 31 May 2016 09:14:22 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 250E827BF0 for ; Tue, 31 May 2016 09:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756989AbcEaJOT (ORCPT ); Tue, 31 May 2016 05:14:19 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:7043 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756988AbcEaJOP (ORCPT ); Tue, 31 May 2016 05:14:15 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 31 May 2016 18:14:13 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id C8603615CC; Tue, 31 May 2016 18:14:13 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id C41958002E; Tue, 31 May 2016 18:14:13 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id BC1BF8002D; Tue, 31 May 2016 18:14:13 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id UAE06302; Tue, 31 May 2016 18:14:13 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="212432741" Received: from mail-hk2apc01lp0210.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.210]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 18:14:13 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=dYWsx3Yk92X0fAsGFGBuO4m8tOEeKEp+HMAxOk3ERgE=; b=mAVzB0cWnoySZ1WfH9X3khRiqv0sWDMwltb8s5MczksIdg8l8boHZ23aEkdn8sueg6z1FoeSvDAXFQgOZllp4jQvslwGQDCpW6V8JwHT6QIVYEs/mmETgY1VX7jhyaECYVSF/9wjgr9kfD3MZE38O8rfBkt5DcVXn5kTR8+Hv7M= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by HK2PR06MB1699.apcprd06.prod.outlook.com (10.167.73.13) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 09:14:11 +0000 Message-ID: <87wpmappcs.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 38/39 v2] ASoC: rsrc-card: rename rsrc-card to simple-dpcm-card phase2 User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 31 May 2016 09:14:11 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0021.jpnprd01.prod.outlook.com (10.161.225.159) To HK2PR06MB1699.apcprd06.prod.outlook.com (10.167.73.13) X-MS-Office365-Filtering-Correlation-Id: 1e6109ee-e4a8-4b33-dc65-08d38933ee0a X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 2:XJFmbOKsWJYE4k3Dn+xWUGvSh7y6VmI4QLcUSxOVBAqAy56C9e7Qv3GjdDAB1TkFbgX4l+m3oEieVOcV57Gz4qAdp7FfuvIi9csRV9oPwKWDZEMBHw4wOkGxzy0QRZnl2ryRkOWLQtQBWbA4RSqkVnuEj3JUD2pRgAp0AN9tf9aM4TumEmr7ZaVpXnHjjIZE; 3:72FW3t2pLcuXh7EwCChK7BE+75WEHJsHJHyWagytGFNBEFkPIjmAxNIpkqlHkXcZhnm8b9VPVpSY/phyTtBa25SV8IbsY62nzo25AFeBf9JRNkq4DUfLU8P3itbOgtd+; 25:BpYgZsefoQFv5xIG0tdVXvjbhRV/M9u9/rfSqXBiiwcuYvJXoKCtYz9Z4UJ4UfvfplRQpJNuSbMeB2Kg5EliHf9GdYAdVwAFx+md+CJPqC8WePKBZRuzVZBPH20QnuXvKNFI9/ohngcFY5zh6BPhfUvU8NC5W0kmj6zsrNkWFM/YYQQbMsvzqR3kuRE3cbDayjW/RMwLStzyFmbsuEqyrPjIzITNVHA/AczIiHu5vnbs8MQzvmaQqela8Lpd7Ou7uHepE7jloff4Hz+uoUVPMMf+1MOC+HurAakbn2MYDLPNVynumWJQKbDYA+MuxgMILuNIVvSCridSSDXeG7QLcBwRUz8cE/XAVWmazVaKDYhXDxHwkvWjDickJlBeOutl0C+xijasgAspZW+bbdCAtn4KJC2M3pUGTYAGpPfThjs= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1699; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 20:N0YwN5vzc4+xBWhiqGssKfYX3qxqM6dCPdkN5NYu0K25lHXSkiYtedBmfaBmAvkCZHWi7Hc8GIWaPq6QL6q63+DTn+GcUxPHHsmby2iUHjFwKN8u7/JPXxu3VseWsjTODJvluImPySmrS9uO/V2G8ZDWvu33pvMqtyIT9w6eRaFI0vO9KokKzJxldc1HNM7FP5i6aW6StXUJfKF8/ICxcD9WLKsu2EFKZNvZpmiTzhU0rZB7nuWS38MNn+JjvuRcc488HzpWEUdXdGEHWKQ/b44mHtHVf16eW1dOhjycR9s1GfCm3hirYQ8VCtau3MAR6ILXnbK1g1r8if2n31IOv/wI1vbHa1KgqvthjC0/Zw6nEljbHJC5xpqR1B0ck4Xp6Ly+jquZCun5TeSFVg4nShag+KC+4yJWgqtNYB8HfBB6F0BWSPhIstdAbXY9nEhOM1/Jhiq/Lru9HXtJAIsDwk/06/Sza0EvPHmFCeuJU3ieFadvF4mOOIltFGqXRixc; 4:pCOdu+9Wz4E/JwCasUx5k8OsDYoBJJYdvIc6/RgSxoORgCAYaYqL8vdxIWaU4bVOptJiOahrAPwxyeSH0tC8eXooWLVXUiwXW5ctdWEwmPugHYjEs4yxR5fzG6vAM20Rohjs1mhPdJQaoT/je1+9jFE1anaIBPmCrb1tcEdK1849PrMd/pGWKlyf10rR05R7ZYutwWMWCkxezdrSpbznnZhHYYhPoTqOwa0lP5Nbw3tAinndT/JyVFMiaQx/USiXLbVjfcExYC3ybQCObd1xw9xSi3LqO5IjuL6yNJrcNk+Svc4R7AZ8k/C7qlMebBOCdYTNSPL8ZW77cl2BQN2tZ5MUTD95zOJkhYGy7gepN074V8QXc7I5fbJ7zzoGAXC6Yw0MWPBWkqmpZS8MgvZOhw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:HK2PR06MB1699; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB1699; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6116002)(3846002)(2950100001)(586003)(81166006)(8676002)(77096005)(86362001)(76176999)(54356999)(31430400001)(92566002)(23726003)(4001350100001)(50466002)(36756003)(2906002)(5004730100002)(50986999)(4326007)(42186005)(46406003)(66066001)(189998001)(19580395003)(19580405001)(230783001)(53416004)(5008740100001)(229853001)(83506001)(110136002)(33646002)(47776003)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB1699; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB1699; 23:unODdzIXQRTKOJXsG2avAwMPgKe6KWXC9BJjkVUx6?= =?us-ascii?Q?5EWiZf+BsqTDWQ5iioov1OaAYesPazBJlUulMvBsTRMNmO6V0kDtGt3CKTbK?= =?us-ascii?Q?yn/jo92udnokq055UkoF8ww1NobR4H+z+BgM080HNrrDqBpUU1lO7gDUaGvq?= =?us-ascii?Q?hzoiHSU2ebQwjAYlnAXJfXfFAEwa5Y2lKmMXhscU1wdLZ+wmLq5naLSXwIFg?= =?us-ascii?Q?nE4+TUFuwIVeOYwlPNsE/0u1WUCC9b8ENDxr/ciLf99RHQ5VSLhbgXW+D45r?= =?us-ascii?Q?8+Cc/G3jugaGxZS+h3e3OsXpejP3L5zhBRZ8JnhQJZe++YJGEYI5z3g/zMzg?= =?us-ascii?Q?wdYWxYMif3KReaejg+tTvmILRwoieR33Gop0J/mCWV47OXH28fUv+82ggOwd?= =?us-ascii?Q?FKhQgwSKPQWerVUye7HQmCToxG08Rn0OKEouDBr68WtROZ5EtTdTjTbsCZ/5?= =?us-ascii?Q?IMxwASZdcqjbPxj78CSi2iIT/DjA3P4XQZc003p5j3067x0QCZejfqiRxDcS?= =?us-ascii?Q?cNwkP5vrsRV2JkyC7GyxBj0o2WNJeyO/KykV55v6NbwmQ9v1IJMADtulbZtM?= =?us-ascii?Q?CX0wsgMTObQyyKS62unyHe5UxnNvGkCR2CEkuHEqkK4WXqDjsw+MWL5ZU/BP?= =?us-ascii?Q?fUpGICdSzCu9qq7/6TK9GhMH65AtKgLD77g6BYIehIZ6qa4V3GnIGZhL++/N?= =?us-ascii?Q?Vr+q2gILWuymvCvy4CCDy33aGD/bWCuKbF8BJd2MDTUwBJWfiil5I0cd86Pm?= =?us-ascii?Q?ZiMEkR/hwzXoKzj7SxozULV+fB9K0cuuLkasXrGFUHDCoALTNAa5SIiuAuTw?= =?us-ascii?Q?vTka3rKc8EB1BPplygmMpI65+vCk1GX6IEd+717fKLe8UKuOChzz1CK2apOB?= =?us-ascii?Q?dtfhF8QArnloeutwFyho7RA+HEr4M2VnjT9hjctZsd35p+95JGxfkaqWJiiY?= =?us-ascii?Q?CU9eBJcnWQDCu/AF22GSsnMxpE0oeRsryasjOjALM8j/W/vSdM6KTbL/0yZd?= =?us-ascii?Q?wYud5/975uXF+ujUXJVVv5P?= X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 5:gB74aNSIQOP5iALXm7/NyVL4364rZQwqtOhrtOVXcrCA+5mPMCIAfkjenJg+GLE00GCO+YFolL52PvWOacm77RCC0KhqKSX3eQchksBXZI7lNmNO/9Dd7xvKq/lzXYV7/cO5DOoiXnesIrpMSNYp9Q==; 24:JdqYLCkZSkToScuQ0FDis1x8vCcZnOoI337nWczOUHfduVcmysODvbCs2GUrc9gy0gfjJa8FAxeShNBBSXqcRkGChPlGP4AiV58BDKDVuyM=; 7:zlntwpuhXdXY1tpdeIAdHen4FUvzL16BboiFGs+J5OjO2bkWrnoSZnYhx/dtAQzwQTrKjZoeCQdlOrdkVges7MWC8jB08Y88UHBpVOSunbos6Naargf8t1LeUAkIqDhaCjfUd1L8g5OVnTListj6LbPvb+dBHAwZUgyE6nISjC0QMYVGag7YclQN//pulbtA; 20:/Kr2ge9XClv1eyV1aqRcW2moBAdzCNnEf9P6cx4HWNV3VzxXiwD5b+3oG/gmPBGv/R7NUyuWhMWe7Hhmc2Fz6pHcLDEkGM8vw6D62JvScba/TfoQZNYqjiAs2MKr4Ifp/lLx6R3QhIou8B1MltUI9kuNgjk6eoUxzF813EgpKLc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:14:11.3929 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1699 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto rsrc-card which is using DPCM feature was created for Renesas sound. But not only Renesas, but many SoC can use this driver, because it is based on simple-card driver. To use it as more open driver, rsrc-card should be renamed to simple-dpcm-card. In order to easy patch review, as 2nd step, this patch renames compatible from "renesas,rsrc-car" to "simple-dpcm-audio-card"; rcar-card used specific property, not "simple-audio-card", but it should be now. Actually, rsrc-card is upstreamed driver, but noone is using it on upstream. The user is only local, and it is only me. Thus, there is no compatible break by this patch. This patch uses "simple-audio-card" prefix. And it removes rcar-card specifix compatible too. Signed-off-by: Kuninori Morimoto --- .../bindings/sound/renesas,rsrc-card.txt | 56 +++++++++-------- sound/soc/sh/rcar/rsrc-card.c | 71 +++++++--------------- 2 files changed, 52 insertions(+), 75 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt index 255ece3..cfdf441 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt @@ -1,38 +1,35 @@ -Renesas Sampling Rate Convert Sound Card: +ASoC simple DPCM Sound Card -Renesas Sampling Rate Convert Sound Card specifies audio DAI connections of SoC <-> codec. +Simple-Card specifies audio DAI connections of SoC <-> codec. Required properties: -- compatible : "renesas,rsrc-card{,}" - Examples with boards are: - - "renesas,rsrc-card" - - "renesas,rsrc-card,lager" - - "renesas,rsrc-card,koelsch" +- compatible : "simple-dpcm-audio-card" + Optional properties: -- card_name : User specified audio sound card name, one string +- simple-audio-card,name : User specified audio sound card name, one string property. -- cpu : CPU sub-node -- codec : CODEC sub-node +- simple-audio-card,cpu : CPU sub-node +- simple-audio-card,codec : CODEC sub-node Optional subnode properties: -- format : CPU/CODEC common audio format. +- simple-audio-card,format : CPU/CODEC common audio format. "i2s", "right_j", "left_j" , "dsp_a" "dsp_b", "ac97", "pdm", "msb", "lsb" -- frame-master : Indicates dai-link frame master. +- simple-audio-card,frame-master : Indicates dai-link frame master. phandle to a cpu or codec subnode. -- bitclock-master : Indicates dai-link bit clock master. +- simple-audio-card,bitclock-master : Indicates dai-link bit clock master. phandle to a cpu or codec subnode. -- bitclock-inversion : bool property. Add this if the +- simple-audio-card,bitclock-inversion : bool property. Add this if the dai-link uses bit clock inversion. -- frame-inversion : bool property. Add this if the +- simple-audio-card,frame-inversion : bool property. Add this if the dai-link uses frame clock inversion. -- convert-rate : platform specified sampling rate convert -- convert-channels : platform specified converted channel size (2 - 8 ch) -- audio-prefix : see audio-routing -- audio-routing : A list of the connections between audio components. +- simple-audio-card,convert-rate : platform specified sampling rate convert +- simple-audio-card,convert-channels : platform specified converted channel size (2 - 8 ch) +- simple-audio-card,prefix : see audio-routing +- simple-audio-card,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. @@ -57,18 +54,25 @@ Optional CPU/CODEC subnodes properties: Example sound { - compatible = "renesas,rsrc-card,lager"; + compatible = "simple-dpcm-audio-card"; + + simple-audio-card,name = "rsnd-ak4643"; + simple-audio-card,format = "left_j"; + simple-audio-card,format = "left_j"; + simple-audio-card,bitclock-master = <&sndcodec>; + simple-audio-card,frame-master = <&sndcodec>; + + simple-audio-card,convert-rate = <48000>; /* see audio_clk_a */ - card-name = "rsnd-ak4643"; - format = "left_j"; - bitclock-master = <&sndcodec>; - frame-master = <&sndcodec>; + simple-audio-card,prefix = "ak4642"; + simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback", + "DAI0 Capture", "ak4642 Capture"; - sndcpu: cpu { + sndcpu: simple-audio-card,cpu { sound-dai = <&rcar_sound>; }; - sndcodec: codec { + sndcodec: simple-audio-card,codec { sound-dai = <&ak4643>; system-clock-frequency = <11289600>; }; diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index e409b46..cef7ff5 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -28,21 +28,8 @@ struct asoc_simple_card_of_data { int num_routes; }; -static const struct snd_soc_dapm_route routes_ssi0_ak4642[] = { - {"ak4642 Playback", NULL, "DAI0 Playback"}, - {"DAI0 Capture", NULL, "ak4642 Capture"}, -}; - -static const struct asoc_simple_card_of_data routes_of_ssi0_ak4642 = { - .prefix = "ak4642", - .routes = routes_ssi0_ak4642, - .num_routes = ARRAY_SIZE(routes_ssi0_ak4642), -}; - static const struct of_device_id asoc_simple_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", }, + { .compatible = "simple-dpcm-audio-card", }, {}, }; MODULE_DEVICE_TABLE(of, asoc_simple_card_of_match); @@ -64,6 +51,7 @@ struct asoc_simple_card_priv { #define DAI "sound-dai" #define CELL "#sound-dai-cells" +#define PREFIX "simple-audio-card," static int asoc_simple_card_startup(struct snd_pcm_substream *substream) { @@ -157,10 +145,6 @@ static int asoc_simple_card_parse_links(struct device_node *np, return ret; } else { - const struct asoc_simple_card_of_data *of_data; - - of_data = of_device_get_match_data(dev); - /* FE is dummy */ dai_link->cpu_of_node = NULL; dai_link->cpu_dai_name = "snd-soc-dummy-dai"; @@ -178,17 +162,11 @@ static int asoc_simple_card_parse_links(struct device_node *np, if (ret < 0) return ret; - /* additional name prefix */ - if (of_data) { - priv->codec_conf.of_node = dai_link->codec_of_node; - priv->codec_conf.name_prefix = of_data->prefix; - } else { - ret = asoc_simple_card_parse_card_prefix(&priv->snd_card, - dai_link, &priv->codec_conf, - "audio-"); - if (ret < 0) - return ret; - } + ret = asoc_simple_card_parse_card_prefix(&priv->snd_card, + dai_link, &priv->codec_conf, + PREFIX); + if (ret < 0) + return ret; } ret = asoc_simple_card_parse_tdm(np, dai_props); @@ -236,9 +214,9 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, for_each_child_of_node(node, np) { dai_link = simple_priv_to_link(priv, i); - if (strcmp(np->name, "codec") == 0) { + if (strcmp(np->name, PREFIX "codec") == 0) { ret = asoc_simple_card_parse_daifmt(dev, node, np, - NULL, &daifmt); + PREFIX, &daifmt); if (ret < 0) return ret; break; @@ -252,7 +230,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, dai_link->dai_fmt = daifmt; is_fe = false; - if (strcmp(np->name, "cpu") == 0) + if (strcmp(np->name, PREFIX "cpu") == 0) is_fe = true; ret = asoc_simple_card_parse_links(np, priv, i, is_fe); @@ -268,7 +246,6 @@ static int asoc_simple_card_parse_of(struct device_node *node, struct asoc_simple_card_priv *priv, struct device *dev) { - const struct asoc_simple_card_of_data *of_data = of_device_get_match_data(dev); struct asoc_simple_dai *props; struct snd_soc_dai_link *links; int ret; @@ -294,33 +271,29 @@ static int asoc_simple_card_parse_of(struct device_node *node, priv->snd_card.codec_conf = &priv->codec_conf; priv->snd_card.num_configs = 1; - 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"); - } + ret = snd_soc_of_parse_audio_routing(&priv->snd_card, PREFIX "routing"); + if (ret < 0) + return ret; /* sampling rate convert */ - of_property_read_u32(node, "convert-rate", &priv->convert_rate); + of_property_read_u32(node, PREFIX "convert-rate", &priv->convert_rate); /* channels transfer */ - of_property_read_u32(node, "convert-channels", &priv->convert_channels); - - dev_dbg(dev, "New rsrc-audio-card: %s\n", - priv->snd_card.name ? priv->snd_card.name : ""); - dev_dbg(dev, "SRC : convert_rate %d\n", priv->convert_rate); - dev_dbg(dev, "CTU : convert_channels %d\n", priv->convert_channels); + of_property_read_u32(node, PREFIX "convert-channels", &priv->convert_channels); ret = asoc_simple_card_dai_link_of(node, priv); if (ret < 0) return ret; - ret = asoc_simple_card_parse_card_name(&priv->snd_card, "card-"); + ret = asoc_simple_card_parse_card_name(&priv->snd_card, PREFIX); if (ret < 0) return ret; + dev_dbg(dev, "New card: %s\n", + priv->snd_card.name ? priv->snd_card.name : ""); + dev_dbg(dev, "convert_rate %d\n", priv->convert_rate); + dev_dbg(dev, "convert_channels %d\n", priv->convert_channels); + return 0; } @@ -363,7 +336,7 @@ static int asoc_simple_card_remove(struct platform_device *pdev) static struct platform_driver asoc_simple_card = { .driver = { - .name = "renesas-src-audio-card", + .name = "simple-dpcm-audio-card", .of_match_table = asoc_simple_card_of_match, }, .probe = asoc_simple_card_probe,