Skip to content

Commit 083a25b

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent dda5c80 commit 083a25b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/soc-pcm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,10 +1661,14 @@ static void dpcm_runtime_setup_fe(struct snd_pcm_substream *substream)
16611661
struct snd_pcm_hardware *hw = &runtime->hw;
16621662
struct snd_soc_dai *dai;
16631663
int stream = substream->stream;
1664+
u64 formats = hw->formats;
16641665
int i;
16651666

16661667
soc_pcm_hw_init(hw);
16671668

1669+
if (formats)
1670+
hw->formats &= formats;
1671+
16681672
for_each_rtd_cpu_dais(fe, i, dai) {
16691673
struct snd_soc_pcm_stream *cpu_stream;
16701674

0 commit comments

Comments
 (0)