diff options
author | Shengjiu Wang <shengjiu.wang@nxp.com> | 2018-12-14 11:10:42 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:48:36 +0800 |
commit | cf1ce85c92a1d5d13fc1fe8519054346ff5bdc48 (patch) | |
tree | 0f388e4ef5f550d58fe5d6908703a27185d30619 /sound/soc/fsl/fsl_asrc_m2m.c | |
parent | 2c706419b3e498f2afacc4351db7ad00aad439e7 (diff) |
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 <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_asrc_m2m.c')
-rw-r--r-- | sound/soc/fsl/fsl_asrc_m2m.c | 17 |
1 files changed, 15 insertions, 2 deletions
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 || |