|
9 | 9 | #include <sof/audio/module_adapter/module/modules.h> |
10 | 10 | #include <utilities/array.h> |
11 | 11 | #include <iadk_module_adapter.h> |
12 | | -#include <system_agent.h> |
13 | 12 | #include <sof/lib_manager.h> |
14 | 13 | #include <sof/audio/module_adapter/module/module_interface.h> |
15 | 14 |
|
@@ -56,46 +55,16 @@ static int modules_init(struct processing_module *mod) |
56 | 55 | { |
57 | 56 | struct module_data *md = &mod->priv; |
58 | 57 | struct comp_dev *dev = mod->dev; |
59 | | - const struct comp_driver *const drv = dev->drv; |
60 | 58 | const struct ipc4_base_module_cfg *src_cfg = &md->cfg.base_cfg; |
61 | | - const struct comp_ipc_config *config = &dev->ipc_config; |
62 | | - void *adapter; |
63 | | - int ret; |
64 | | - |
65 | | - uintptr_t module_entry_point = lib_manager_allocate_module(config, src_cfg); |
66 | | - |
67 | | - if (module_entry_point == 0) { |
68 | | - comp_err(dev, "modules_init(), lib_manager_allocate_module() failed!"); |
69 | | - return -EINVAL; |
70 | | - } |
71 | 59 |
|
72 | 60 | /* At this point module resources are allocated and it is moved to L2 memory. */ |
73 | 61 | comp_info(dev, "modules_init() start"); |
74 | 62 |
|
75 | | - const uint32_t module_id = IPC4_MOD_ID(config->id); |
76 | | - const uint32_t instance_id = IPC4_INST_ID(config->id); |
77 | | - const uint32_t log_handle = (uint32_t)drv->tctx; |
78 | | - |
79 | | - byte_array_t mod_cfg = { |
80 | | - .data = (uint8_t *)md->cfg.init_data, |
81 | | - /* Intel modules expects DW size here */ |
82 | | - .size = md->cfg.size >> 2, |
83 | | - }; |
84 | | - |
85 | | - ret = system_agent_start(module_entry_point, module_id, instance_id, 0, log_handle, |
86 | | - &mod_cfg, &adapter); |
87 | | - if (ret) { |
88 | | - comp_info(dev, "System agent failed"); |
89 | | - return ret; |
90 | | - } |
91 | | - |
92 | | - module_set_private_data(mod, adapter); |
93 | | - |
94 | 63 | md->mpd.in_buff_size = src_cfg->ibs; |
95 | 64 | md->mpd.out_buff_size = src_cfg->obs; |
96 | 65 |
|
97 | 66 | mod->proc_type = MODULE_PROCESS_TYPE_SOURCE_SINK; |
98 | | - return iadk_wrapper_init(adapter); |
| 67 | + return iadk_wrapper_init(module_get_private_data(mod)); |
99 | 68 | } |
100 | 69 |
|
101 | 70 | /** |
|
0 commit comments