lib: dai: Expose Zephyr DAI device retrieval function

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 <tomasz.m.leman@intel.com>
This commit is contained in:
Tomasz Leman 2024-05-21 14:21:10 +02:00 committed by Kai Vehmanen
parent 828b450c4d
commit 55ae14549d
2 changed files with 7 additions and 2 deletions

View File

@ -290,6 +290,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__ */

View File

@ -151,7 +151,7 @@ const struct device *zephyr_dev[] = {
#endif
};
static const struct device *dai_get_zephyr_device(uint32_t type, uint32_t index)
const struct device *dai_get_device(uint32_t type, uint32_t index)
{
struct dai_config cfg;
int dir;
@ -211,7 +211,7 @@ struct dai *dai_get(uint32_t type, uint32_t index, uint32_t flags)
const struct device *dev;
struct dai *d;
dev = dai_get_zephyr_device(type, index);
dev = dai_get_device(type, index);
if (!dev) {
tr_err(&dai_tr, "dai_get: failed to get dai with index %d type %d",
index, type);