Skip to content

Commit f34fc81

Browse files
committed
base_fw: add DMI_FORCE_L1_EXIT FW config
Add new parameter for SW to force DMI L1 exit on IPC request. Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
1 parent e7ccc41 commit f34fc81

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

src/audio/base_fw.c

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/* TODO: Remove platform-specific code, see https://github.com/thesofproject/sof/issues/7549 */
2323
#if defined(CONFIG_SOC_SERIES_INTEL_ACE) || defined(CONFIG_INTEL_ADSP_CAVS)
2424
# define INTEL_ADSP 1
25+
#include <intel_adsp_hda.h>
2526
#endif
2627

2728
LOG_MODULE_REGISTER(basefw, CONFIG_SOF_LOG_LEVEL);
@@ -391,6 +392,42 @@ static int basefw_power_state_info_get(uint32_t *data_offset, char *data)
391392
return 0;
392393
}
393394

395+
static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
396+
{
397+
const uint32_t force = tlv->value[0];
398+
399+
if (force) {
400+
tr_info(&basefw_comp_tr, "FW config set force dmi l0 state");
401+
#ifdef INTEL_ADSP
402+
intel_adsp_force_dmi_l0_state();
403+
#endif
404+
} else {
405+
tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state");
406+
#ifdef INTEL_ADSP
407+
intel_adsp_allow_dmi_l1_state();
408+
#endif
409+
}
410+
411+
return 0;
412+
}
413+
414+
static int basefw_set_fw_config(bool first_block,
415+
bool last_block,
416+
uint32_t data_offset,
417+
const char *data)
418+
{
419+
const struct sof_tlv *tlv = (const struct sof_tlv *)data;
420+
421+
switch (tlv->type) {
422+
case IPC4_DMI_FORCE_L1_EXIT:
423+
return fw_config_set_force_l1_exit(tlv);
424+
default:
425+
break;
426+
}
427+
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
428+
return 0;
429+
}
430+
394431
static int basefw_get_large_config(struct comp_dev *dev,
395432
uint32_t param_id,
396433
bool first_block,
@@ -457,8 +494,7 @@ static int basefw_set_large_config(struct comp_dev *dev,
457494
{
458495
switch (param_id) {
459496
case IPC4_FW_CONFIG:
460-
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
461-
return 0;
497+
return basefw_set_fw_config(first_block, last_block, data_offset, data);
462498
case IPC4_SYSTEM_TIME:
463499
return basefw_set_system_time(param_id, first_block,
464500
last_block, data_offset, data);

0 commit comments

Comments
 (0)