From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6643C433E0 for ; Wed, 1 Jul 2020 16:49:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 316D42067D for ; Wed, 1 Jul 2020 16:49:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="d5x0Qm3j" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 316D42067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B87E6167B; Wed, 1 Jul 2020 18:48:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B87E6167B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1593622158; bh=9yOVr4qOgk03XtSkEixCsQ8DspNpEIilMaC3NDAM4cE=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=d5x0Qm3jWxxo7Stg2hOlM80i/jgBq70J46Q33NFVJcuJ+1pUUpyFTyR/U6WDhG27P sQB9Zaszh7w1Ao5JzWqfCTbc4xIRSifdHXIxJycTlW9bmA2IwQWcRL691g5X4vR7nn OLwCZmnLxocL1yy5k2Orc5/DP3RFefZGWSa8MqB0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46FF4F8020C; Wed, 1 Jul 2020 18:48:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4102AF80217; Wed, 1 Jul 2020 18:48:27 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 46736F801D8 for ; Wed, 1 Jul 2020 18:48:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 46736F801D8 IronPort-SDR: tppwL6OeZG0MRdSwNONwFJeVHOerwIvexs8xQgoYUESmSx7mDYe35NkQlSnAzS21kyesY6XaVK Et1QuOC5AvRA== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="211693587" X-IronPort-AV: E=Sophos;i="5.75,301,1589266800"; d="scan'208";a="211693587" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 09:48:20 -0700 IronPort-SDR: ywwjct/MbgHFM/ViP9O9jEEhk1M7aKesW/NJjeFQnWmYsFWc6cSzOYE9BcpU3t2rIRRgEn4U84 lRc91hDufqxg== X-IronPort-AV: E=Sophos;i="5.75,301,1589266800"; d="scan'208";a="455167707" Received: from dsapozni-mobl1.amr.corp.intel.com (HELO [10.251.16.243]) ([10.251.16.243]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 09:48:18 -0700 Subject: Re: [PATCH v3] ASoC: Intel: kbl_rt5663_rt5514_max98927: Split be_hw_params_fixup function To: "N, Harshapriya" , =?UTF-8?Q?=c5=81ukasz_Majczak?= References: <20200521162518.1809995-1-lma@semihalf.com> <3c89e614-81f5-ba87-19a9-fbe9f5c73925@linux.intel.com> <475fb5c0-9b26-a8f6-c102-25c7775bc2ca@linux.intel.com> <268b11b6-9f4c-d769-a7f9-536d77198705@linux.intel.com> From: Pierre-Louis Bossart Message-ID: <7e38bb2e-2132-d305-e94d-043fa53bd836@linux.intel.com> Date: Wed, 1 Jul 2020 11:48:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: "alsa-devel@alsa-project.org" , Jie Yang , Radoslaw Biernacki , Ross Zwisler , "linux-kernel@vger.kernel.org" , Liam Girdwood , "M R, Sathya Prakash" , Bob Brandt , Marcin Wojtas , Alex Levin X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On 7/1/20 11:37 AM, N, Harshapriya wrote: >> >>>> For speakers and headsets its 48Khz, 2 ch and 24 bit and this >>>> setting is done based on the front-end dai For speakers, however >>>> support only >>>> 16 bit, so we set it back to 16 bit If the front end dai is dmic, >>>> then the channel >>> is set to either 2 or 4 dmic_constraints. No other formats need to be set. >>>> >>>> All the SSP1 usages do not have the same parameters (as dmic is on >>>> SSP1 and its different as given above) Most parameters are same for >>> speakers and headset which are on different SSP. This is the reason we >>> had a single fixup function. >> On SSP1, for dmic we need to fix the channels which is derived from dmic_num >> of the snd_soc_acpi_mach structure based on the number of dmic on the >> board. >> The channel is something that might be different from speakers. >> We might not want to constraint the dmic capture to always be 48Khz as well. >> Given this, there seems to me, 2 ways to set it: >> 1. Derive if the fixup is being called for dmic or speaker 2. Having a new dailink >> >> If #2 is not preferred (going by Pierre's comments), can we use rtd- >>> cpu_dai/codec_dai->name to figure out if its for dmic or speaker? >> I can test this and get back to you. > Tested and the following is something we can use without creating a new dailink. > struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); > if (!strcmp(codec_dai->name, KBL_REALTEK_DMIC_CODEC_DAI)) { > if (params_channels(params) == 2 || DMIC_CH(dmic_constraints) == 2) > channels->min = channels->max = 2; > else > channels->min = channels->max = 4; > } else { > rate->min = rate->max = 48000; > channels->min = channels->max = 2; > snd_mask_none(fmt); > snd_mask_set_format(fmt, pcm_fmt); > } > > Pierre, thoughts? thanks Harsha, that looks like what I had in mind, but my earlier question was why we deal with the rates and formats only in the last case?