From patchwork Thu Apr 12 14:48:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 133299 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1762337ljb; Thu, 12 Apr 2018 07:48:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx48oNbri3Hi8dcUxCaxeUYHAVv+H79laY4zxKatuQmCq3VjkLxJlTyu7+9j+T9LyYvTVWae8 X-Received: by 10.28.23.21 with SMTP id 21mr947758wmx.49.1523544516550; Thu, 12 Apr 2018 07:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523544516; cv=none; d=google.com; s=arc-20160816; b=Nzkry7cMpNmo+QOo7wIaJ9jsan7+v10OMivNC97AvlFAsgBApu6THmZfGY2yidxQrc 9NyzP0pbDt22YVfObULDt6JIFHOMzUzfxqW16QeSPIYOzdXfVXtsqnIQ71Da1twrqNfv qHyoWGRwum+LlZ1F9B7o75mfK8jQSObsnFqk9nzzUqHzq2BjtOfD94gXli7kmFY9HkRt BOTZTR97Ut6hzldHK6GG8sC84QrVwDUUzNI9s5gK1zvA10hmbZM8b28Prag8CH9cdKLS AL3piHr3JOi07J0PW0C8iHQF3q9zciFfexewrtu6TYSpQu2aX7+9jnBySnuELI7vJwdq 1JIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:mime-version:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:cc:date :message-id:in-reply-to:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=MUDgXy0zAP5g7+a5vGdF4Beu48kyTlrLyeQMrrcucT0=; b=RkVjkkJLLDB1lz1OimcgyAckhUxwfSbcMFA/wh4jMwSFPccWZwEfM7rA2GbcwXY4Vd MbzIYJZvA0SUMlJCegyFSPPRkXEKgRDHT08UJ0YpVHpZzosiZ8X9abX2xHpBtINeGvp8 nBqxKVQYO6d7inWYT23I4Xyi7VSYTaMUE2KH3ggxF3fDlYteqZq1/GdlVztI8Qm55k4k nUfd3fO2/1RtrFOoXAIzZNlRIJgyAomY8flG7kxE8sn3C9OzpdwqlDt9t9ZtRg9LSZjC 521dj97iT3CWOMyFPPUVbvg+iLU59NIyEn9ORvTWs7As1uzGYiu2YLOV7+ANxPqIsVn/ pYYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Okqjr0i5; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id p69si2689163wmf.50.2018.04.12.07.48.36; Thu, 12 Apr 2018 07:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Okqjr0i5; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 854382673F6; Thu, 12 Apr 2018 16:48:25 +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 72F7F2673F3; Thu, 12 Apr 2018 16:48:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 18D5D2673B2 for ; Thu, 12 Apr 2018 16:48:17 +0200 (CEST) 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=HxQ0PCXuJkxyytm6EozoxW/W/gI1Z05cnobBVssCLNU=; b=Okqjr0i5zavI LD1FbT5bR6/T/ayEbR4NTHABF4E+zyd9DT+Hrmqq31AbxHI1f+VLDUkKjhHjzus1+VfPhnq2Z04Ft s9snmtRsm0ds2bTlYbSLjpKwW9SrH4MeTiHYIQtb9TG/ErbEH/nMn53NLussTZRJZee7azCeHGTM4 bo7Cg=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6dWD-0005tl-Ei; Thu, 12 Apr 2018 14:48:09 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1f6dWB-00059o-Ne; Thu, 12 Apr 2018 15:48:07 +0100 From: Mark Brown To: Nicolin Chen In-Reply-To: <1523162421-26400-1-git-send-email-nicoleotsuka@gmail.com> Message-Id: Date: Thu, 12 Apr 2018 15:48:07 +0100 Cc: alsa-devel@alsa-project.org, timur@tabi.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, tiwai@suse.com, broonie@kernel.org, mika.penttila@nextfour.com, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] Applied "ASoC: fsl_ssi: Fix mode setting when changing channel number" to the asoc tree 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 The patch ASoC: fsl_ssi: Fix mode setting when changing channel number 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 fac8a5a5ea40b03dcbb0f46977094099ba2220b8 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Sat, 7 Apr 2018 21:40:21 -0700 Subject: [PATCH] ASoC: fsl_ssi: Fix mode setting when changing channel number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a partial revert (in a cleaner way) of commit ebf08ae3bc90 ("ASoC: fsl_ssi: Keep ssi->i2s_net updated") to fix a regression at test cases when switching between mono and stereo audio. The problem is that ssi->i2s_net is initialized in set_dai_fmt() only, while this set_dai_fmt() is only called during the dai-link probe(). The original patch assumed set_dai_fmt() would be called during every playback instance, so it failed at the overriding use cases. This patch adds the local variable i2s_net back to let regular use cases still follow the mode settings from the set_dai_fmt(). Meanwhile, the original commit of keeping ssi->i2s_net updated was to make set_tdm_slot() clean by checking the ssi->i2s_net directly instead of reading SCR register. However, the change itself is not necessary (or even harmful) because the set_tdm_slot() might fail to check the slot number for Normal-Mode-None-Net settings while mono audio cases still need 2 slots. So this patch can also fix it. And it adds an extra line of comments to declare ssi->i2s_net does not reflect the register value but merely the initial setting from the set_dai_fmt(). Reported-by: Mika Penttilä Signed-off-by: Nicolin Chen Tested-by: Mika Penttilä Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_ssi.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- 2.17.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 0823b08923b5..89df2d9f63d7 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -217,6 +217,7 @@ struct fsl_ssi_soc_data { * @dai_fmt: DAI configuration this device is currently used with * @streams: Mask of current active streams: BIT(TX) and BIT(RX) * @i2s_net: I2S and Network mode configurations of SCR register + * (this is the initial settings based on the DAI format) * @synchronous: Use synchronous mode - both of TX and RX use STCK and SFCK * @use_dma: DMA is used or FIQ with stream filter * @use_dual_fifo: DMA with support for dual FIFO mode @@ -829,16 +830,23 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, } if (!fsl_ssi_is_ac97(ssi)) { + /* + * Keep the ssi->i2s_net intact while having a local variable + * to override settings for special use cases. Otherwise, the + * ssi->i2s_net will lose the settings for regular use cases. + */ + u8 i2s_net = ssi->i2s_net; + /* Normal + Network mode to send 16-bit data in 32-bit frames */ if (fsl_ssi_is_i2s_cbm_cfs(ssi) && sample_size == 16) - ssi->i2s_net = SSI_SCR_I2S_MODE_NORMAL | SSI_SCR_NET; + i2s_net = SSI_SCR_I2S_MODE_NORMAL | SSI_SCR_NET; /* Use Normal mode to send mono data at 1st slot of 2 slots */ if (channels == 1) - ssi->i2s_net = SSI_SCR_I2S_MODE_NORMAL; + i2s_net = SSI_SCR_I2S_MODE_NORMAL; regmap_update_bits(regs, REG_SSI_SCR, - SSI_SCR_I2S_NET_MASK, ssi->i2s_net); + SSI_SCR_I2S_NET_MASK, i2s_net); } /* In synchronous mode, the SSI uses STCCR for capture */