Skip to content
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

lib: dai: Fix dai_get_device #9807

Merged
merged 1 commit into from
Feb 4, 2025
Merged

Conversation

dbaluta
Copy link
Collaborator

@dbaluta dbaluta commented Feb 3, 2025

dai_get_device is called using DAI-types from IPC definition but calls dai_config_get() which returnes a Zephyr DAI type.

So, in order to fix this, we introduce dai_type_to_zephyr which converts a DAI-type from IPC definition to a Zephyr DAI type, so that later we can compare types in the same space.

The current code works because the two DAI types are matching, but it is no longer the case with latest introduces types.

Fixes: #9803

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dbaluta , looks good, few minor notes but I think the main one to move out of for loop and then good to go.

dai_get_device is called using DAI-types from IPC definition
but calls dai_config_get() which returns a Zephyr DAI type.

So, in order to fix this, we introduce `dai_type_to_zephyr`
which converts a DAI-type from IPC definition to a Zephyr DAI
type, so that later we can compare types in the same space.

The current code works because the two DAI types are matching,
but it is no longer the case with latest introduces types.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
@dbaluta
Copy link
Collaborator Author

dbaluta commented Feb 4, 2025

v2

  • fixed comments from @LaurentiuM1234 @kv2019i
  • changed name to sof_dai_type_to_zephyr
  • moved call to sof_dai_type_to_zephyr outside of for loop

@kv2019i
Copy link
Collaborator

kv2019i commented Feb 4, 2025

FYI @thesofproject/amd @thesofproject/mediatek this may impact your work with SOF Zephyr

@kv2019i kv2019i merged commit a1e6345 into thesofproject:main Feb 4, 2025
45 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] DAI types diverged between Zephyr and Linux kernel
4 participants