Merge pull request #587 from jajanusz/fix-dmic-16b

dai: dmic: fix 16 bit capture
This commit is contained in:
Liam Girdwood 2018-11-16 15:14:08 +00:00 committed by GitHub
commit 557a82d617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -319,12 +319,23 @@ static int dai_capture_params(struct comp_dev *dev)
/* set up DMA configuration */
config->direction = DMA_DIR_DEV_TO_MEM;
config->src_width = comp_sample_bytes(dev);
config->dest_width = comp_sample_bytes(dev);
config->cyclic = 1;
config->timer_delay = dev->pipeline->ipc_pipe.timer_delay;
config->src_dev = dd->dai->plat_data.fifo[1].handshake;
/* TODO: Make this code platform-specific or move it driver callback */
if (dd->dai->type == SOF_DAI_INTEL_DMIC) {
/* For DMIC the DMA src and dest widths should always be 4 bytes
* due to 32 bit FIFO packer. Setting width to 2 bytes for
* 16 bit format would result in recording at double rate.
*/
config->src_width = 4;
config->dest_width = 4;
} else {
config->src_width = comp_sample_bytes(dev);
config->dest_width = comp_sample_bytes(dev);
}
/* set up local and host DMA elems to reset values */
dma_buffer = list_first_item(&dev->bsink_list,
struct comp_buffer, source_list);