From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ECDB18E348; Mon, 28 Oct 2024 06:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730096916; cv=none; b=fCHk+YgWmVdNP05hb298qs3KicPbkJjG0UAF3e/czsB11MYj3aCycrHcQtQuscHpOiGLwqRGUwf6P5rRKy0IfVem7CfbtZ48lYBehaWu8FT7DrdxOfrmXwoi93ONrpyE3xejWelC77cJ/kF3mC3RVWwSjDprORdiCbpRaZoJ+dA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730096916; c=relaxed/simple; bh=18W2BMTXW+jBRzuVfRqyjZYo5V0q3V2Cupgmau6Dnv0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ec1AdACpIfhx00QmKHxfSMWBrlYyyG2zgKHBDdGBpD3pWcjXoAbz5Z/StrvK4zft4frQKHqLP96RPJ8JiVTXjrLHSqKWfPfFkJNPvkmGbnpcK2FYJHiqeLgEWGNA9y1f46oar6po62hdM365spZn6P/lAQ4IYsXaOd/bSgjFxUo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sDpLHOUB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="sDpLHOUB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8BE5C4CEC3; Mon, 28 Oct 2024 06:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730096916; bh=18W2BMTXW+jBRzuVfRqyjZYo5V0q3V2Cupgmau6Dnv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sDpLHOUBT4qBZ/4jDDcNixScGIkRfB/3dReNg5GpWlwc+oLVW4gZt6wDUZz/tpuor tA0fDFseXEFW1lMU+zqKYG/B98FckE8Fgi/J/+jKX73Gyh04BTCh1HXmR/u7AL0dnn IHkQ6Zw1K1YAb/D7Nlq8mDm7Epkh1cRYtCX/GwDg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.15 43/80] ASoC: fsl_sai: Enable FIFO continue on error FCONT bit Date: Mon, 28 Oct 2024 07:25:23 +0100 Message-ID: <20241028062253.817111506@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241028062252.611837461@linuxfoundation.org> References: <20241028062252.611837461@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shengjiu Wang [ Upstream commit 72455e33173c1a00c0ce93d2b0198eb45d5f4195 ] FCONT=1 means On FIFO error, the SAI will continue from the same word that caused the FIFO error to set after the FIFO warning flag has been cleared. Set FCONT bit in control register to avoid the channel swap issue after SAI xrun. Signed-off-by: Shengjiu Wang Link: https://patch.msgid.link/1727676508-22830-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_sai.c | 5 ++++- sound/soc/fsl/fsl_sai.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 59dffa5ff34f4..87d324927cd97 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -498,6 +498,9 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, val_cr4 |= FSL_SAI_CR4_FRSZ(slots); + /* Set to avoid channel swap */ + val_cr4 |= FSL_SAI_CR4_FCONT; + /* Set to output mode to avoid tri-stated data pins */ if (tx) val_cr4 |= FSL_SAI_CR4_CHMOD; @@ -523,7 +526,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, FSL_SAI_CR3_TRCE((1 << pins) - 1)); regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx, ofs), FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK | - FSL_SAI_CR4_CHMOD_MASK, + FSL_SAI_CR4_CHMOD_MASK | FSL_SAI_CR4_FCONT_MASK, val_cr4); regmap_update_bits(sai->regmap, FSL_SAI_xCR5(tx, ofs), FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index f8c9a8fb78984..0a03e68aadc19 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -132,6 +132,7 @@ /* SAI Transmit and Receive Configuration 4 Register */ +#define FSL_SAI_CR4_FCONT_MASK BIT(28) #define FSL_SAI_CR4_FCONT BIT(28) #define FSL_SAI_CR4_FCOMB_SHIFT BIT(26) #define FSL_SAI_CR4_FCOMB_SOFT BIT(27) -- 2.43.0