Browse Source

MLK-9881: mxc: asrc: fix dma task timeout issue when use 3 instance.

1. Watermark level in sdma use byte as its unit. but asrc driver use
word, there is mismatch between them. Here fix this issue and sdma can
work more efficiency.
2. Enlarge the larst_period_size, when use small size, for some case,
the dma task will timeout, because sdma has no much data for output.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
imx_3.10.53_1.1.0_ga
Shengjiu Wang 6 years ago
parent
commit
49108fcf7b
2 changed files with 9 additions and 4 deletions
  1. +7
    -3
      drivers/mxc/asrc/mxc_asrc.c
  2. +2
    -1
      include/linux/mxc_asrc.h

+ 7
- 3
drivers/mxc/asrc/mxc_asrc.c View File

@ -837,13 +837,13 @@ static int imx_asrc_dma_config(struct asrc_pair_params *params,
slave_config.dst_addr = dma_addr;
slave_config.dst_addr_width = buswidth;
slave_config.dst_maxburst =
params->input_wm * params->channel_nums / buswidth;
params->input_wm * params->channel_nums;
} else {
slave_config.direction = DMA_DEV_TO_MEM;
slave_config.src_addr = dma_addr;
slave_config.src_addr_width = buswidth;
slave_config.src_maxburst =
params->output_wm * params->channel_nums / buswidth;
params->output_wm * params->channel_nums;
}
ret = dmaengine_slave_config(chan, &slave_config);
if (ret) {
@ -1236,7 +1236,11 @@ static long asrc_ioctl_config_pair(struct asrc_pair_params *params,
params->input_sample_rate = config.input_sample_rate;
params->output_sample_rate = config.output_sample_rate;
params->last_period_sample = ASRC_OUTPUT_LAST_SAMPLE_DEFAULT;
if (params->output_sample_rate > params->input_sample_rate)
params->last_period_sample = ASRC_OUTPUT_LAST_SAMPLE_DEFAULT_MAX;
else
params->last_period_sample = ASRC_OUTPUT_LAST_SAMPLE_DEFAULT;
ret = mxc_allocate_dma_buf(params);
if (ret) {


+ 2
- 1
include/linux/mxc_asrc.h View File

@ -28,7 +28,8 @@
#define ASRC_FIFO_THRESHOLD_MAX 63
#define ASRC_DMA_BUFFER_SIZE (1024 * 48 * 4)
#define ASRC_MAX_BUFFER_SIZE (1024 * 48)
#define ASRC_OUTPUT_LAST_SAMPLE_DEFAULT 8
#define ASRC_OUTPUT_LAST_SAMPLE_DEFAULT_MAX 32
#define ASRC_OUTPUT_LAST_SAMPLE_DEFAULT 16
/* Ideal Ratio mode doesn't care the outclk frequency, so be fixed */


Loading…
Cancel
Save