diff options
author | Shengjiu Wang <shengjiu.wang@nxp.com> | 2018-12-14 11:10:42 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:35:39 +0800 |
commit | a007ffbe9b9b608137af5dd806ff9f307166e8ed (patch) | |
tree | 394f4ab83291c8cc1b755e52df10b391e7b72353 /sound | |
parent | f6869d289a3d1bbbb38eefaf79e458fb620f887d (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')
-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 || |