Skip to content

Commit 8bebf86

Browse files
committed
ASoC: SOF: ipc4/ipc4-loader: Add SOF_CODEC_INFO (id = 35) to fw_config_params
SOF_CODEC_INFO tuple holds information about the supported codecs for decode/encode. If present in the fw_config payload, make a copy of it and store it sof_ipc4_fw_data->codec_info to be used by the compressed code. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent e59d3b2 commit 8bebf86

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

include/sound/sof/ipc4/header.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,10 @@ enum sof_ipc4_fw_config_params {
433433
SOF_IPC4_FW_CFG_RESERVED,
434434
SOF_IPC4_FW_CFG_POWER_GATING_POLICY,
435435
SOF_IPC4_FW_CFG_ASSERT_MODE,
436-
SOF_IPC4_FW_RESERVED1,
437-
SOF_IPC4_FW_RESERVED2,
438-
SOF_IPC4_FW_RESERVED3,
439-
SOF_IPC4_FW_RESERVED4,
440-
SOF_IPC4_FW_RESERVED5,
441-
SOF_IPC4_FW_CONTEXT_SAVE
436+
/* Reserved: 24 - 28 */
437+
SOF_IPC4_FW_CONTEXT_SAVE = 29,
438+
/* Reserved: 30 - 34 */
439+
SOF_IPC4_FW_CFG_SOF_CODEC_INFO = 35,
442440
};
443441

444442
struct sof_ipc4_fw_version {

sound/soc/sof/ipc4-loader.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,14 @@ int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev)
492492
*/
493493
ipc4_data->libraries_restored = ipc4_data->fw_context_save;
494494
break;
495+
case SOF_IPC4_FW_CFG_SOF_CODEC_INFO:
496+
ipc4_data->codec_info = devm_kmemdup(sdev->dev, tuple->value,
497+
tuple->size, GFP_KERNEL);
498+
if (!ipc4_data->codec_info) {
499+
ret = -ENOMEM;
500+
goto out;
501+
}
502+
break;
495503
default:
496504
break;
497505
}

sound/soc/sof/ipc4-priv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ struct sof_ipc4_fw_library {
7575
* @fw_context_save: Firmware supports full context save and restore
7676
* @libraries_restored: The libraries have been retained during firmware boot
7777
*
78+
* @codec_info: Information about the available codecs in booted firmware. The
79+
* data is to be used by the code for compressed support.
7880
* @load_library: Callback function for platform dependent library loading
7981
* @pipeline_state_mutex: Mutex to protect pipeline triggers, ref counts, states and deletion
8082
*/
@@ -91,6 +93,8 @@ struct sof_ipc4_fw_data {
9193
bool fw_context_save;
9294
bool libraries_restored;
9395

96+
void *codec_info;
97+
9498
int (*load_library)(struct snd_sof_dev *sdev,
9599
struct sof_ipc4_fw_library *fw_lib, bool reload);
96100
void (*intel_configure_mic_privacy)(struct snd_sof_dev *sdev,

0 commit comments

Comments
 (0)