From patchwork Thu Feb 22 13:16:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 129240 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp587506lja; Thu, 22 Feb 2018 05:18:53 -0800 (PST) X-Google-Smtp-Source: AH8x224jrxm3H6PTrwKFGzZY0WYBe0YYbtjvG/evlrOrlI1ozwXNKj0BkS1ZqAgEvASbsDGzrXtq X-Received: by 10.28.132.203 with SMTP id g194mr5348115wmd.77.1519305533738; Thu, 22 Feb 2018 05:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519305533; cv=none; d=google.com; s=arc-20160816; b=PZ20z2gQKvioxbzwmmAb+OAQbymOXJsa2azQQF4bAVQ1XS/bxrApMrzZfBYTEdndKD mYlWSp6eUkU96O9n463Knw4MNneGBSLBfRFGqPP1IKoMZjpCnAcatc/Wb6Aq6GF3TwVy kpu+D8GCyhaPygkXuZrVNKwwt8yzhH3d9mcHOq45fuHaPWu7q/hz+OBSDCDH06+4gnjM zFNWvueytwL1ei3ndNPdBVbPDuKpMwm9DvnLtmI+R8H0wEHv7/UJK3KB+JlBzsKXnc1J 8g/8My3YaagPeujJz4F1DoVnJtIijS5wzQiRPSblOgR6waS08301VF75DGb7TEOhEULG Rj5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=td8+eCP9QCya9Xq0eCeuByzhtvLftpnvVhbTIjYi1Vg=; b=EQyq6B4ZLt06os+MU3CKV3xXiTHAfiDVN3lH1bDZucqacy7Y6UJ3/cO8wGsJhNIhoh V/ZIKcDzQUQuo8MLbG3BvN02r0P/r1epc84iBDkcdK8yI542MKzfVXBx1hUqIN+wXYEC U2t5xuGTy7h2HPbM0n7tikjvD+Vcy+KQz8Goy9605nDltp33IBuBFlc6DM7wiFgHHVoV schMed4y45tA37j4llKxSlJgIrqLG9+tHihCxlHJ2Vd+RZXu+2LIlUE3QOvDOwpkP5/Y GXUdhy0z0Y1sbB074Y+caQ0TYGuTjqEBmPYi/3b3kPldtkITUPfXsmQwFvfomJtifAZ+ /p9Q== 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=fIZxBigb; 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 7si62513wrp.56.2018.02.22.05.18.53; Thu, 22 Feb 2018 05:18:53 -0800 (PST) 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=fIZxBigb; 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 105DE26775F; Thu, 22 Feb 2018 14:17:27 +0100 (CET) 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 DD2302677E5; Thu, 22 Feb 2018 14:17:21 +0100 (CET) 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, SPF_PASS, T_RP_MATCHES_RCVD 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 BDBBF26772F for ; Thu, 22 Feb 2018 14:16:55 +0100 (CET) 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=gcrDCyhzyALrlhe1s3ZhBYBHUMB5hzpYZJ3DSE7oCSA=; b=fIZxBigbaD38 7NKyEEJcFwNkUtfRqswejhpJ2JtAL+5vs21mVzC+2u/W/5RIGAI/GoET/AFkuuClCNrsw1q7A14BU DQhGfE16WVK3k+mSX3lZnZkyzax5BoVE3dbAQWKI7w7TNkzdFHBVXvfMvqNp6lTcFHt1g22ox70aL evJ3I=; 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 1eoqk2-0002VR-M3; Thu, 22 Feb 2018 13:16:54 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1eoqk2-0006OR-67; Thu, 22 Feb 2018 13:16:54 +0000 From: Mark Brown To: Nicolin Chen In-Reply-To: Message-Id: Date: Thu, 22 Feb 2018 13:16:54 +0000 Cc: "Maciej S. Szmigiero" , Mark Brown , alsa-devel@alsa-project.org, Caleb Crome Subject: [alsa-devel] Applied "ASoC: fsl_ssi: Clear FIFO directly in fsl_ssi_config()" 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: Clear FIFO directly in fsl_ssi_config() 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 2e1327403b2543bc4dd639571b84bf6174212cee Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Mon, 12 Feb 2018 14:03:14 -0800 Subject: [PATCH] ASoC: fsl_ssi: Clear FIFO directly in fsl_ssi_config() The FIFO clear helper function is just one line of code now. So it could be cleaned up by removing it and calling regmap directly. Meanwhile, FIFO clear could be applied to all use cases, not confined to AC97. So this patch also moves FIFO clear in the trigger() to fsl_ssi_config() and removes the AC97 check. Note that SOR register is safe from offline_config HW limit. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_ssi.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) -- 2.16.1 _______________________________________________ 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 0d8c800db0b3..d276b78684e4 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -409,17 +409,6 @@ static void fsl_ssi_rxtx_config(struct fsl_ssi *ssi, bool enable) } } -/** - * Clear remaining data in the FIFO to avoid dirty data or channel slipping - */ -static void fsl_ssi_fifo_clear(struct fsl_ssi *ssi, bool is_rx) -{ - bool tx = !is_rx; - - regmap_update_bits(ssi->regs, REG_SSI_SOR, - SSI_SOR_xX_CLR(tx), SSI_SOR_xX_CLR(tx)); -} - /** * Exclude bits that are used by the opposite stream * @@ -446,10 +435,11 @@ static void fsl_ssi_fifo_clear(struct fsl_ssi *ssi, bool is_rx) static void fsl_ssi_config(struct fsl_ssi *ssi, bool enable, struct fsl_ssi_regvals *vals) { - int adir = (&ssi->regvals[TX] == vals) ? RX : TX; - int dir = (&ssi->regvals[TX] == vals) ? TX : RX; + bool tx = &ssi->regvals[TX] == vals; struct regmap *regs = ssi->regs; struct fsl_ssi_regvals *avals; + int adir = tx ? RX : TX; + int dir = tx ? TX : RX; bool aactive; /* Check if the opposite stream is active */ @@ -489,7 +479,9 @@ static void fsl_ssi_config(struct fsl_ssi *ssi, bool enable, /* Online configure single direction while SSI is running */ if (enable) { - fsl_ssi_fifo_clear(ssi, vals->scr & SSI_SCR_RE); + /* Clear FIFO to prevent dirty data or channel slipping */ + regmap_update_bits(ssi->regs, REG_SSI_SOR, + SSI_SOR_xX_CLR(tx), SSI_SOR_xX_CLR(tx)); regmap_update_bits(regs, REG_SSI_SRCR, vals->srcr, vals->srcr); regmap_update_bits(regs, REG_SSI_STCR, vals->stcr, vals->stcr); @@ -511,6 +503,10 @@ static void fsl_ssi_config(struct fsl_ssi *ssi, bool enable, regmap_update_bits(regs, REG_SSI_SRCR, srcr, 0); regmap_update_bits(regs, REG_SSI_STCR, stcr, 0); regmap_update_bits(regs, REG_SSI_SIER, sier, 0); + + /* Clear FIFO to prevent dirty data or channel slipping */ + regmap_update_bits(ssi->regs, REG_SSI_SOR, + SSI_SOR_xX_CLR(tx), SSI_SOR_xX_CLR(tx)); } config_done: @@ -1091,7 +1087,6 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(rtd->cpu_dai); - struct regmap *regs = ssi->regs; switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -1116,14 +1111,6 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, return -EINVAL; } - /* Clear corresponding FIFO */ - if (fsl_ssi_is_ac97(ssi)) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - regmap_write(regs, REG_SSI_SOR, SSI_SOR_TX_CLR); - else - regmap_write(regs, REG_SSI_SOR, SSI_SOR_RX_CLR); - } - return 0; }