-
Notifications
You must be signed in to change notification settings - Fork 349
treewide: zephyr: add sof_ prefix to dma_get/put() and struct dma #10090
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
treewide: zephyr: add sof_ prefix to dma_get/put() and struct dma #10090
Conversation
Add "sof_" namespace to dma_get()/put() in the Zephyr native drivers builds. The main "struct dma" is also renamed, so this touches quite many places in code. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the Zephyr DMA structures and functions by adding a sof_ prefix to avoid naming conflicts with native drivers.
- Renamed
struct dmatostruct sof_dmathroughout the codebase. - Updated
sof_dma_get/sof_dma_putfunction signatures and calls. - Adjusted DMA array definitions and cache initialization casts for the new type.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| zephyr/lib/dma.c | Renamed struct dma dma[] to struct sof_dma dma[]. |
| zephyr/include/sof/lib/dma.h | Updated DMA type declarations and prototypes to use sof_dma. |
| src/platform/posix/dma.c | Changed posix_sof_dma array and initializers to struct sof_dma. |
| src/platform/imx8m/lib/dma.c | Updated cache initialization cast for renamed DMA type. |
| src/library_manager/lib_manager.c | Updated lib_manager_dma_ext to reference struct sof_dma. |
| src/lib/dma.c | Refactored DMA init/get/put functions to use struct sof_dma. |
| src/ipc/ipc3/host-page-table.c | Adjusted signature of ipc_get_page_descriptors to use sof_dma. |
| src/include/sof/lib/dai-zephyr.h | Updated DMA pointer in struct dai_data to struct sof_dma. |
| src/include/sof/ipc/common.h | Conditional DMA type in ipc_data_host_buffer now uses sof_dma. |
| src/audio/copier/host_copier.h | Conditional DMA field now uses struct sof_dma. |
| src/audio/chain_dma.c | Renamed dma_host/dma_link fields to use struct sof_dma. |
|
|
||
| static const struct dma_info lib_dma = { | ||
| .dma_array = cache_to_uncache_init((struct dma *)dma), | ||
| .dma_array = cache_to_uncache_init((void *)dma), |
Copilot
AI
Jul 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider casting directly to struct sof_dma * instead of void * to preserve type safety and clarity (e.g., cache_to_uncache_init((struct sof_dma *)dma)).
| .dma_array = cache_to_uncache_init((void *)dma), | |
| .dma_array = cache_to_uncache_init((struct sof_dma *)dma), |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice clean up.
|
@lyakh pls review |
Add "sof_" namespace to dma_get()/put() in the Zephyr native drivers builds. The main "struct dma" is also renamed, so this touches quite many places in code.
V2 of #9728. Now that XTOS code is removed (see #9983 ), this is now a very simple patch. No need for ugly typedefs anymore.
I ketp the NATIVE_DRIVERS bits still in the codebase, but that's obviously the next bit that can be removed (along with dai-legacy.c and host-legacy.c -- and their dependencies).