Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1361733ybe; Fri, 6 Sep 2019 16:39:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxb25i6Bqq++f++8O2ZyEhEPFfmSa9V3k2BsTyBQZbguwxyrd3k7ksvKNDLyBlxtqp5C6H4 X-Received: by 2002:a62:8749:: with SMTP id i70mr13324488pfe.12.1567813197265; Fri, 06 Sep 2019 16:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567813197; cv=none; d=google.com; s=arc-20160816; b=kmGh/ernB/g4yt6Yrji2WC9qzranlSWEuP8167rc/bdhhlKWjbBesmAnnn3Wk/Wt8m pGdtNXb/CSchqaLup7zZ1xnzoHJcLjgB4/+4V2YQkDYS6Vn0a8/O4jGcvnj87d20/yKj QwcvezM/q8O1d/TNj3AmxU6yTlMk7CVJRZLojAH4E0M5WM2/OYyEEPzBZbTWh8ni5FiZ eDalRSha83gmkp/dLTyT4o0798JKXKxRAF0Uv5gZVVzJjFb0dcwUMPGdSj1wYP2gSKRG XE+DFcDIGX3kb6n6f8NP25+cDqc9baSvbA3B4PGUITkztcoq3pLLO6/Dz4z7Yp1dBt1L dvhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=z3JI1t+rDNHQNE7MOKEJV1KBm9WoiygImZJ+Phss0h8=; b=IyzYXC0Nz2sEuSrc6I8qBAqs/FfY0BYYcsi4J6Y344I6QSvNUGQRWXbKsLJYxYI0da W5kJaHhmF0gHQuj0DVwJqdzcnczkGjBSWhDma1CrLlnR8hg3yT/YPwcpgRR4UoSDAMnN 2r2zvfca++50+yQ3hPWRLNpiGu4c5UNY4/m0FnU/rGCpK8I0fH4UGhWGLlTDtlSm+8eY MiORlpJW2RdLiIy5vWQ1+HssNzmVqkDN+i2ChoPuPb/2fIyUnx3iiq9up+8EpVxzVxaJ pBFe1UUXULAvIORewV2fi4cSV88RhVmEPdNmkNLRyrybdr0SGJ9KxY1ZNyepu/kqUceA sZHA== 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 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id a61si6150928plc.173.2019.09.06.16.39.41; Fri, 06 Sep 2019 16:39:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2404112AbfIFOUi (ORCPT + 99 others); Fri, 6 Sep 2019 10:20:38 -0400 Received: from mga18.intel.com ([134.134.136.126]:46030 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732020AbfIFOUi (ORCPT ); Fri, 6 Sep 2019 10:20:38 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2019 07:20:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,473,1559545200"; d="scan'208";a="384226932" Received: from linux.intel.com ([10.54.29.200]) by fmsmga006.fm.intel.com with ESMTP; 06 Sep 2019 07:20:36 -0700 Received: from ravisha1-mobl1.amr.corp.intel.com (unknown [10.255.36.89]) by linux.intel.com (Postfix) with ESMTP id 29AA35800FE; Fri, 6 Sep 2019 07:20:35 -0700 (PDT) Subject: Re: [alsa-devel] [PATCH] ASoC: bdw-rt5677: channel constraint support To: Brent Lu , alsa-devel@alsa-project.org Cc: cezary.rojewski@intel.com, liam.r.girdwood@linux.intel.com, yang.jie@linux.intel.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, kuninori.morimoto.gx@renesas.com, tglx@linutronix.de, linux-kernel@vger.kernel.org References: <1567733058-9561-1-git-send-email-brent.lu@intel.com> From: Pierre-Louis Bossart Message-ID: <391e8f6c-7e35-deb4-4f4d-c39396b778ba@linux.intel.com> Date: Fri, 6 Sep 2019 09:20:31 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1567733058-9561-1-git-send-email-brent.lu@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/5/19 8:24 PM, Brent Lu wrote: > BDW boards using this machine driver supports only stereo capture and > playback. Implement a constraint to enforce it. Humm, can you clarify what problem/error this patch fixes? There are already constraints on the hsw_dais[] where the channels are stereo only. Thanks -Pierre > > Signed-off-by: Brent Lu > --- > sound/soc/intel/boards/bdw-rt5677.c | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/sound/soc/intel/boards/bdw-rt5677.c b/sound/soc/intel/boards/bdw-rt5677.c > index 4a4d335..a312b55 100644 > --- a/sound/soc/intel/boards/bdw-rt5677.c > +++ b/sound/soc/intel/boards/bdw-rt5677.c > @@ -22,6 +22,8 @@ > > #include "../../codecs/rt5677.h" > > +#define DUAL_CHANNEL 2 > + > struct bdw_rt5677_priv { > struct gpio_desc *gpio_hp_en; > struct snd_soc_component *component; > @@ -245,6 +247,36 @@ static int bdw_rt5677_init(struct snd_soc_pcm_runtime *rtd) > return 0; > } > > +static const unsigned int channels[] = { > + DUAL_CHANNEL, > +}; > + > +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, > + * stereo > + */ > + > + runtime->hw.channels_max = DUAL_CHANNEL; > + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, > + &constraints_channels); > + > + return 0; > +} > + > +static const struct snd_soc_ops bdw_rt5677_fe_ops = { > + .startup = bdw_fe_startup, > +}; > + > /* broadwell digital audio interface glue - connects codec <--> CPU */ > SND_SOC_DAILINK_DEF(dummy, > DAILINK_COMP_ARRAY(COMP_DUMMY())); > @@ -273,6 +305,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = { > }, > .dpcm_capture = 1, > .dpcm_playback = 1, > + .ops = &bdw_rt5677_fe_ops, > SND_SOC_DAILINK_REG(fe, dummy, platform), > }, > >