Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2849317rwb; Sun, 15 Jan 2023 23:44:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXutuTtwaOpfklbsAwKhodaSluVxKM20oK1dUkty8JVIIwuR0s26PjvExxwKpu87uafz29b6 X-Received: by 2002:a05:6a21:150b:b0:b8:6c82:e907 with SMTP id nq11-20020a056a21150b00b000b86c82e907mr5181182pzb.50.1673855065594; Sun, 15 Jan 2023 23:44:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673855065; cv=none; d=google.com; s=arc-20160816; b=xI9vVdaIe9y53Ea32NT8Tta+uUrrvLMW6BEb6NKUj0TYZhJovlESdmSubxxfyZ5VOH qrkV/iJRecialSCuuDW84DfsMwWXh25IiAF++P1rwaIkyRcrAS/NdXTcFMxVxrT6B1zC 9+AeNPVvcjnN+UaTtGXcA4ei/QdDVvUrNbCTDK19XU+ZHI394GUk4IhM5mQN1EP8rWLR uGeeVMTEmny6ol/CIRBV1BK7vbVYoQIs2GuqS1bhk5iH2ML3jIGrlMWGekczaDo7VTDS Gho971SoFbvWjZqhaVS8N6nI+mc6EQRiDeVDxT/K9JPj6nX6XffofD1+VTG/R4rYsd1N CfUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=q2TbBUUUZ2K08vt2VKBGBzcX2+8iQkO4UsY1340C7Wk=; b=ION0NW5ZF/pSz5kRhRtO8OLejhZ5WcWaZOKLiesEfJmqdm5HWbcu+EjsSlLueYDGy5 yp/YdQYrg9VwqqO2UK0QFWso/95uV2omswhz5CNQCfDSbrLteZajThBDBEB4Xp57cfnK vNwU6KrLXNtmPa0P+jfEpqYmKjuyB/cJ8OWlKyGfYxHkqEna5FJ2OwPgQXQTprSQGkbc gPbOMqqG8esA6PN6+RYeKotmEugR4XmbQOSBPy7GkU2zweVNHAMXaG0nRfDoKvwfQ9xU +tqdyo0ctqLZwzS1cLF7pm3IYmhwFBBVjXM4+wb4AQt3rXcjXa2V5o8MW+6dsR7i64LV CC2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l193-20020a6391ca000000b004c76dcc997fsi7370800pge.156.2023.01.15.23.44.19; Sun, 15 Jan 2023 23:44:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231898AbjAPHcf (ORCPT + 53 others); Mon, 16 Jan 2023 02:32:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjAPHcd (ORCPT ); Mon, 16 Jan 2023 02:32:33 -0500 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B51ACDD2 for ; Sun, 15 Jan 2023 23:32:32 -0800 (PST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AB80A1A0F01; Mon, 16 Jan 2023 08:32:30 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 73DDA1A0746; Mon, 16 Jan 2023 08:32:30 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id E3EF6180031E; Mon, 16 Jan 2023 15:32:28 +0800 (+08) From: Shengjiu Wang To: nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, shengjiu.wang@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_sai: initialize is_dsp_mode flag Date: Mon, 16 Jan 2023 15:07:54 +0800 Message-Id: <1673852874-32200-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Initialize is_dsp_mode flag in the beginning of function fsl_sai_set_dai_fmt_tr(). When the DAIFMT is DAIFMT_DSP_B the first time, is_dsp_mode is true, then the second time DAIFMT is DAIFMT_I2S, is_dsp_mode still true, which is a wrong state. So need to initialize is_dsp_mode flag every time. Fixes: a3f7dcc9cc03 ("ASoC: fsl-sai: Add SND_SOC_DAIFMT_DSP_A/B support.") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_sai.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 1c9be8a5dcb1..355ef29af48c 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -281,6 +281,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, val_cr4 |= FSL_SAI_CR4_MF; sai->is_pdm_mode = false; + sai->is_dsp_mode = false; /* DAI mode */ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: -- 2.34.1