From patchwork Fri Apr 10 09:47:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6194091 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 496BB9F1C4 for ; Fri, 10 Apr 2015 09:47:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 776E42034F for ; Fri, 10 Apr 2015 09:47:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 57434203C1 for ; Fri, 10 Apr 2015 09:47:30 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CA96D265EAB; Fri, 10 Apr 2015 11:47:23 +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 BC9A9265DC4; Fri, 10 Apr 2015 11:47:14 +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 43038265DC6; Fri, 10 Apr 2015 11:47:14 +0200 (CEST) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 7B6A52605F9 for ; Fri, 10 Apr 2015 11:47:06 +0200 (CEST) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 10 Apr 2015 18:47:03 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 62CE64FA31; Fri, 10 Apr 2015 18:47:03 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 4C9AE8002E; Fri, 10 Apr 2015 18:47:03 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 47B118002D; Fri, 10 Apr 2015 18:47:03 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id UAJ02667; Fri, 10 Apr 2015 18:47:03 +0900 X-IronPort-AV: E=Sophos;i="5.11,556,1422889200"; d="scan'208";a="183801515" Received: from mail-sg1lp0086.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.86]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 10 Apr 2015 18:47:02 +0900 Received: from morimoto-PC.renesas.com (211.11.155.132) by SINPR06MB316.apcprd06.prod.outlook.com (10.141.115.155) with Microsoft SMTP Server (TLS) id 15.1.130.23; Fri, 10 Apr 2015 09:47:00 +0000 Message-ID: <87sic871ut.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown , Lars-Peter Clausen MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 10 Apr 2015 09:47:00 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: KAWPR01CA0003.jpnprd01.prod.outlook.com (25.161.24.13) To SINPR06MB316.apcprd06.prod.outlook.com (10.141.115.155) Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB316; X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(47776003)(53416004)(50986999)(87976001)(50466002)(229853001)(54356999)(33646002)(66066001)(36756003)(92566002)(77156002)(62966003)(42186005)(46102003)(19580395003)(19580405001)(86362001)(83506001)(40100003)(77096005)(122386002)(23726002)(46406003); DIR:OUT; SFP:1102; SCL:1; SRVR:SINPR06MB316; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006); SRVR:SINPR06MB316; BCL:0; PCL:0; RULEID:; SRVR:SINPR06MB316; X-Forefront-PRVS: 054231DC40 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2015 09:47:00.8829 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SINPR06MB316 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: soc-core: call snd_soc_runtime_set_dai_fmt() before soc_new_pcm() 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 snd_soc_runtime_set_dai_fmt() is called after soc_probe_link_dais(). this means snd_soc_dai_set_fmt() will be called after soc_new_pcm(). Before appling 1efb53a220b78fdfdbb97b726a2156713e75bdab (ASoC: simple-card: Remove support for setting differing DAI formats) simple-card user had (1) snd_soc_dai_set_fmt() -> soc_new_pcm(), but, after that it is (2) soc_new_pcm() -> snd_soc_dai_set_fmt(). At least rsnd driver is assuming (1) pattern. This patch move snd_soc_dai_set_fmt() into soc_probe_link_dais() after the dai_link->init section to solve this issue. Signed-off-by: Kuninori Morimoto --- >> Mark This patch solves my issue, but I don't know how much effect it has to other drivers. sound/soc/soc-core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 76bfff2..9777e78 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1324,6 +1324,9 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order) } } + if (dai_link->dai_fmt) + snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); + ret = soc_post_component_init(rtd, dai_link->name); if (ret) return ret; @@ -1642,12 +1645,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, card->num_of_dapm_routes); - for (i = 0; i < card->num_links; i++) { - if (card->dai_link[i].dai_fmt) - snd_soc_runtime_set_dai_fmt(&card->rtd[i], - card->dai_link[i].dai_fmt); - } - snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname), "%s", card->name); snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),