|
22 | 22 | /* TODO: Remove platform-specific code, see https://github.com/thesofproject/sof/issues/7549 */ |
23 | 23 | #if defined(CONFIG_SOC_SERIES_INTEL_ACE) || defined(CONFIG_INTEL_ADSP_CAVS) |
24 | 24 | # define INTEL_ADSP 1 |
| 25 | +#include <intel_adsp_hda.h> |
25 | 26 | #endif |
26 | 27 |
|
27 | 28 | 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) |
391 | 392 | return 0; |
392 | 393 | } |
393 | 394 |
|
| 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 | + |
394 | 431 | static int basefw_get_large_config(struct comp_dev *dev, |
395 | 432 | uint32_t param_id, |
396 | 433 | bool first_block, |
@@ -457,8 +494,7 @@ static int basefw_set_large_config(struct comp_dev *dev, |
457 | 494 | { |
458 | 495 | switch (param_id) { |
459 | 496 | 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); |
462 | 498 | case IPC4_SYSTEM_TIME: |
463 | 499 | return basefw_set_system_time(param_id, first_block, |
464 | 500 | last_block, data_offset, data); |
|
0 commit comments