Skip to content

Commit

Permalink
lib: dai: Expose Zephyr DAI device retrieval function
Browse files Browse the repository at this point in the history
This patch exposes the function to retrieve a pointer to the Zephyr
device structure for a DAI of a given type and index. Previously, the
function `dai_get_zephyr_device` was static and only usable within
`dai.c`. By introducing `dai_get_device`, other parts of the SOF
codebase can now access the Zephyr DAI device pointers, facilitating
integration with Zephyr native DAI drivers.

Signed-off-by: Tomasz Leman <[email protected]>
  • Loading branch information
tmleman committed May 23, 2024
1 parent bd77aa3 commit dba4d93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/include/sof/lib/dai-zephyr.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ void dai_dma_position_update(struct dai_data *dd, struct comp_dev *dev);
* \brief release llp slot
*/
void dai_release_llp_slot(struct dai_data *dd);

/**
* \brief Retrieve a pointer to the Zephyr device structure for a DAI of a given type and index.
*/
const struct device *dai_get_device(uint32_t type, uint32_t index);
/** @}*/

#endif /* __SOF_LIB_DAI_ZEPHYR_H__ */
6 changes: 6 additions & 0 deletions src/lib/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ void dai_put(struct dai *dai)

rfree(dai);
}

const struct device *dai_get_device(uint32_t type, uint32_t index)
{
return dai_get_zephyr_device(type, index);
}

#else
static inline const struct dai_type_info *dai_find_type(uint32_t type)
{
Expand Down

0 comments on commit dba4d93

Please sign in to comment.