audio: base_fw: move L1_EXIT control to platform specific code

Move the Intel specific L1_EXIT control handling from base_fw.c
to Intel specific platform code.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2024-04-18 14:47:01 +03:00 committed by Kai Vehmanen
parent c75c17e800
commit a1120f0f9f
2 changed files with 52 additions and 41 deletions

View File

@ -17,9 +17,6 @@
#include <sof/lib_manager.h>
#include <rtos/init.h>
#include <platform/lib/clk.h>
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
#include <intel_adsp_hda.h>
#endif
#include <sof/audio/module_adapter/module/generic.h>
#include <sof/schedule/dp_schedule.h>
#include <sof/schedule/ll_schedule.h>
@ -475,42 +472,6 @@ static int basefw_libraries_info_get(uint32_t *data_offset, char *data)
return 0;
}
static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
{
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
const uint32_t force = tlv->value[0];
if (force) {
tr_info(&basefw_comp_tr, "FW config set force dmi l0 state");
intel_adsp_force_dmi_l0_state();
} else {
tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state");
intel_adsp_allow_dmi_l1_state();
}
return 0;
#else
return IPC4_UNAVAILABLE;
#endif
}
static int basefw_set_fw_config(bool first_block,
bool last_block,
uint32_t data_offset,
const char *data)
{
const struct sof_tlv *tlv = (const struct sof_tlv *)data;
switch (tlv->type) {
case IPC4_DMI_FORCE_L1_EXIT:
return fw_config_set_force_l1_exit(tlv);
default:
break;
}
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
return 0;
}
int schedulers_info_get(uint32_t *data_off_size,
char *data,
uint32_t core_id)
@ -676,8 +637,6 @@ static int basefw_set_large_config(struct comp_dev *dev,
const char *data)
{
switch (param_id) {
case IPC4_FW_CONFIG:
return basefw_set_fw_config(first_block, last_block, data_offset, data);
case IPC4_PERF_MEASUREMENTS_STATE:
return set_perf_meas_state(data);
case IPC4_SYSTEM_TIME:

View File

@ -4,11 +4,20 @@
//
// Author: Kai Vehmanen <kai.vehmanen@linux.intel.com>
#include <zephyr/logging/log_ctrl.h>
#include <rtos/string.h>
#include <sof/tlv.h>
#include <sof/lib/dai.h>
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
#include <intel_adsp_hda.h>
#endif
#include <ipc4/base_fw.h>
LOG_MODULE_REGISTER(basefw_platform, CONFIG_SOF_LOG_LEVEL);
int platform_basefw_fw_config(uint32_t *data_offset, char *data)
{
struct sof_tlv *tuple = (struct sof_tlv *)data;
@ -68,6 +77,42 @@ int platform_basefw_get_large_config(struct comp_dev *dev,
return -EINVAL;
}
static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
{
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
const uint32_t force = tlv->value[0];
if (force) {
tr_info(&basefw_comp_tr, "FW config set force dmi l0 state");
intel_adsp_force_dmi_l0_state();
} else {
tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state");
intel_adsp_allow_dmi_l1_state();
}
return 0;
#else
return IPC4_UNAVAILABLE;
#endif
}
static int basefw_set_fw_config(bool first_block,
bool last_block,
uint32_t data_offset,
const char *data)
{
const struct sof_tlv *tlv = (const struct sof_tlv *)data;
switch (tlv->type) {
case IPC4_DMI_FORCE_L1_EXIT:
return fw_config_set_force_l1_exit(tlv);
default:
break;
}
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
return 0;
}
int platform_basefw_set_large_config(struct comp_dev *dev,
uint32_t param_id,
bool first_block,
@ -75,5 +120,12 @@ int platform_basefw_set_large_config(struct comp_dev *dev,
uint32_t data_offset,
const char *data)
{
switch (param_id) {
case IPC4_FW_CONFIG:
return basefw_set_fw_config(first_block, last_block, data_offset, data);
default:
break;
}
return IPC4_UNKNOWN_MESSAGE_TYPE;
}