Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3606183ybb; Mon, 13 Apr 2020 11:37:50 -0700 (PDT) X-Google-Smtp-Source: APiQypI7LsHoOuuHd+xZbo2opXP7eHyy5/ZZOpsL+4AFUvm1Qd7fYq4PrSRFIqeP1rz3eZS22Epu X-Received: by 2002:a50:e8cd:: with SMTP id l13mr8393901edn.131.1586803070475; Mon, 13 Apr 2020 11:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586803070; cv=none; d=google.com; s=arc-20160816; b=cx/04I/p2Yv3dMvW87PJwSs+7W9XnJ41mPWOopAWrPNbXP+QwiS/JrYT+MYfnJXL0n u3OFRuGEVox/MNE1OTMOLw9LY/dr4Cfx0fQPm0Wx9pMgMZafBabnlWhkinEsegmtMRIT Hqptjp7aWCDG9L43b/jlaiSYcudZqdcq4qLk+UApoJL92LdrW6OG9Pjc7+A/koEmb07G RrRm1jpisWVoJJ+YSmvPt4O2oTUrziOtDyuTDm3Hg4Dw/gYlc5p7oMr4+FFlkxHh7Yt7 SJ5dGGJPih50LN+NzOgzQ8SduhRKhK3JoCmEJc0ylrKi6Js1OzOBRylJSWTUp6jhBwIF mpOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=6v8o8wIrqeyCpgnjMnKyNu5QJum/GST6WU35eyOjHa8=; b=d9Mbn9Cu9YjYnRUaqdEyrX4YW2xTOKshz3172vJ8dayqqLMSuc3TpNChZiTygRfgwD 5PyKNUPAOMXc3GquMEbs30GVvXbfCE1+dN4uq1mPtjlJhMywNYG+hFRY/Gv3kXMbRCxL 1HSnOQDEKDu7pKe/yTDRX5hxdsgxrrJurOq9ndLTM8+c93CYMQzq1rJpmF7EV8zP15yG /gDsZBa+M4IGw5nKAi0ro2ygA4/p1JKJzvfyeCXdU1xz5L3YaH4VRt2XGy4NeV3FDVgQ zAmjf5lVCj/ZYeab70WGFGa1vXWPGb8lV6OdG+ATJpP+aV3QUFB9VyaQKYj1L209E/Fe +0yA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for 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 q1si7214210eja.190.2020.04.13.11.37.21; Mon, 13 Apr 2020 11:37:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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: best guess record for 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 S1729314AbgDMIQI (ORCPT + 99 others); Mon, 13 Apr 2020 04:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.18]:42070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727971AbgDMIQG (ORCPT ); Mon, 13 Apr 2020 04:16:06 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAB97C00860B for ; Mon, 13 Apr 2020 01:16:06 -0700 (PDT) IronPort-SDR: 5x/rSgGPJGvOiv9Fcn7nGN3Y1PazUWR1RISwSnpOO7Xj0c+Kpk1rAmWMnFNAe12U3sjtjexQk3 RdCQEQ+Jc6Mw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 01:16:06 -0700 IronPort-SDR: LMtMC2kw108QPa4vZkYR1RcM22cb0TDcUaSzwuq3e3b9zFGeYHIfbCaV+ODipKT4ZoPeMi8wlc XpDLiqh5W78w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,378,1580803200"; d="scan'208";a="245088427" Received: from brentlu-desk0.itwn.intel.com ([10.5.253.11]) by fmsmga008.fm.intel.com with ESMTP; 13 Apr 2020 01:16:04 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , Ben Zhang , Mac Chiang , Guennadi Liakhovetski , Kuninori Morimoto , Brent Lu , linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: bdw-rt5650: incorrect rate of PCM data Date: Mon, 13 Apr 2020 16:09:18 +0800 Message-Id: <1586765358-18474-1-git-send-email-brent.lu@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implement a constrain to exclude 3-channel capture since only 2 and 4 channel capture are supported on the platform. Signed-off-by: Brent Lu --- sound/soc/intel/boards/bdw-rt5650.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sound/soc/intel/boards/bdw-rt5650.c b/sound/soc/intel/boards/bdw-rt5650.c index af2f502..eedbdad 100644 --- a/sound/soc/intel/boards/bdw-rt5650.c +++ b/sound/soc/intel/boards/bdw-rt5650.c @@ -83,6 +83,36 @@ static struct snd_soc_jack_pin mic_jack_pin = { .mask = SND_JACK_MICROPHONE, }; +static const unsigned int channels[] = { + 2, 4, +}; + +static const struct snd_pcm_hw_constraint_list constraints_channels = { + .count = ARRAY_SIZE(channels), + .list = channels, + .mask = 0, +}; + +static int bdw_fe_startup(struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + + /* + * On this platform for PCM device we support, + * 2 or 4 channel capture + */ + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_hw_constraint_list(runtime, 0, + SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + + return 0; +} + +static const struct snd_soc_ops bdw_rt5650_fe_ops = { + .startup = bdw_fe_startup, +}; + static int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { @@ -234,6 +264,7 @@ static struct snd_soc_dai_link bdw_rt5650_dais[] = { .name = "System PCM", .stream_name = "System Playback", .dynamic = 1, + .ops = &bdw_rt5650_fe_ops, #if !IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL) .init = bdw_rt5650_rtd_init, #endif -- 2.7.4