public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Shengjiu Wang <shengjiu.wang@nxp.com>,
	Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>,
	lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
	alsa-devel@alsa-project.org
Subject: [PATCH AUTOSEL 5.15 2/8] ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm
Date: Wed, 12 Apr 2023 22:37:19 -0400	[thread overview]
Message-ID: <20230413023727.74875-2-sashal@kernel.org> (raw)
In-Reply-To: <20230413023727.74875-1-sashal@kernel.org>

From: Shengjiu Wang <shengjiu.wang@nxp.com>

[ Upstream commit 083a25b18d6ad9f1f540e629909aa3eaaaf01823 ]

The hw->formats may be set by snd_dmaengine_pcm_refine_runtime_hwparams()
in component's startup()/open(), but soc_pcm_hw_init() will init
hw->formats in dpcm_runtime_setup_fe() after component's startup()/open(),
which causes the valuable hw->formats to be cleared.

So need to store the hw->formats before initialization, then restore
it after initialization.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1678346017-3660-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/soc-pcm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 3b673477f6215..6f616ac4490f0 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1554,10 +1554,14 @@ static void dpcm_runtime_setup_fe(struct snd_pcm_substream *substream)
 	struct snd_pcm_hardware *hw = &runtime->hw;
 	struct snd_soc_dai *dai;
 	int stream = substream->stream;
+	u64 formats = hw->formats;
 	int i;
 
 	soc_pcm_hw_init(hw);
 
+	if (formats)
+		hw->formats &= formats;
+
 	for_each_rtd_cpu_dais(fe, i, dai) {
 		struct snd_soc_pcm_stream *cpu_stream;
 
-- 
2.39.2


  reply	other threads:[~2023-04-13  2:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13  2:37 [PATCH AUTOSEL 5.15 1/8] ASOC: Intel: sof_sdw: add quirk for Intel 'Rooks County' NUC M15 Sasha Levin
2023-04-13  2:37 ` Sasha Levin [this message]
2023-04-13  2:37 ` [PATCH AUTOSEL 5.15 3/8] x86/hyperv: Block root partition functionality in a Confidential VM Sasha Levin
2023-04-13  2:37 ` [PATCH AUTOSEL 5.15 4/8] iio: adc: palmas_gpadc: fix NULL dereference on rmmod Sasha Levin
2023-04-13  2:37 ` [PATCH AUTOSEL 5.15 5/8] ASoC: Intel: bytcr_rt5640: Add quirk for the Acer Iconia One 7 B1-750 Sasha Levin
2023-04-13  2:37 ` [PATCH AUTOSEL 5.15 6/8] selftests mount: Fix mount_setattr_test builds failed Sasha Levin
2023-04-13  2:37 ` [PATCH AUTOSEL 5.15 7/8] asm-generic/io.h: suppress endianness warnings for readq() and writeq() Sasha Levin
2023-04-13  2:37 ` [PATCH AUTOSEL 5.15 8/8] x86/cpu: Add model number for Intel Arrow Lake processor Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230413023727.74875-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=shengjiu.wang@nxp.com \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox