Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3096409imc; Wed, 13 Mar 2019 08:44:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoFdwWi2sL0VBx/Sv5KA8qzvnwEdFr8DjOsH9RcooOqrOJbcpPhACkQCHMavZcz3x2MmYj X-Received: by 2002:a63:581c:: with SMTP id m28mr5082492pgb.332.1552491879856; Wed, 13 Mar 2019 08:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552491879; cv=none; d=google.com; s=arc-20160816; b=LxeaELjYJXT1ZzHSj8HCNDnkp9cjkPlayZog+EIW6kJs+0karPkC0SXRs5hbZWtw2M CIYd24OYD3TsDbTjffEh+ZrZHkdaJiEW+jssxNFvfAr/QUcnJ0OqHHUi86T7RI+pxYbh OdU1p7DUrOBfC6442Q1FIQD4VRoZHMDhIlyl7ZT2ozjQfWTGiEVO+H13PQ4Zd77emEJq XjQmhFI8/nKOBBlcKpXfZ3ehK7IKEs1UNtEps4674OO5uHQ5mRsjcTQhj+3+swiMCmja HxgWIhB9wyz5ACKhBPq1vt4kapJSZ2BmZwkM+CoA6mljKAnf1qOY5uvp0S7hzTY+8Df5 Ksyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=e66MHKtgtjsKcdJyO3q9b1HmidwPpQhR0oda6cXIg6I=; b=k2S3Bz23Gjf31L0pCPDJM9YorrsknxlJXkh++TbPlgaZAlQew/eu1JvyaWFJmRglJK KJ7tv9Vh5R4bMtjgaI4mkH2CXbC55KPD6oAMDVPrk/fE9JEf41UnG7xFTWM2RA5RyaL0 w0moJlmZPz4WLl0tm9JFD5s6390vgCpPe/vk40mLIxYyz96cJV0iSFpp26Xbz8IZEQx9 VV1OI584XDtuTeZyg9Cdsq6xkzfHHnE3nYYDRk+3A7Uu6cekOONdv/AEcCpOMsbeMPZI gVq2rrraldL9Cn7RDz0yicDLoBPajW+YncTXglIKuhmdewZJmYkmITwZARCcDTSJBO/5 q2Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=HIs1orLJ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r9si9692669pgp.193.2019.03.13.08.44.22; Wed, 13 Mar 2019 08:44:39 -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; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=HIs1orLJ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726735AbfCMPjA (ORCPT + 99 others); Wed, 13 Mar 2019 11:39:00 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:49506 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfCMPi6 (ORCPT ); Wed, 13 Mar 2019 11:38:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=e66MHKtgtjsKcdJyO3q9b1HmidwPpQhR0oda6cXIg6I=; b=HIs1orLJadXk 1bbg0mizKiQ0V1fQ7P61RBL1qRhqNWq0/1TjH8p9L49AcVCP8KkA8CvmVU+nE1zPvfw73vypGGPu0 nCgZBv8sJvMcXBsKsUx6QktOmZQue55K4Z6UT+krnpqfxb1g/a2UpuNg7z0P/ttHuRfXQCa3JqhaB OY2zI=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1h45xx-0003Qq-2Q; Wed, 13 Mar 2019 15:38:49 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 88A7B1128B97; Wed, 13 Mar 2019 15:38:48 +0000 (GMT) From: Mark Brown To: Olivier Moysan Cc: Mark Brown , lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-kernel@vger.kernel.org, olivier.moysan@st.com, arnaud.pouliquen@st.com, benjamin.gaignard@st.com, alsa-devel@alsa-project.org Subject: Applied "ASoC: stm32: i2s: improve channel capabilities handling" to the asoc tree In-Reply-To: <1552317990-24219-3-git-send-email-olivier.moysan@st.com> X-Patchwork-Hint: ignore Message-Id: <20190313153848.88A7B1128B97@debutante.sirena.org.uk> Date: Wed, 13 Mar 2019 15:38:48 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: stm32: i2s: improve channel capabilities handling has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From c2dc8b2c114c22d7a04cf26a7c7d04faaa757143 Mon Sep 17 00:00:00 2001 From: Olivier Moysan Date: Mon, 11 Mar 2019 16:26:29 +0100 Subject: [PATCH] ASoC: stm32: i2s: improve channel capabilities handling Use alsa snd_pcm_hw_constraint_single service to manage channels restriction. This provides better status on driver limitations, to the application. Signed-off-by: Olivier Moysan Signed-off-by: Mark Brown --- sound/soc/stm/stm32_i2s.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 783b33497435..06bbbef74b3a 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -496,12 +496,6 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai, unsigned int fthlv; int ret; - if ((params_channels(params) == 1) && - ((i2s->fmt & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_DSP_A)) { - dev_err(cpu_dai->dev, "Mono mode supported only by DSP_A\n"); - return -EINVAL; - } - switch (format) { case 16: cfgr = I2S_CGFR_DATLEN_SET(I2S_I2SMOD_DATLEN_16); @@ -551,6 +545,10 @@ static int stm32_i2s_startup(struct snd_pcm_substream *substream, i2s->substream = substream; spin_unlock_irqrestore(&i2s->irq_lock, flags); + if ((i2s->fmt & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_DSP_A) + snd_pcm_hw_constraint_single(substream->runtime, + SNDRV_PCM_HW_PARAM_CHANNELS, 2); + ret = clk_prepare_enable(i2s->i2sclk); if (ret < 0) { dev_err(cpu_dai->dev, "Failed to enable clock: %d\n", ret); -- 2.20.1