|
12 | 12 | */ |
13 | 13 |
|
14 | 14 | #include <rtos/symbol.h> |
15 | | - |
16 | 15 | #include <sof/audio/module_adapter/module/generic.h> |
| 16 | +#include <sof/schedule/dp_schedule.h> |
17 | 17 |
|
18 | 18 | LOG_MODULE_DECLARE(module_adapter, CONFIG_SOF_LOG_LEVEL); |
19 | 19 |
|
@@ -95,7 +95,11 @@ int module_init(struct processing_module *mod) |
95 | 95 | list_init(&md->memory.mem_list); |
96 | 96 |
|
97 | 97 | /* Now we can proceed with module specific initialization */ |
98 | | - ret = interface->init(mod); |
| 98 | + if (mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) |
| 99 | + ret = scheduler_dp_rtio_ipc(mod, SOF_IPC4_MOD_INIT_INSTANCE, NULL); |
| 100 | + else |
| 101 | + ret = interface->init(mod); |
| 102 | + |
99 | 103 | if (ret) { |
100 | 104 | comp_err(dev, "module_init() error %d: module specific init failed, comp id %d", |
101 | 105 | ret, dev_comp_id(dev)); |
@@ -242,7 +246,23 @@ int module_prepare(struct processing_module *mod, |
242 | 246 | return -EPERM; |
243 | 247 | #endif |
244 | 248 | if (ops->prepare) { |
245 | | - int ret = ops->prepare(mod, sources, num_of_sources, sinks, num_of_sinks); |
| 249 | + int ret; |
| 250 | + |
| 251 | + if (mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) { |
| 252 | + union scheduler_dp_rtio_ipc_param param = { |
| 253 | + .pipeline_state = { |
| 254 | + .trigger_cmd = COMP_TRIGGER_PREPARE, |
| 255 | + .state = SOF_IPC4_PIPELINE_STATE_RUNNING, |
| 256 | + .n_sources = num_of_sources, |
| 257 | + .sources = sources, |
| 258 | + .n_sinks = num_of_sinks, |
| 259 | + .sinks = sinks, |
| 260 | + }, |
| 261 | + }; |
| 262 | + ret = scheduler_dp_rtio_ipc(mod, SOF_IPC4_GLB_SET_PIPELINE_STATE, ¶m); |
| 263 | + } else { |
| 264 | + ret = ops->prepare(mod, sources, num_of_sources, sinks, num_of_sinks); |
| 265 | + } |
246 | 266 |
|
247 | 267 | if (ret) { |
248 | 268 | comp_err(dev, "module_prepare() error %d: module specific prepare failed, comp_id %d", |
@@ -366,11 +386,17 @@ int module_reset(struct processing_module *mod) |
366 | 386 | if (md->state < MODULE_IDLE) |
367 | 387 | return 0; |
368 | 388 | #endif |
369 | | - /* cancel task if DP task*/ |
370 | | - if (mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP && mod->dev->task) |
371 | | - schedule_task_cancel(mod->dev->task); |
| 389 | + |
372 | 390 | if (ops->reset) { |
373 | | - ret = ops->reset(mod); |
| 391 | + if (mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) { |
| 392 | + union scheduler_dp_rtio_ipc_param param = { |
| 393 | + .pipeline_state.trigger_cmd = COMP_TRIGGER_STOP, |
| 394 | + }; |
| 395 | + ret = scheduler_dp_rtio_ipc(mod, SOF_IPC4_GLB_SET_PIPELINE_STATE, ¶m); |
| 396 | + } else { |
| 397 | + ret = ops->reset(mod); |
| 398 | + } |
| 399 | + |
374 | 400 | if (ret) { |
375 | 401 | if (ret != PPL_STATUS_PATH_STOP) |
376 | 402 | comp_err(mod->dev, |
@@ -423,7 +449,7 @@ int module_free(struct processing_module *mod) |
423 | 449 | struct module_data *md = &mod->priv; |
424 | 450 | int ret = 0; |
425 | 451 |
|
426 | | - if (ops->free) { |
| 452 | + if (ops->free && mod->dev->ipc_config.proc_domain != COMP_PROCESSING_DOMAIN_DP) { |
427 | 453 | ret = ops->free(mod); |
428 | 454 | if (ret) |
429 | 455 | comp_warn(mod->dev, "error: %d for %d", |
@@ -570,8 +596,16 @@ int module_bind(struct processing_module *mod, struct bind_info *bind_data) |
570 | 596 | if (ret) |
571 | 597 | return ret; |
572 | 598 |
|
573 | | - if (ops->bind) |
574 | | - ret = ops->bind(mod, bind_data); |
| 599 | + if (ops->bind) { |
| 600 | + if (mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) { |
| 601 | + union scheduler_dp_rtio_ipc_param param = { |
| 602 | + .bind_data = bind_data, |
| 603 | + }; |
| 604 | + ret = scheduler_dp_rtio_ipc(mod, SOF_IPC4_MOD_BIND, ¶m); |
| 605 | + } else { |
| 606 | + ret = ops->bind(mod, bind_data); |
| 607 | + } |
| 608 | + } |
575 | 609 |
|
576 | 610 | return ret; |
577 | 611 | } |
|
0 commit comments