Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
[DNM] dai: add support for Intel UAOL DAI#9227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -59,6 +59,12 @@ void dai_set_link_hda_config(uint16_t *link_config, | ||
| } | ||
| link_cfg.part.stream = common_config->host_dma_config[0]->stream_id; | ||
| break; | ||
| case SOF_DAI_INTEL_UAOL: | ||
| link_cfg.full = 0; | ||
| link_cfg.part.hchan = out_fmt->channels_count - 1; | ||
| link_cfg.part.dir = common_config->direction; | ||
| link_cfg.part.stream = common_config->host_dma_config[0]->stream_id; | ||
| break; | ||
| default: | ||
| /* other types of DAIs not need link_config */ | ||
| return; | ||
| @@ -115,6 +121,13 @@ int dai_config_dma_channel(struct dai_data *dd, struct comp_dev *dev, const void | ||
| */ | ||
| channel = 0; | ||
| break; | ||
| #if ACE_VERSION > ACE_VERSION_1_5 | ||
| case SOF_DAI_INTEL_UAOL: | ||
| channel = 0; | ||
| if (dai->host_dma_config[0]->pre_allocated_by_host) | ||
| channel = dai->host_dma_config[0]->dma_channel_id; | ||
| break; | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't fully understand this. for LNL+ all the DMA stuff is handled in the same way with an HDaudio-based solution. We just moved some of the ALH stuff into the HDaudio prodessing - see line 94 the test for ALH. so shouldn't the UAOL stuff also be moved under the HDAudio category? Why special case what looks identical? Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my comment still stands. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tlissows any update here ? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed support for MTL, so the line is no longer present. | ||
| #endif | ||
| default: | ||
| /* other types of DAIs not handled for now */ | ||
| comp_err(dev, "dai_config_dma_channel(): Unknown dai type %d", dai->type); | ||
| @@ -177,6 +190,16 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev) | ||
| dev->ipc_config.frame_fmt, dd->stream_id); | ||
| break; | ||
| case SOF_DAI_INTEL_UAOL: | ||
| #ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS | ||
| dd->stream_id = dai_get_stream_id(dai_p, dai->direction); | ||
| dev->ipc_config.frame_fmt = SOF_IPC_FRAME_S32_LE; | ||
| dd->config.burst_elems = dai_get_fifo_depth(dd->dai, dai->direction); | ||
| break; | ||
| #else | ||
| /* only native Zephyr driver supported */ | ||
| return -EINVAL; | ||
| #endif | ||
| default: | ||
| /* other types of DAIs not handled for now */ | ||
| comp_warn(dev, "dai_data_config(): Unknown dai type %d", dai->type); | ||
| @@ -393,7 +416,7 @@ int dai_config(struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai | ||
| if (ret < 0) | ||
| return ret; | ||
| return dai_set_config(dd->dai, common_config, copier_cfg->gtw_cfg.config_data); | ||
| return dai_set_config(dd->dai, common_config, &copier_cfg->gtw_cfg); | ||
| } | ||
| #if CONFIG_ZEPHYR_NATIVE_DRIVERS | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -149,6 +149,9 @@ const struct device *zephyr_dev[] = { | ||
| #if CONFIG_DAI_NXP_ESAI | ||
| DT_FOREACH_STATUS_OKAY(nxp_dai_esai, GET_DEVICE_LIST) | ||
| #endif | ||
| #if CONFIG_DAI_INTEL_UAOL | ||
| DT_FOREACH_STATUS_OKAY(intel_uaol_dai, GET_DEVICE_LIST) | ||
| #endif | ||
| }; | ||
| const struct device *dai_get_device(uint32_t type, uint32_t index) | ||
| @@ -157,7 +160,7 @@ const struct device *dai_get_device(uint32_t type, uint32_t index) | ||
| int dir; | ||
| int i; | ||
| dir = (type == SOF_DAI_INTEL_DMIC) ? DAI_DIR_RX : DAI_DIR_BOTH; | ||
| dir = (type == DAI_INTEL_DMIC) ? DAI_DIR_RX : DAI_DIR_BOTH; | ||
| for (i = 0; i < ARRAY_SIZE(zephyr_dev); i++) { | ||
| if (dai_config_get(zephyr_dev[i], &cfg, dir)) | ||
| @@ -197,6 +200,7 @@ static void dai_set_device_params(struct dai *d) | ||
| #endif | ||
| break; | ||
| case SOF_DAI_INTEL_HDA: | ||
| case SOF_DAI_INTEL_UAOL: | ||
| d->dma_dev = SOF_DMA_DEV_HDA; | ||
| d->dma_caps = SOF_DMA_CAP_HDA; | ||
| break; | ||
| @@ -210,8 +214,47 @@ struct dai *dai_get(uint32_t type, uint32_t index, uint32_t flags) | ||
| { | ||
| const struct device *dev; | ||
| struct dai *d; | ||
| uint32_t z_type; | ||
| switch (type) { | ||
| case SOF_DAI_INTEL_SSP: | ||
| z_type = DAI_INTEL_SSP; | ||
| break; | ||
| case SOF_DAI_INTEL_DMIC: | ||
| z_type = DAI_INTEL_DMIC; | ||
| break; | ||
| case SOF_DAI_INTEL_HDA: | ||
| z_type = DAI_INTEL_HDA; | ||
| break; | ||
| case SOF_DAI_INTEL_ALH: | ||
| z_type = DAI_INTEL_ALH; | ||
| break; | ||
| case SOF_DAI_IMX_SAI: | ||
| z_type = DAI_IMX_SAI; | ||
| break; | ||
| case SOF_DAI_IMX_ESAI: | ||
| z_type = DAI_IMX_ESAI; | ||
| break; | ||
| case SOF_DAI_AMD_BT: | ||
| z_type = DAI_AMD_BT; | ||
| break; | ||
| case SOF_DAI_AMD_SP: | ||
| z_type = DAI_AMD_SP; | ||
| break; | ||
| case SOF_DAI_AMD_DMIC: | ||
| z_type = DAI_AMD_DMIC; | ||
| break; | ||
| case SOF_DAI_MEDIATEK_AFE: | ||
| z_type = DAI_MEDIATEK_AFE; | ||
| break; | ||
| case SOF_DAI_INTEL_UAOL: | ||
| z_type = DAI_INTEL_UAOL; | ||
| break; | ||
| default: | ||
| return NULL; | ||
| } | ||
tlissows marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| dev = dai_get_device(type, index); | ||
| dev = dai_get_device(z_type, index); | ||
| if (!dev) { | ||
| tr_err(&dai_tr, "dai_get: failed to get dai with index %d type %d", | ||
| index, type); | ||
Uh oh!
There was an error while loading. Please reload this page.