From: Pan Xiuli xiuli.pan@linux.intel.com
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 ---
Modify from Keyon's patch, changed to use COMP_GET_CONFIG.
Test with: Mininow max rt5651 SOF master: 0505823b9667036202758ea950c3ff3347359730 SOF-Tool master: 8c9ebfe9c4f8037b0d0816dedcb87dabef347c6b https://github.com/plbossart/sound/tree/topic/sof-v4.14: 5a91e6776d41b0e97828882294cdc00b5c0bafd6
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- src/audio/dai.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/src/audio/dai.c b/src/audio/dai.c index d19e18a..8731ffd 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -383,6 +383,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");
@@ -392,6 +393,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) {