diff options
author | Chen Liangjun <b36089@freescale.com> | 2012-10-26 17:43:30 +0800 |
---|---|---|
committer | Chen Liangjun <b36089@freescale.com> | 2012-11-06 13:43:41 +0800 |
commit | e49af26851c3f5a899b69682189f7849da45452b (patch) | |
tree | a823f9fcc7007964763de781c257b35eddee287d /include | |
parent | 9e81e368be12a07cdff2b54ec7e7a13e82aa38ec (diff) |
ENGR00231773-4 ASRC: use scatter list and stall bit for asrc convert
In the origin code, ASRC driver use cyclic way to process DMA task
transfering data to/from ASRC input/output FIFO. In this case, it is
necessary that user application should promise that the input buffer
flow is continuous. If not, there would be 0 data be inserted into data
flow. The output data would be noisy.
In this patch,
1 use scatter list instead of cyclic SDMA: with scatter list,
SDMA would stop when the applied scatter list nents are finished.
2 set stall bit for ASRC "memory->ASRC->memory" convert to stop
ASRC convert when input data is not send into ASRC input FIFO in time.
Signed-off-by: Chen Liangjun <b36089@freescale.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mxc_asrc.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/mxc_asrc.h b/include/linux/mxc_asrc.h index a970fe6fa773..28137a0ce104 100644 --- a/include/linux/mxc_asrc.h +++ b/include/linux/mxc_asrc.h @@ -112,12 +112,21 @@ struct asrc_querybuf { unsigned long output_offset; }; +struct asrc_convert_buffer { + void *input_buffer_vaddr; + void *output_buffer_vaddr; + unsigned int input_buffer_length; + unsigned int output_buffer_length; +}; + struct asrc_buffer { unsigned int index; unsigned int length; + unsigned int output_last_length; int buf_valid; }; + struct asrc_status_flags { enum asrc_pair_index index; unsigned int overload_error; @@ -134,11 +143,14 @@ enum asrc_error_status { }; #ifdef __KERNEL__ +#include <linux/scatterlist.h> #define ASRC_DMA_BUFFER_NUM 2 #define ASRC_INPUTFIFO_THRESHOLD 32 #define ASRC_OUTPUTFIFO_THRESHOLD 32 -#define ASRC_DMA_BUFFER_SIZE (1024 * 64 * 4) +#define ASRC_DMA_BUFFER_SIZE (1024 * 48 * 4) +#define ASRC_MAX_BUFFER_SIZE (1024 * 48) + #define ASRC_ASRCTR_REG 0x00 @@ -187,7 +199,7 @@ enum asrc_error_status { struct dma_block { unsigned int index; unsigned int length; - unsigned char *dma_vaddr; + void *dma_vaddr; dma_addr_t dma_paddr; struct list_head queue; }; @@ -218,6 +230,11 @@ struct asrc_pair_params { struct dma_async_tx_descriptor *desc_in; struct dma_async_tx_descriptor *desc_out; struct work_struct task_output_work; + unsigned int input_sg_nodes; + unsigned int output_sg_nodes; + struct scatterlist input_sg[4], output_sg[4]; + enum asrc_word_width input_word_width; + enum asrc_word_width output_word_width; }; struct asrc_data { |