From patchwork Thu Feb 18 12:31:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gopal, Vamshi Krishna" X-Patchwork-Id: 384432 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 BF2C3C433E0 for ; Thu, 18 Feb 2021 12:33:50 +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 CA24260C3D for ; Thu, 18 Feb 2021 12:33:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA24260C3D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=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 42CDA1662; Thu, 18 Feb 2021 13:32:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 42CDA1662 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1613651628; bh=MijjuBs6/+CkMDOTXX2/4aaZBXzeX8MyibLd3PESfi0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iximqBZzQ3yxqqivLPJPPLpzIHqsi2ZrpLhPv1W13uhmx7cTqRcpi5Ei2+V1AN23O k9Qf0s2brEJNV897JZqm87+bAUeJf23xxPfrvVk5jAj1qPCqzooYJSR+zkO0K9XtiG ROhLkBDq8T8qRUkg+VSszIlpJDFSOd1KlpyuE1M4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 14FEDF80274; Thu, 18 Feb 2021 13:32:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 74E87F80274; Thu, 18 Feb 2021 13:32:06 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 0C5ABF8015A for ; Thu, 18 Feb 2021 13:31:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0C5ABF8015A IronPort-SDR: 5lm29FsGYRUH2nCsWvzhmRoCfbZtM/24TE57tTj2zmHrn0CjHRBVwSTbOsu+w76j/fwMJpxiFY Y573ffULJyOw== X-IronPort-AV: E=McAfee;i="6000,8403,9898"; a="163264986" X-IronPort-AV: E=Sophos;i="5.81,187,1610438400"; d="scan'208";a="163264986" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2021 04:31:52 -0800 IronPort-SDR: JASdCYefBoISByXmV8hKQe/EdID6gB0lNKdpFeKo3IAPV0At5uNnJoI5mvndJraY43ORXEcsJM sho13oX/R+CA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,187,1610438400"; d="scan'208";a="364821601" Received: from snappy-s2600wt2r.iind.intel.com ([10.223.163.26]) by orsmga006.jf.intel.com with ESMTP; 18 Feb 2021 04:31:50 -0800 From: vamshi.krishna.gopal@intel.com To: alsa-devel@alsa-project.org Subject: [PATCH 2/2] ASoC: Intel: kbl: update dmic fixup params Date: Thu, 18 Feb 2021 18:01:25 +0530 Message-Id: <20210218123125.15438-3-vamshi.krishna.gopal@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210218123125.15438-1-vamshi.krishna.gopal@intel.com> References: <20210218123125.15438-1-vamshi.krishna.gopal@intel.com> Cc: harshapriya.n@intel.com, naveen.m@intel.com, biernacki@google.com, sathya.prakash.m.r@intel.com 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" From: Naveen Manohar Update dmic fixup params to always expose QUAD channel capture device, enabling User-space to control channel count. Assign min and max channel only based on input hw_params. Signed-off-by: Naveen Manohar Acked-by: Vinod Koul Signed-off-by: Vamshi Krishna Gopal --- sound/soc/intel/boards/kbl_rt5663_max98927.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/kbl_rt5663_max98927.c b/sound/soc/intel/boards/kbl_rt5663_max98927.c index adfa2c044aed..a1bcde7851b7 100644 --- a/sound/soc/intel/boards/kbl_rt5663_max98927.c +++ b/sound/soc/intel/boards/kbl_rt5663_max98927.c @@ -29,9 +29,9 @@ #define DMIC_CH(p) p->list[p->count-1] #define MAXIM_DEV0_NAME "i2c-MX98927:00" #define MAXIM_DEV1_NAME "i2c-MX98927:01" +#define QUAD_CHANNEL 4 static struct snd_soc_card *kabylake_audio_card; -static const struct snd_pcm_hw_constraint_list *dmic_constraints; static struct snd_soc_jack skylake_hdmi[3]; struct kbl_hdmi_pcm { @@ -365,6 +365,16 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = { .mask = 0, }; +static const unsigned int channels_quad[] = { + QUAD_CHANNEL, +}; + +static const struct snd_pcm_hw_constraint_list constraints_channels_quad = { + .count = ARRAY_SIZE(channels_quad), + .list = channels_quad, + .mask = 0, +}; + static int kbl_fe_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -480,7 +490,7 @@ static int kabylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_interval *chan = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); - if (params_channels(params) == 2 || DMIC_CH(dmic_constraints) == 2) + if (params_channels(params) == 2) chan->min = chan->max = 2; else chan->min = chan->max = 4; @@ -528,9 +538,9 @@ static int kabylake_dmic_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; - runtime->hw.channels_max = DMIC_CH(dmic_constraints); + runtime->hw.channels_min = runtime->hw.channels_max = QUAD_CHANNEL; snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, - dmic_constraints); + &constraints_channels_quad); return snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);