Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp781475ybt; Wed, 1 Jul 2020 09:49:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXWGpk8QoHddTGc5HvlG3AxQHnErL99lZf9GV3AqYcijFZV6JUoY9JLsciYplyrZPcNJZi X-Received: by 2002:a17:906:2c53:: with SMTP id f19mr21706844ejh.523.1593622168787; Wed, 01 Jul 2020 09:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593622168; cv=none; d=google.com; s=arc-20160816; b=HzKsAThjWSEVbXY138xkQZZ+nO27LdiF1BmtpSzd0rwAp1WzfAkK//PrKSm3+3rL8o TZU5JYSRpwTBYrEiTMwyeea3Mca8V3KObVWIqQckGOFD9s2TIBpY+jiLizxWOoP8wUu3 rfscF81fJeP+y+fzXhTtcT5DXdxRFuqWwegsFoghi2aUayFfe6L32ZGj1PcDV+svmy9U wAUKukdts1+hivSru+NOhfB21poK0tX3S/IyV/ftx5PRRZDSqRs5emF43OZadojJUbda /K0ceC7DTPOp6qnXBNBqoRhHtAosaUK3tUTFqlE4lrcoyosxDgzNsesC28rk7bxgBZGY rxmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=/+SjJaNKcMnxSRlphTo/SkpBl4pBIVZ36xmOIDyG5Kc=; b=C7gh4gkKUvFcgzkcKyN/iPodbCkc3MJHRCD1J6vp9KmDqxYkhGlsqfny3UZR4JRIR1 SjPt6VJ1evTGDcwU5CzpO3/eI/gAWVth3N4VSwFkDwX9KEzD72FazEziNs7Vrcc/v/89 J2t7xcE/YmhHzFUgECmO7tF1VzQ5KlCvUxLDQlhXC3csJqisKEsXkxnKTsLU8ZZ6D5Be M/jLrlsTE7MQNifCqoH5CL5OKx0nU/d6w+BGC8zlugxArdFTEhEo6dM8ZkndKMy94BQn XLeAFk3egHneA+S8pNThNDiahKRsJFJ6PhTuZzpWGDufpmoZnJ6zoN3mJpIwfqADV6Y6 ohOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si2263513edx.297.2020.07.01.09.49.04; Wed, 01 Jul 2020 09:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732376AbgGAQsV (ORCPT + 99 others); Wed, 1 Jul 2020 12:48:21 -0400 Received: from mga02.intel.com ([134.134.136.20]:6577 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732161AbgGAQsV (ORCPT ); Wed, 1 Jul 2020 12:48:21 -0400 IronPort-SDR: bsxF/NLPFlMDrn5eMNYaXqtWeQD/O7E9ann8WKBYCEf49bYl50D9+aN0Sy/cW+zmE4NhoCIZFn MryJDES3pWbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="134929227" X-IronPort-AV: E=Sophos;i="5.75,301,1589266800"; d="scan'208";a="134929227" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.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?= 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 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?