Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: fsl: two fixes for asrc memory to memory

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

1. Fix the suspend failure for memory to peripheral function.
2. Return error value for processing function.

+9 -7
+9 -7
sound/soc/fsl/fsl_asrc_m2m.c
··· 183 183 } 184 184 185 185 /* main function of converter */ 186 - static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task_runtime *task) 186 + static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task_runtime *task) 187 187 { 188 188 struct fsl_asrc *asrc = pair->asrc; 189 189 struct device *dev = &asrc->pdev->dev; ··· 193 193 unsigned int out_dma_len; 194 194 unsigned int width; 195 195 u32 fifo_addr; 196 - int ret; 196 + int ret = 0; 197 197 198 198 /* set ratio mod */ 199 199 if (asrc->m2m_set_ratio_mod) { ··· 215 215 in_buf_len > ASRC_M2M_BUFFER_SIZE || 216 216 in_buf_len % (width * pair->channels / 8)) { 217 217 dev_err(dev, "out buffer size is error: [%d]\n", in_buf_len); 218 + ret = -EINVAL; 218 219 goto end; 219 220 } 220 221 ··· 246 245 } 247 246 } else if (out_dma_len > ASRC_M2M_BUFFER_SIZE) { 248 247 dev_err(dev, "cap buffer size error\n"); 248 + ret = -EINVAL; 249 249 goto end; 250 250 } 251 251 ··· 265 263 266 264 if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) { 267 265 dev_err(dev, "out DMA task timeout\n"); 266 + ret = -ETIMEDOUT; 268 267 goto end; 269 268 } 270 269 271 270 if (out_dma_len > 0) { 272 271 if (!wait_for_completion_interruptible_timeout(&pair->complete[OUT], 10 * HZ)) { 273 272 dev_err(dev, "cap DMA task timeout\n"); 273 + ret = -ETIMEDOUT; 274 274 goto end; 275 275 } 276 276 } ··· 282 278 /* update payload length for capture */ 283 279 task->output_size = out_dma_len; 284 280 end: 285 - return; 281 + return ret; 286 282 } 287 283 288 284 static int fsl_asrc_m2m_comp_open(struct snd_compr_stream *stream) ··· 529 525 struct snd_compr_runtime *runtime = stream->runtime; 530 526 struct fsl_asrc_pair *pair = runtime->private_data; 531 527 532 - asrc_m2m_device_run(pair, task); 533 - 534 - return 0; 528 + return asrc_m2m_device_run(pair, task); 535 529 } 536 530 537 531 static int fsl_asrc_m2m_comp_task_stop(struct snd_compr_stream *stream, ··· 635 633 636 634 for (i = 0; i < PAIR_CTX_NUM; i++) { 637 635 pair = asrc->pair[i]; 638 - if (!pair) 636 + if (!pair || !pair->dma_buffer[IN].area || !pair->dma_buffer[OUT].area) 639 637 continue; 640 638 if (!completion_done(&pair->complete[IN])) { 641 639 if (pair->dma_chan[IN])