From patchwork Fri Apr 10 09:21:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6193811 Return-Path: X-Original-To: patchwork-linux-sh@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 BBE65BF4A6 for ; Fri, 10 Apr 2015 09:22:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE059203DA for ; Fri, 10 Apr 2015 09:22:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D959D203A0 for ; Fri, 10 Apr 2015 09:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754365AbbDJJWS (ORCPT ); Fri, 10 Apr 2015 05:22:18 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:38982 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754506AbbDJJV6 (ORCPT ); Fri, 10 Apr 2015 05:21:58 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 10 Apr 2015 18:21:57 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 1BFEE4EC08; Fri, 10 Apr 2015 18:21:57 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 13F088002F; Fri, 10 Apr 2015 18:21:57 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 0F0908002D; Fri, 10 Apr 2015 18:21:57 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id UAM26407; Fri, 10 Apr 2015 18:21:56 +0900 X-IronPort-AV: E=Sophos;i="5.11,555,1422889200"; d="scan'208";a="183799448" 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:21:55 +0900 Authentication-Results: metafoo.de; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.132) by HKNPR06MB305.apcprd06.prod.outlook.com (10.141.37.16) with Microsoft SMTP Server (TLS) id 15.1.136.25; Fri, 10 Apr 2015 09:21:54 +0000 Message-ID: <87vbh4730i.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Lars-Peter Clausen CC: Mark Brown , Linux-ALSA , Simon , Liam Girdwood , Linux-SH Subject: Re: [alsa-devel] [PATCH 3/3] ASoC: simple-card: Remove support for setting differing DAI formats In-Reply-To: <55278F58.6030909@metafoo.de> References: <87fv8v4353.wl%kuninori.morimoto.gx@renesas.com> <87bnjj431h.wl%kuninori.morimoto.gx@renesas.com> <878ue08ngb.wl%kuninori.morimoto.gx@renesas.com> <55278F58.6030909@metafoo.de> User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 10 Apr 2015 09:21:54 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: TY1PR0201CA0039.apcprd02.prod.outlook.com (25.164.90.177) To HKNPR06MB305.apcprd06.prod.outlook.com (10.141.37.16) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB305; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(51704005)(87976001)(77096005)(50986999)(66066001)(76176999)(40100003)(47776003)(54356999)(83506001)(53416004)(92566002)(2950100001)(122386002)(62966003)(42186005)(77156002)(50466002)(46406003)(110136001)(33646002)(93886004)(46102003)(86362001)(36756003)(23726002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKNPR06MB305; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:HKNPR06MB305; BCL:0; PCL:0; RULEID:; SRVR:HKNPR06MB305; X-Forefront-PRVS: 054231DC40 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2015 09:21:54.3494 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKNPR06MB305 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Lars Thank you for your feedback > > Before: set_fmt -> pcm_new > > After: pcm_new -> set_fmt > > > > My driver adds kctrl on pcm_new timing, and it refers > > set_fmt's settings. but now, set_fmt happen *after* pcm_new. > > (it adds new kctrl if it has SND_SOC_DAIFMT_CBS_CFS) > > What does that control do? This seems to be a bit of a layering > violation to create a control in the PCM driver based on the > configuration of the DAI link. Our device can support runtime sampling rate convert, and our driver is supporting it via DPCM. but, this feature needs "clock master". This control is for it. > > --------------------------------------- > > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c > > index 76bfff2..24d6733 100644 > > --- a/sound/soc/soc-core.c > > +++ b/sound/soc/soc-core.c > > @@ -1604,6 +1604,12 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) > > } > > } > > > > + 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); > > + } > > + > > This seems to be to early, the DAI's should at least have been > probed. I think we should put it in soc_probe_link_dais() after the > the dai_link->init section. Thanks soc_probe_link_dais() needs many loops for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST; order++) { for (i = 0; i < card->num_links; i++) { but, it is checking if (order != SND_SOC_COMP_ORDER_LAST) return 0; This means we can put it under soc_probe_link_dais() I can send formal patch if this is OK. # But, I wonder what is good explain about this patch ... # indeed I noticed this issue from # 1efb53a220b78fdfdbb97b726a2156713e75bdab # (ASoC: simple-card: Remove support for setting differing DAI formats) # but, it is simple-card user only... -------- --------- Best regards --- Kuninori Morimoto -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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),