]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm
authorShengjiu Wang <shengjiu.wang@nxp.com>
Thu, 9 Mar 2023 07:13:37 +0000 (15:13 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 14 Mar 2023 13:30:16 +0000 (13:30 +0000)
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>
sound/soc/soc-pcm.c

index 5eb056b942ce8d6c1d95a9ee49c27be5d8bae8d0..7958c9defd4922fe8a337008f09ae00e0ff9b8ae 100644 (file)
@@ -1661,10 +1661,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;