From patchwork Thu Feb 18 12:31:24 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: 384935 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 01EB0C433DB for ; Thu, 18 Feb 2021 12:33:46 +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 1E8F261606 for ; Thu, 18 Feb 2021 12:33:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E8F261606 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 84EC6823; Thu, 18 Feb 2021 13:32:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 84EC6823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1613651623; bh=aDoVqxljDfiJlucQoKpRWcch+dQ6cV/CKt1gQRXRGFE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WAgKS0SCf0eazqK5qhQ6lfHvqACfzzYmXSzO8+4El3IDr2ZM7h0KpESwN0OFgYN3K Kp6m7kerMjgKBPT/KPQy4wIpjAbTlKi4pI70qkQOXGZh6JYtkAHvOmy7nWfFff8L4/ SxNOawUav4f7rUooOmjXaMPqgltlxPaVipHXa79E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 74389F80229; Thu, 18 Feb 2021 13:32:06 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E3719F80274; Thu, 18 Feb 2021 13:32:03 +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 EB19AF80155 for ; Thu, 18 Feb 2021 13:31:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EB19AF80155 IronPort-SDR: HVsNrMFwu0r3TV6N4PyLbfI1xJsAkjKLYDQPnf2VijQGqc8KfhF0UVXTOI+wQymJxt+608ZtLm 0FGaZjnwDU0g== X-IronPort-AV: E=McAfee;i="6000,8403,9898"; a="163264980" X-IronPort-AV: E=Sophos;i="5.81,187,1610438400"; d="scan'208";a="163264980" 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:50 -0800 IronPort-SDR: Evj+bv0wuUAnAhsaCVFvvIPxcd9kGZsMXeFrYMXzpIXeRQfhZm86t17xafXEUZiTI0q9KVnpts kPdu4cgp4Jsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,187,1610438400"; d="scan'208";a="364821594" Received: from snappy-s2600wt2r.iind.intel.com ([10.223.163.26]) by orsmga006.jf.intel.com with ESMTP; 18 Feb 2021 04:31:48 -0800 From: vamshi.krishna.gopal@intel.com To: alsa-devel@alsa-project.org Subject: [PATCH 1/2] ASoC: Intel: kbl: Remove option of choosing CH count based on pdata Date: Thu, 18 Feb 2021 18:01:24 +0530 Message-Id: <20210218123125.15438-2-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 Remove option of choosing channel count based on pdata for kbl_rt5663_max98927 machine driver. As User-space expects 4ch DMIC data and uses channel-map in ucm to figure-out the desired channel to use, Hence removing driver change to allow choosing channels. Signed-off-by: Naveen Manohar Acked-by: Vinod Koul Signed-off-by: Vamshi Krishna Gopal --- sound/soc/intel/boards/kbl_rt5663_max98927.c | 26 -------------------- 1 file changed, 26 deletions(-) diff --git a/sound/soc/intel/boards/kbl_rt5663_max98927.c b/sound/soc/intel/boards/kbl_rt5663_max98927.c index 9a4b3d0973f6..adfa2c044aed 100644 --- a/sound/soc/intel/boards/kbl_rt5663_max98927.c +++ b/sound/soc/intel/boards/kbl_rt5663_max98927.c @@ -524,26 +524,6 @@ static struct snd_soc_ops kabylake_ssp0_ops = { .hw_params = kabylake_ssp0_hw_params, }; -static unsigned int channels_dmic[] = { - 2, 4, -}; - -static struct snd_pcm_hw_constraint_list constraints_dmic_channels = { - .count = ARRAY_SIZE(channels_dmic), - .list = channels_dmic, - .mask = 0, -}; - -static const unsigned int dmic_2ch[] = { - 2, -}; - -static const struct snd_pcm_hw_constraint_list constraints_dmic_2ch = { - .count = ARRAY_SIZE(dmic_2ch), - .list = dmic_2ch, - .mask = 0, -}; - static int kabylake_dmic_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -970,7 +950,6 @@ static struct snd_soc_card kabylake_audio_card_rt5663 = { static int kabylake_audio_probe(struct platform_device *pdev) { struct kbl_rt5663_private *ctx; - struct snd_soc_acpi_mach *mach; int ret; ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); @@ -985,11 +964,6 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card->dev = &pdev->dev; snd_soc_card_set_drvdata(kabylake_audio_card, ctx); - mach = pdev->dev.platform_data; - if (mach) - dmic_constraints = mach->mach_params.dmic_num == 2 ? - &constraints_dmic_2ch : &constraints_dmic_channels; - ctx->mclk = devm_clk_get(&pdev->dev, "ssp1_mclk"); if (IS_ERR(ctx->mclk)) { ret = PTR_ERR(ctx->mclk); 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);