From patchwork Mon Jun 15 06:21:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6606271 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 69F6A9F399 for ; Mon, 15 Jun 2015 06:23:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 843D820483 for ; Mon, 15 Jun 2015 06:23:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5881D2042A for ; Mon, 15 Jun 2015 06:23:23 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 74CF026128A; Mon, 15 Jun 2015 08:23:22 +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 D301D261493; Mon, 15 Jun 2015 08:22:39 +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 1AAE1261489; Mon, 15 Jun 2015 08:22:38 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id D24FA26067B for ; Mon, 15 Jun 2015 08:21:42 +0200 (CEST) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 15 Jun 2015 15:21:37 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 1D5134A528; Mon, 15 Jun 2015 15:21:37 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 14B63480A4; Mon, 15 Jun 2015 15:21:37 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 104C6480A3; Mon, 15 Jun 2015 15:21:37 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id RAB06832; Mon, 15 Jun 2015 15:21:37 +0900 X-IronPort-AV: E=Sophos;i="5.13,616,1427727600"; d="scan'";a="189472360" Received: from mail-hk1lp0118.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.118]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jun 2015 15:21:36 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.132) by SIXPR06MB319.apcprd06.prod.outlook.com (10.141.125.145) with Microsoft SMTP Server (TLS) id 15.1.190.14; Mon, 15 Jun 2015 06:21:34 +0000 Message-ID: <87pp4xv6hp.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: <87twu9v6kn.wl%kuninori.morimoto.gx@renesas.com> References: <87twu9v6kn.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 15 Jun 2015 06:21:34 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: TY1PR0201CA0030.apcprd02.prod.outlook.com (25.164.90.168) To SIXPR06MB319.apcprd06.prod.outlook.com (10.141.125.145) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB319; 2:tk0ymTHGq8XFTTBSKyTNQh7y9k1LlX3+8ffH5iFfxWVQx6IKWhiarNSe44lKDeqo; 2:r1rUj1HiguAQjssroybK9QoOEdgeknlr5YenjGr4tQwEhZX8dm+cAX5iGq5YT6jWDBF4zsDUrLggY2jSijdwzcumN3ZMnb2GPb0z91HUhHfXQ4Y4KHE++12Flu9hHsEC2c06dWN3bzvjaVw8fCJJ1A==; 6:6JnfdaM/XogiXRhb94+8wJU8Idqxz9TzDxBBrvr3BDW91Gy59VICVdzyoSJam1jlMbu6LvEfK1Tar7BXJ2KxQvyIfPz6N+eaiP2CS1hMoRnQPLgdiJ8djuPHF00Z7vuN9hxxGdGffrnwn7LAZd24zuj4K3E4PiYQI9QV+E3TBuuf9b+lYfKK30HTDuhBEAl7sKF3gc2FXGMfaPQjt664P/zGfWJ0BIkIRZBMAcdKgbKs/x9CQRKmE3Pvr9OgCUycWl5SWbWBtUN03nAYnlt4pt1bA/Y3RbgQYi9dBVJQFehXv7gtscjdN/txfnfH/whwcmVHgqXTcEz5MwzGi+2u4AS/qtIPWtkdmv4bScqBUNnk02tq/fpajD1vNmWFsV6WsfYG3LU7Tp1Q7Wlz0KbqFYp1fsW35imbg/lv5ETd01w2tna911tS6E0kN88G6GEgbbSqsCd0ZqGDiFiBdG/Z2bd7Edx/rN5Xd6UX4qcGkhO7fK786LyWOBfpSOT9ttGL X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB319; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520003)(5005006)(3002001); SRVR:SIXPR06MB319; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB319; X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB319; 3:Mfm3BCIGotvrTOt3hvH2XuZony93jwuK3S48YJW8NKsu6ES/4OesK03IRdWkzh8cEUYKV/rXAsiJHtB/isJJ24SNSW+7NCWbZkMLx0BgoQ9T/K7r+/4hXCbs330XDr5mo2DYbNuffBGetvhE+7Dugv8UejyweTARDI2Ph91XX+Nr5DIIELwSVn01HRMAZZlDHDzWu4/bA91HtWTrJOCqXPnTwgfW2S0WVD8vukEf95rlr0KLxPZnIlRnn4e1a/E+vnPls8cUgBHSPs/5amnfelwqaasP/MCqXh2BGp9zaxSvxOAvHgrVUlCc4Ks6zSHg X-Forefront-PRVS: 0608DEDB67 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(50466002)(83506001)(77156002)(122386002)(62966003)(23726002)(2950100001)(77096005)(54356999)(50986999)(66066001)(47776003)(46102003)(40100003)(86362001)(76176999)(229853001)(87976001)(189998001)(4001350100001)(19580405001)(53416004)(110136002)(92566002)(42186005)(5001960100002)(36756003)(575784001)(19580395003)(33646002)(13513002)(21314002); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB319; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:; X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB319; 9:jy/lAVKBnNIcoy8W5sv+VU30NM17jKeQf8SgQu1ugiJWPifg80CxTlzIRJ/Rs40noT5k72hT+NpLsN459CYTGU5ZiIP/CAes+wlgqmx7ARsh4zZBWqhxB/Qi2dxK2zuz96Dha3mtJxpUw3v87DV8sfpNHSk5+GfrMR0f/d0FRZGtvBgaB5eBg4ydUT5IsuvbX29OXnOy/i3E0FqoKOMLgqO9tkgfZoccHmVxWILJNDmXKrk0U/SafeYzYKqLmu0aXaChJiFrONDlkN9LHfm7WkjQ4p2fsKf7uGYpmXtlyZQbGrwzkOuBr99wjEmhdF03g2uiWaH4c3+aULOAxf2/4DyjXs9OAAQdK1EjLVC4kw2XkstYw8gmDOLo3G1d0vGdSlcIiNQtiFU8a4Y3Ue4KtOgo9Pqp/iElQgPPhPQ12JQgV+BC7yXqr6Zvvek3e12erdrj152vMBKSNZCglJ4yCOuhHbcysH8P9bgVNoJgsBkOl1UELeCZy5bxg9v/Jw/K3q0WGLrc/9i+V7T+CaPjck7EfIkC2zxh0qqv2yJBDVfvXGhUv7quaLhWI8ObuDNcS8cIkr6pGqHVR3rXOtIEXj3kVIr0I2NSJDaCPw19fcbydSfCq71cldwxiDEFH5DF9KJQDUfY7oWbXzx7vhQZdLL2ZZJyqyVhKZ+lbWlbzfqy0YbMUBLgGQPoDA11/hfWbpTR2zqfwkNYzPGexMHYrNB/XLtNzrkaTS3p9imjfTq32xj5xCeHBLJyivpv/sv0Mo4xEI6BuqUfoEY3o1krE5jrp3GCRgU6xrVKRBepKGbsSYwldQ+okJSRFfzkCpb/ITYfvgQ+2PKQKhRGibCgPhLlGI0y5yPscoJ04RrN5M2tvx/XVoSFXwTSkSTqPeedERgK+Z8MWptoS6zsuaIA/A== X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB319; 3:93dbQ1AheTyoqR62OBDqNxpXF4Wuxly661tnWKyzGVU0LK6K5HYcc2NUjXT9NYab03t0DcwL+awWhziRWDadeOmkJuZ+Pot+I20jR7u3i7uhz1hF/MDvrxQ8NY8cqJA/0Qnbe5tsCIDGCFYBGrjWJQ==; 10:hqoMllflK0pxyKlEMBmINU6Vm8g9YsniA7Up4m6G4eixsyYHYofZY61fjmweYeAcoLY8mG30VVihLDTupgEdhD41gulWJDP+uXgqpr7h7K4=; 6:puMuXqRWTENt5e1JEpBw9VvTGoPQDm2X3qWTs+JvSRVUd36LBVkBLrKxmgcQuFydH0SCynsWs5U0JV6m3ORUOHjrvK/XtrDTjfC9H5+froDHHhvkHRzPZsvy+3rb4Ov7V+MAnmgwp69PW+DYBvuaoQ== X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2015 06:21:34.9198 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB319 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 03/21] ASoC: rsrc-card: used "fe.xxx"/"be.xxx" name for dai_link 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 Current dai_link name is using "cpu_dai_name + codec_dai_name", but one of them is always "snd-soc-dummy-dai" when DPCM. This patch uses "fe.xxx" for cpu, "be.xxx" for codec. Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/rsrc-card.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index 050b0db..9a1926f 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -55,11 +55,13 @@ struct rsrc_card_dai { #define RSRC_FB_NUM 2 /* FE/BE */ #define IDX_CPU 0 #define IDX_CODEC 1 +#define DAI_NAME_NUM 32 struct rsrc_card_priv { struct snd_soc_card snd_card; struct rsrc_card_dai_props { struct rsrc_card_dai cpu_dai; struct rsrc_card_dai codec_dai; + char dai_name[DAI_NAME_NUM]; } dai_props[RSRC_FB_NUM]; struct snd_soc_codec_conf codec_conf; struct snd_soc_dai_link dai_link[RSRC_FB_NUM]; @@ -309,7 +311,7 @@ static int rsrc_card_dai_link_of(struct device_node *node, struct rsrc_card_dai_props *dai_props = rsrc_priv_to_props(priv, idx); struct device_node *cpu = NULL; struct device_node *codec = NULL; - char *name; + char *name = dai_props->dai_name; char prop[128]; int ret, cpu_args; @@ -348,18 +350,10 @@ static int rsrc_card_dai_link_of(struct device_node *node, /* Simple Card assumes platform == cpu */ dai_link->platform_of_node = dai_link->cpu_of_node; - /* DAI link name is created from CPU/CODEC dai name */ - name = devm_kzalloc(dev, - strlen(dai_link->cpu_dai_name) + - strlen(dai_link->codec_dai_name) + 2, - GFP_KERNEL); - if (!name) { - ret = -ENOMEM; - goto dai_link_of_err; - } - - sprintf(name, "%s-%s", dai_link->cpu_dai_name, - dai_link->codec_dai_name); + snprintf(name, DAI_NAME_NUM, "%s.%s", + dai_link->dynamic ? "fe" : "be", + dai_link->dynamic ? dai_link->cpu_dai_name : + dai_link->codec_dai_name); dai_link->name = dai_link->stream_name = name; dai_link->ops = &rsrc_card_ops; dai_link->init = rsrc_card_dai_init;