dai: configure its frame_fmt from topology

For dai component, it's frame_fmt may be different with host,
we usually configure it from topology, here fix it.

Contributor: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
This commit is contained in:
Pan Xiuli 2018-02-02 09:52:30 +08:00 committed by Liam Girdwood
parent 359af81a8a
commit 5e60d064db
1 changed files with 4 additions and 0 deletions

View File

@ -384,6 +384,7 @@ static int dai_params(struct comp_dev *dev)
{
struct dai_data *dd = comp_get_drvdata(dev);
struct comp_buffer *dma_buffer;
struct sof_ipc_comp_config *dconfig = COMP_GET_CONFIG(dev);
trace_dai("par");
@ -393,6 +394,9 @@ static int dai_params(struct comp_dev *dev)
return -EINVAL;
}
/* for DAI, we should configure its frame_fmt from topology */
dev->params.frame_fmt = dconfig->frame_fmt;
/* calculate period size based on config */
dev->frame_bytes = comp_frame_bytes(dev);
if (dev->frame_bytes == 0) {