dts : fix set_configuration() fail on MTL

md->state is set in IPC3, not in IPC4.

set_configuration() would fail on MTL because md->state is not set.

Add macro CONFIG_IPC_MAJOR_3 to avoid this problem.

Co-developed-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
This commit is contained in:
Joe Cheng 2023-10-25 14:41:39 +08:00 committed by Curtis Malainey
parent a9ef2b2bf2
commit 0a19e7f74b
1 changed files with 8 additions and 3 deletions

View File

@ -430,11 +430,16 @@ dts_codec_set_configuration(struct processing_module *mod, uint32_t config_id,
if (ret < 0)
return ret;
/* return if more fragments are expected or if the module is not prepared */
if ((pos != MODULE_CFG_FRAGMENT_LAST && pos != MODULE_CFG_FRAGMENT_SINGLE) ||
md->state < MODULE_INITIALIZED)
/* return if more fragments are expected */
if (pos != MODULE_CFG_FRAGMENT_LAST && pos != MODULE_CFG_FRAGMENT_SINGLE)
return 0;
#if CONFIG_IPC_MAJOR_3
// return if the module is not prepared
if (md->state < MODULE_INITIALIZED)
return 0;
#endif
/* whole configuration received, apply it now */
ret = dts_codec_apply_config(mod);
if (ret) {