Skip to content

Commit 2e8dd2a

Browse files
committed
lib: dai: Add support for DAI_IMX_MICFIL
Support PDM MICFIL interface with Zephyr native driver interface. SOF PDM MICFIL driver is no longer supported and it will be soon removed. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
1 parent 22755c4 commit 2e8dd2a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/audio/dai-zephyr.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ int dai_set_config(struct dai *dai, struct ipc_config_dai *common_config,
181181
cfg.type = DAI_IMX_ESAI;
182182
cfg_params = &sof_cfg->esai;
183183
break;
184+
case SOF_DAI_IMX_MICFIL:
185+
cfg.type = DAI_IMX_MICFIL;
186+
cfg_params = &sof_cfg->micfil;
187+
break;
184188
default:
185189
return -EINVAL;
186190
}
@@ -708,6 +712,7 @@ static int dai_get_dma_slot(struct dai_data *dd, struct comp_dev *dev, uint32_t
708712
switch (cfg.type) {
709713
case DAI_IMX_SAI:
710714
case DAI_IMX_ESAI:
715+
case DAI_IMX_MICFIL:
711716
*slot = (hs & GENMASK(15, 8)) >> 8;
712717
break;
713718
default:

src/ipc/ipc3/dai.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ int dai_config_dma_channel(struct dai_data *dd, struct comp_dev *dev, const void
7373
case SOF_DAI_IMX_MICFIL:
7474
channel = dai_get_handshake(dd->dai, dai->direction,
7575
dd->stream_id);
76+
channel = channel & GENMASK(7, 0);
7677
break;
7778
case SOF_DAI_AMD_BT:
7879
channel = dai_get_handshake(dd->dai, dai->direction,

src/lib/dai.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ const struct device *zephyr_dev[] = {
149149
#if CONFIG_DAI_NXP_ESAI
150150
DT_FOREACH_STATUS_OKAY(nxp_dai_esai, GET_DEVICE_LIST)
151151
#endif
152+
#if CONFIG_DAI_NXP_MICFIL
153+
DT_FOREACH_STATUS_OKAY(nxp_dai_micfil, GET_DEVICE_LIST)
154+
#endif
152155
};
153156

154157
/* convert sof_ipc_dai_type to Zephyr dai_type */
@@ -175,10 +178,11 @@ static int sof_dai_type_to_zephyr(uint32_t type)
175178
return DAI_AMD_DMIC;
176179
case SOF_DAI_MEDIATEK_AFE:
177180
return DAI_MEDIATEK_AFE;
181+
case SOF_DAI_IMX_MICFIL:
182+
return DAI_IMX_MICFIL;
178183
case SOF_DAI_AMD_HS:
179184
case SOF_DAI_AMD_SP_VIRTUAL:
180185
case SOF_DAI_AMD_HS_VIRTUAL:
181-
case SOF_DAI_IMX_MICFIL:
182186
case SOF_DAI_AMD_SW_AUDIO:
183187
return -ENOTSUP;
184188
default:

0 commit comments

Comments
 (0)