Commit 49108fcf by Shengjiu Wang

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: 's avatarShengjiu Wang <shengjiu.wang@freescale.com>
parent 644e274a
......@@ -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) {
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment