From cf1ce85c92a1d5d13fc1fe8519054346ff5bdc48 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Fri, 14 Dec 2018 11:10:42 +0800 Subject: MLK-18076-1: ASoC: fsl_asrc_m2m: support input width with 8bit support input data width with 8bit for m2m Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc_m2m.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sound/soc/fsl/fsl_asrc_m2m.c') diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index 3fa89a837617..c478fa43e1bd 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -159,6 +159,9 @@ static int fsl_asrc_dmaconfig(struct fsl_asrc_pair *pair, struct dma_chan *chan, int ret, i; switch (word_width) { + case ASRC_WIDTH_8_BIT: + buswidth = DMA_SLAVE_BUSWIDTH_1_BYTE; + break; case ASRC_WIDTH_16_BIT: buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES; break; @@ -267,10 +270,20 @@ static int fsl_asrc_prepare_io_buffer(struct fsl_asrc_pair *pair, buf_len = pbuf->output_buffer_length; } - if (width == ASRC_WIDTH_24_BIT) + switch (width) { + case ASRC_WIDTH_24_BIT: word_size = 4; - else + break; + case ASRC_WIDTH_16_BIT: word_size = 2; + break; + case ASRC_WIDTH_8_BIT: + word_size = 1; + break; + default: + pair_err("wrong word length\n"); + return -EINVAL; + } if (buf_len < word_size * pair->channels * wm || buf_len > ASRC_DMA_BUFFER_SIZE || -- cgit v1.2.3