Skip to content

Commit 9ce5151

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 ce4acfd commit 9ce5151

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

src/audio/base_fw.c

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <sof/lib/cpu.h>
1414
#include <rtos/init.h>
1515
#include <platform/lib/clk.h>
16+
#include <intel_adsp_hda.h>
1617

1718
#if CONFIG_ACE_V1X_ART_COUNTER || CONFIG_ACE_V1X_RTC_COUNTER
1819
#include <zephyr/device.h>
@@ -391,6 +392,38 @@ 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+
intel_adsp_force_dmi_l0_state();
402+
} else {
403+
tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state");
404+
intel_adsp_allow_dmi_l1_state();
405+
}
406+
407+
return 0;
408+
}
409+
410+
static int basefw_set_fw_config(bool first_block,
411+
bool last_block,
412+
uint32_t data_offset,
413+
const char *data)
414+
{
415+
const struct sof_tlv *tlv = (const struct sof_tlv *)data;
416+
417+
switch (tlv->type) {
418+
case IPC4_DMI_FORCE_L1_EXIT:
419+
return fw_config_set_force_l1_exit(tlv);
420+
default:
421+
break;
422+
}
423+
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
424+
return 0;
425+
}
426+
394427
static int basefw_get_large_config(struct comp_dev *dev,
395428
uint32_t param_id,
396429
bool first_block,
@@ -457,8 +490,7 @@ static int basefw_set_large_config(struct comp_dev *dev,
457490
{
458491
switch (param_id) {
459492
case IPC4_FW_CONFIG:
460-
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
461-
return 0;
493+
return basefw_set_fw_config(first_block, last_block, data_offset, data);
462494
case IPC4_SYSTEM_TIME:
463495
return basefw_set_system_time(param_id, first_block,
464496
last_block, data_offset, data);

0 commit comments

Comments
 (0)