Skip to content

Commit bba6e8d

Browse files
committed
module: Add support for module-specific init data
Add a global ID for module specific init data in the extended init data section and update the decode function to save the data in the module's init_data. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent e19293c commit bba6e8d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/audio/module_adapter/module_adapter_ipc4.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ module_ext_init_decode(struct comp_dev *dev, struct module_config *dst,
7878
dp_data->domain_id, dp_data->stack_bytes, dp_data->heap_bytes);
7979
break;
8080
}
81+
case IPC4_MOD_INIT_DATA_ID_MODULE_DATA:
82+
{
83+
/* set the module init_data */
84+
dst->init_data = (const void *)(obj + 1);
85+
dst->avail = true;
86+
dst->size = obj->object_words * sizeof(uint32_t);
87+
comp_info(dev, "module init data size %u bytes", dst->size);
88+
break;
89+
}
8190
default:
8291
comp_info(dev, "Unknown ext init object id %u of %u words",
8392
obj->object_id, obj->object_words);
@@ -148,8 +157,11 @@ int module_adapter_init_data(struct comp_dev *dev,
148157
}
149158
}
150159

151-
dst->init_data = cfg; /* legacy API */
152-
dst->avail = true;
160+
if (!config->ipc_extended_init) {
161+
dst->init_data = cfg; /* legacy API */
162+
dst->avail = true;
163+
}
164+
153165
return 0;
154166
}
155167

src/include/ipc4/module.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ struct ipc4_vendor_error {
7777
enum ipc4_mod_init_data_glb_id {
7878
IPC4_MOD_INIT_DATA_ID_INVALID = 0,
7979
IPC4_MOD_INIT_DATA_ID_DP_DATA = 1,
80-
IPC4_MOD_INIT_DATA_ID_MAX = IPC4_MOD_INIT_DATA_ID_DP_DATA,
80+
IPC4_MOD_INIT_DATA_ID_MODULE_DATA = 2,
81+
IPC4_MOD_INIT_DATA_ID_MAX = IPC4_MOD_INIT_DATA_ID_MODULE_DATA,
8182
};
8283

8384
/* data object for vendor bespoke data with ABI growth and backwards compat */

0 commit comments

Comments
 (0)