mirror of https://github.com/thesofproject/sof.git
modules: lib_manager: Move declare_dynamic_module_adapter to lib_manager
The declare_dynamic_module_adapter function has been moved from module_adapter/module/modules.h to lib_manager and renamed to lib_manager_prepare_module_adapter. It was and still is only used in lib_manager. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
This commit is contained in:
parent
e0aba2b67a
commit
2df6d1b048
|
@ -8,6 +8,7 @@
|
|||
#include <sof/audio/module_adapter/module/generic.h>
|
||||
#include <sof/audio/module_adapter/module/modules.h>
|
||||
#include <utilities/array.h>
|
||||
#include <iadk_module_adapter.h>
|
||||
#include <system_agent.h>
|
||||
#include <native_system_agent.h>
|
||||
#include <api_version.h>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#define __SOF_AUDIO_MODULES__
|
||||
|
||||
#include <sof/audio/module_adapter/module/generic.h>
|
||||
#include <iadk_module_adapter.h>
|
||||
|
||||
/* Intel module adapter is an extension to SOF module adapter component that allows to integrate
|
||||
* modules developed under IADK (Intel Audio Development Kit)
|
||||
|
@ -43,37 +42,4 @@
|
|||
/* Processing Module Adapter API */
|
||||
extern const struct module_interface processing_module_adapter_interface;
|
||||
|
||||
static inline void declare_dynamic_module_adapter(struct comp_driver *drv,
|
||||
enum sof_comp_type mtype,
|
||||
const struct sof_uuid *uuid,
|
||||
struct tr_ctx *tr)
|
||||
{
|
||||
drv->type = mtype;
|
||||
drv->uid = uuid;
|
||||
drv->tctx = tr;
|
||||
drv->ops.create = module_adapter_new;
|
||||
drv->ops.prepare = module_adapter_prepare;
|
||||
drv->ops.params = module_adapter_params;
|
||||
drv->ops.copy = module_adapter_copy;
|
||||
#if CONFIG_IPC_MAJOR_3
|
||||
drv->ops.cmd = module_adapter_cmd;
|
||||
#endif
|
||||
drv->ops.trigger = module_adapter_trigger;
|
||||
drv->ops.reset = module_adapter_reset;
|
||||
drv->ops.free = module_adapter_free;
|
||||
drv->ops.set_large_config = module_set_large_config;
|
||||
drv->ops.get_large_config = module_get_large_config;
|
||||
drv->ops.get_attribute = module_adapter_get_attribute;
|
||||
drv->ops.bind = module_adapter_bind;
|
||||
drv->ops.unbind = module_adapter_unbind;
|
||||
drv->ops.get_total_data_processed = module_adapter_get_total_data_processed;
|
||||
drv->ops.dai_get_hw_params = module_adapter_get_hw_params;
|
||||
drv->ops.position = module_adapter_position;
|
||||
drv->ops.dai_ts_config = module_adapter_ts_config_op;
|
||||
drv->ops.dai_ts_start = module_adapter_ts_start_op;
|
||||
drv->ops.dai_ts_stop = module_adapter_ts_stop_op;
|
||||
drv->ops.dai_ts_get = module_adapter_ts_get_op;
|
||||
drv->adapter_ops = &processing_module_adapter_interface;
|
||||
}
|
||||
|
||||
#endif /* __SOF_AUDIO_MODULES__ */
|
||||
|
|
|
@ -481,6 +481,36 @@ static void lib_manager_update_sof_ctx(void *base_addr, uint32_t lib_id)
|
|||
}
|
||||
|
||||
#if CONFIG_INTEL_MODULES
|
||||
static void lib_manager_prepare_module_adapter(struct comp_driver *drv, const struct sof_uuid *uuid)
|
||||
{
|
||||
drv->type = SOF_COMP_MODULE_ADAPTER;
|
||||
drv->uid = uuid;
|
||||
drv->tctx = &lib_manager_tr;
|
||||
drv->ops.create = module_adapter_new;
|
||||
drv->ops.prepare = module_adapter_prepare;
|
||||
drv->ops.params = module_adapter_params;
|
||||
drv->ops.copy = module_adapter_copy;
|
||||
#if CONFIG_IPC_MAJOR_3
|
||||
drv->ops.cmd = module_adapter_cmd;
|
||||
#endif
|
||||
drv->ops.trigger = module_adapter_trigger;
|
||||
drv->ops.reset = module_adapter_reset;
|
||||
drv->ops.free = module_adapter_free;
|
||||
drv->ops.set_large_config = module_set_large_config;
|
||||
drv->ops.get_large_config = module_get_large_config;
|
||||
drv->ops.get_attribute = module_adapter_get_attribute;
|
||||
drv->ops.bind = module_adapter_bind;
|
||||
drv->ops.unbind = module_adapter_unbind;
|
||||
drv->ops.get_total_data_processed = module_adapter_get_total_data_processed;
|
||||
drv->ops.dai_get_hw_params = module_adapter_get_hw_params;
|
||||
drv->ops.position = module_adapter_position;
|
||||
drv->ops.dai_ts_config = module_adapter_ts_config_op;
|
||||
drv->ops.dai_ts_start = module_adapter_ts_start_op;
|
||||
drv->ops.dai_ts_stop = module_adapter_ts_stop_op;
|
||||
drv->ops.dai_ts_get = module_adapter_ts_get_op;
|
||||
drv->adapter_ops = &processing_module_adapter_interface;
|
||||
}
|
||||
|
||||
int lib_manager_register_module(const uint32_t component_id)
|
||||
{
|
||||
const struct lib_manager_mod_ctx *const ctx = lib_manager_get_mod_ctx(component_id);
|
||||
|
@ -529,7 +559,7 @@ int lib_manager_register_module(const uint32_t component_id)
|
|||
mod = (struct sof_man_module *)((uint8_t *)desc + SOF_MAN_MODULE_OFFSET(entry_index));
|
||||
const struct sof_uuid *uid = (struct sof_uuid *)&mod->uuid[0];
|
||||
|
||||
declare_dynamic_module_adapter(drv, SOF_COMP_MODULE_ADAPTER, uid, &lib_manager_tr);
|
||||
lib_manager_prepare_module_adapter(drv, uid);
|
||||
|
||||
new_drv_info->drv = drv;
|
||||
|
||||
|
|
Loading…
Reference in New Issue