Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3241465ybb; Mon, 13 Apr 2020 03:57:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJnzbp8xFFBD/xHRcaRiYckslcw9ueSNAwVRy88wQQ7Ocv90dGqhRXOFouzUOOsV3RxCdEv X-Received: by 2002:a17:906:a857:: with SMTP id dx23mr7520565ejb.52.1586775442870; Mon, 13 Apr 2020 03:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586775442; cv=none; d=google.com; s=arc-20160816; b=bhcu438V5T0Nf2vrTuSv0qmTDaXWBiEiN17PxLjENfoVkU7chb9SZ4Z0MseCpudBfo oknxWywkKDSFp630wZTxPjHs90O9jvIsrrFpy8mQTzsHLxvzqQ6Y3RlQVSfIDKPM3X+l lqU0jg7/RFrsRtiVrgA2P6S+AGs72dP3OpFPHgNOiYld0wh0n3oyRlk94LZZjnigu6a6 UcsNpH8ui0Kj/Qq4zkP7u1V/CLviIS71b3tYcCvJr52rEmjgShvbEPjO07oS9GuKOH4o 7EN4Bb8YdAIU3X1F2J6ZZ1rk0/hWf6Jh3GrIPUzQ8NQUfOGVhXe/MKaY8hSC4hnYax9O NnUw== 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=k5rkJlQIAcDMBNa6HjLNo1qZ4J0Wy8wLLjQD0DbX2WpPmkdktDU4aXJjekHxeweGPM xrjSgne/OEZ06tNiUGWUzWkkgOYOZuUcJyD403bzrkHmV+ShvObPGleaLeMDX0I6qCbF 6fav6NW1EOr9ULgROsPELdHS34eZ5iVoXF4kuhEQMXUgH5JOQM6JM/hMmpESL6dH7GpG MrIil3Kcd1lGNyqgFLtSpJtGvBTdUfz5NluVItitxWHTxvNenTschslLBXvsoh/oQPQD sgEa+dpPnN7UH5lcMIEZ62O2H98P/XI4aKDqie2N9/nhpZxKQJj7tvP4AdrnMmfy0LpD vwRQ== 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 n24si6029619edr.335.2020.04.13.03.56.56; Mon, 13 Apr 2020 03:57:22 -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 S1728399AbgDMIfn (ORCPT + 99 others); Mon, 13 Apr 2020 04:35:43 -0400 Received: from mga04.intel.com ([192.55.52.120]:60863 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbgDMIez (ORCPT ); Mon, 13 Apr 2020 04:34:55 -0400 IronPort-SDR: odkCGTvyB8UjCzKWLrUJ3FfJP/p13xW+1OfF8VR58J2MkpPqiPebo3DuBHQMofM3IQmDbyAuUo lr63i/9XxwIg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 01:34:55 -0700 IronPort-SDR: XkPBaEPk3nYKkijQE0zTcybK4lHwfULNgyRdgi64MnHpbewtkjOe0HJmutO6/sflQDAWZZzaHC qF1yJLGFfZAg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,378,1580803200"; d="scan'208";a="252813717" Received: from brentlu-desk0.itwn.intel.com ([10.5.253.11]) by orsmga003.jf.intel.com with ESMTP; 13 Apr 2020 01:34:52 -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 v2] ASoC: bdw-rt5650: remove 3-channel capture support Date: Mon, 13 Apr 2020 16:28:53 +0800 Message-Id: <1586766533-18557-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