From patchwork Fri May 27 04:31:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhi, Yong" X-Patchwork-Id: 9137625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F01960759 for ; Fri, 27 May 2016 04:30:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 336E227CCD for ; Fri, 27 May 2016 04:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2750828107; Fri, 27 May 2016 04:30:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86EBF27CCD for ; Fri, 27 May 2016 04:30:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 98C55265DE9; Fri, 27 May 2016 06:30:12 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 34E55265FB4; Fri, 27 May 2016 06:29:14 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8C425265FB4; Fri, 27 May 2016 06:29:12 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by alsa0.perex.cz (Postfix) with ESMTP id D7F5326547F for ; Fri, 27 May 2016 06:28:17 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 26 May 2016 21:28:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,372,1459839600"; d="scan'208";a="709634300" Received: from yzhi-z87x-ud5h.jf.intel.com ([134.134.159.153]) by FMSMGA003.fm.intel.com with ESMTP; 26 May 2016 21:28:16 -0700 From: Yong Zhi To: broonie@kernel.org Date: Thu, 26 May 2016 21:31:07 -0700 Message-Id: <1464323467-28911-1-git-send-email-yong.zhi@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464182357-1305-1-git-send-email-yong.zhi@intel.com> References: <1464182357-1305-1-git-send-email-yong.zhi@intel.com> Cc: alsa-devel@alsa-project.org, srinivas.sripathi@intel.com, vinod.koul@intel.com, yang.a.fang@intel.com, sathya.prakash.m.r@intel.com, jeeja.kp@intel.com, vedang.patel@intel.com, Yong Zhi Subject: [alsa-devel] [PATCH v3 4/5] ASoC: Intel: Skylake: Add channel constraints for refcap X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add constraint for ref DMIC to match with the topology firmware configured for machine sklnau8825max. Signed-off-by: Yong Zhi --- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/intel/boards/skl_nau88l25_max98357a.c b/sound/soc/intel/boards/skl_nau88l25_max98357a.c index 43fab12..57c3c86 100644 --- a/sound/soc/intel/boards/skl_nau88l25_max98357a.c +++ b/sound/soc/intel/boards/skl_nau88l25_max98357a.c @@ -352,8 +352,22 @@ static struct snd_pcm_hw_constraint_list constraints_16000 = { .list = rates_16000, }; +static const unsigned int ch_mono[] = { + 1, +}; + +static const struct snd_pcm_hw_constraint_list constraints_refcap = { + .count = ARRAY_SIZE(ch_mono), + .list = ch_mono, +}; + static int skylake_refcap_startup(struct snd_pcm_substream *substream) { + substream->runtime->hw.channels_max = 1; + snd_pcm_hw_constraint_list(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_refcap); + return snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &constraints_16000);