File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,6 +135,20 @@ static void dmaengine_pcm_dma_complete(void *arg)
135135 struct snd_pcm_substream * substream = arg ;
136136 struct dmaengine_pcm_runtime_data * prtd = substream_to_prtd (substream );
137137
138+ /*
139+ * workaround to clear mchp-pdmc's channel index when used as BE with
140+ * mchp-asrc
141+ */
142+ if (substream -> pcm -> internal &&
143+ !strncmp (prtd -> dma_chan -> slave -> driver -> name , "mchp-pdmc" , sizeof ("mchp-pdmc" ))) {
144+ unsigned int sample_size = samples_to_bytes (substream -> runtime , 1 );
145+ u8 * dma_ptr = substream -> runtime -> dma_area + prtd -> pos ;
146+ u8 * dma_ptr_end = dma_ptr + snd_pcm_lib_period_bytes (substream );
147+
148+ for (; dma_ptr < dma_ptr_end ; dma_ptr += sample_size )
149+ * dma_ptr = 0 ;
150+ }
151+
138152 prtd -> pos += snd_pcm_lib_period_bytes (substream );
139153 if (prtd -> pos >= snd_pcm_lib_buffer_bytes (substream ))
140154 prtd -> pos = 0 ;
You can’t perform that action at this time.
0 commit comments