dai: dmic: fix 16 bit capture

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
Janusz Jankowski 2018-11-16 14:49:00 +01:00
parent 296c86c009
commit 2615914122
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);