Repository navigation
[BUG] DAI types diverged between Zephyr and Linux kernel #9803
Copy link
Copy link
Closed
Labels
P2Critical bugs or normal featuresCritical bugs or normal featuresbugSomething isn't working as expectedSomething isn't working as expected
Description
Describe the bug
DAI type is defined in Zephyr like this:
Zephyr path: include/zephyr/drivers/dai.h
enum dai_type {
» DAI_LEGACY_I2S = 0,» /**< Legacy I2S compatible with i2s.h */
» DAI_INTEL_SSP,» » /**< Intel SSP */
» DAI_INTEL_DMIC,»» /**< Intel DMIC */
» DAI_INTEL_HDA,» » /**< Intel HD/A */
» DAI_INTEL_ALH,» » /**< Intel ALH */
» DAI_IMX_SAI,» » /**< i.MX SAI */
» DAI_IMX_ESAI,» » /**< i.MX ESAI */
» DAI_AMD_BT,» » /**< Amd BT */
» DAI_AMD_SP,» » /**< Amd SP */
» DAI_AMD_DMIC,» » /**< Amd DMIC */
» DAI_MEDIATEK_AFE,» /**< Mtk AFE */
» DAI_INTEL_SSP_NHLT,» /**< nhlt ssp */
» DAI_INTEL_DMIC_NHLT,» /**< nhlt ssp */
» DAI_INTEL_HDA_NHLT,» /**< nhlt Intel HD/A */
» DAI_IMX_MICFIL,»» /**< i.MX PDM MICFIL */
» DAI_INTEL_ALH_NHLT,» /**< nhlt Intel ALH */
};
But they diverged at some point from the same definitions found in Linux kernel (or SOF initial drivers).
Linux kernel path: include/sound/sof/dai.h
/** \brief Types of DAI */
enum sof_ipc_dai_type {
» SOF_DAI_INTEL_NONE = 0,»» /**< None */
» SOF_DAI_INTEL_SSP,» » /**< Intel SSP */
» SOF_DAI_INTEL_DMIC,» » /**< Intel DMIC */
» SOF_DAI_INTEL_HDA,» » /**< Intel HD/A */
» SOF_DAI_INTEL_ALH,» » /**< Intel ALH */
» SOF_DAI_IMX_SAI,» » /**< i.MX SAI */
» SOF_DAI_IMX_ESAI,» » /**< i.MX ESAI */
» SOF_DAI_AMD_BT,»» » /**< AMD ACP BT*/
» SOF_DAI_AMD_SP,»» » /**< AMD ACP SP */
» SOF_DAI_AMD_DMIC,» » /**< AMD ACP DMIC */
» SOF_DAI_MEDIATEK_AFE,» » /**< Mediatek AFE */
» SOF_DAI_AMD_HS,»» » /**< Amd HS */
» SOF_DAI_AMD_SP_VIRTUAL,»» /**< AMD ACP SP VIRTUAL */
» SOF_DAI_AMD_HS_VIRTUAL,»» /**< AMD ACP HS VIRTUAL */
» SOF_DAI_AMD_SDW,» » /**< AMD ACP SDW */
};
Environment
- Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
- Kernel: git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git / branch for next
- Zephyr: https://github.com/zephyrproject-rtos/zephyr / branch main
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Critical bugs or normal featuresCritical bugs or normal featuresbugSomething isn't working as expectedSomething isn't working as expected
Activity
dbaluta commentedon Jan 29, 2025
@lgirdwood am I missing something about this?
I'm trying to add a new type zephyrproject-rtos/zephyr@4411719 in Zephyr, but because this struct diverged I'm having trouble in probing the DAI driver.
kv2019i commentedon Feb 3, 2025
Hmm. @dbaluta I remember discusion about this is some SOF PR that these two enums should not be mixed as there's no guarantees for the two to stay in sync. I remember this been discussed in changed in base_fw_intel.com, but I wonder now whether we have missed some bigger miuse of the dai types. I think in SOF FW, there should be a translation between Zephyr DAI type and SOF IPC DAI type.
kv2019i commentedon Feb 3, 2025
Ack, sof/src/lib/dai.c:dai_get() is mixing SOF and Zephyr DAI types. It should do a look-up for DAI-types from IPC definition to Zephyr DAI interface.
This went unnoticed when SOF_DAI_AMD_HS et al were added as these platforms did not have Zephyr support back then.
It would seem existing DAI types used by SOF Zephyr configurations all work currnetly, but it's no impossible to add new definitions unless a translation layer is added to dai_get().
dbaluta commentedon Feb 3, 2025
@kv2019i Added this PR #9807