sound:dwc:i2s:Enable 'stop_dma_first' flag
authorXingyu Wu <xingyu.wu@starfivetech.com>
Mon, 22 Aug 2022 06:09:17 +0000 (14:09 +0800)
committerXingyu Wu <xingyu.wu@starfivetech.com>
Tue, 23 Aug 2022 08:53:42 +0000 (16:53 +0800)
Enable the flag and can remove the noise before playing.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
sound/soc/dwc/dwc-i2s.c

index 200838f..88042dd 100755 (executable)
@@ -247,7 +247,10 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
        struct i2s_clk_config_data *config = &dev->config;
        int ret;
        unsigned int txrx = substream->stream;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
+       struct snd_soc_dai_link *dai_link = rtd->dai_link;
 
+       dai_link->stop_dma_first = 1;
        config->chan_nr = params_channels(params);
 
        switch (params_format(params)) {