mirror of https://github.com/thesofproject/sof.git
drivers: mtk: get memif format from config of DAI component
MTK memif(DMA) can support different format from BE dai, so we don't need to rely on the transformation of SOF DAI. After the patch, the format of memif follows DAI component, so the format can be kept the same in the pipeline and do format transformation via AFE if necessary. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
This commit is contained in:
parent
734dbd38f0
commit
70c257f9ae
|
@ -294,6 +294,20 @@ static int memif_set_config(struct dma_chan_data *channel, struct dma_sg_config
|
|||
ret = afe_dai_get_config(memif->afe, dai_id, &memif->channel, &memif->rate, &memif->format);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* memif format should follow DAI component, not dai hw configuration */
|
||||
switch (config->src_width) {
|
||||
case 2:
|
||||
memif->format = SOF_IPC_FRAME_S16_LE;
|
||||
break;
|
||||
case 4:
|
||||
memif->format = SOF_IPC_FRAME_S32_LE;
|
||||
break;
|
||||
default:
|
||||
tr_err(&memif_tr, "afe-memif: not support bitwidth %u!", config->src_width);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* set the afe memif parameters */
|
||||
ret = afe_memif_set_params(memif->afe, memif->memif_id, memif->channel, memif->rate,
|
||||
memif->format);
|
||||
|
|
Loading…
Reference in New Issue