// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)//// This file is provided under a dual BSD/GPLv2 license. When using or// redistributing this file, you may do so under either license.//// Copyright(c) 2021 Intel Corporation////#include<sound/sof/stream.h>#include<sound/sof/control.h>#include<trace/events/sof.h>#include"sof-priv.h"#include"sof-audio.h"#include"ipc3-priv.h"#include"ops.h"typedefvoid(*ipc3_rx_callback)(structsnd_sof_dev*sdev,void*msg_buf);#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_VERBOSE_IPC)staticvoidipc3_log_header(structdevice*dev,u8*text,u32cmd){u8*str;u8*str2=NULL;u32glb;u32type;boolis_sof_ipc_stream_position=false;glb=cmd&SOF_GLB_TYPE_MASK;type=cmd&SOF_CMD_TYPE_MASK;switch(glb){caseSOF_IPC_GLB_REPLY:str="GLB_REPLY";break;caseSOF_IPC_GLB_COMPOUND:str="GLB_COMPOUND";break;caseSOF_IPC_GLB_TPLG_MSG:str="GLB_TPLG_MSG";switch(type){caseSOF_IPC_TPLG_COMP_NEW:str2="COMP_NEW";break;caseSOF_IPC_TPLG_COMP_FREE:str2="COMP_FREE";break;caseSOF_IPC_TPLG_COMP_CONNECT:str2="COMP_CONNECT";break;caseSOF_IPC_TPLG_PIPE_NEW:str2="PIPE_NEW";break;caseSOF_IPC_TPLG_PIPE_FREE:str2="PIPE_FREE";break;caseSOF_IPC_TPLG_PIPE_CONNECT:str2="PIPE_CONNECT";break;caseSOF_IPC_TPLG_PIPE_COMPLETE:str2="PIPE_COMPLETE";break;caseSOF_IPC_TPLG_BUFFER_NEW:str2="BUFFER_NEW";break;caseSOF_IPC_TPLG_BUFFER_FREE:str2="BUFFER_FREE";break;default:str2="unknown type";break;}break;caseSOF_IPC_GLB_PM_MSG:str="GLB_PM_MSG";switch(type){caseSOF_IPC_PM_CTX_SAVE:str2="CTX_SAVE";break;caseSOF_IPC_PM_CTX_RESTORE:str2="CTX_RESTORE";break;caseSOF_IPC_PM_CTX_SIZE:str2="CTX_SIZE";break;caseSOF_IPC_PM_CLK_SET:str2="CLK_SET";break;caseSOF_IPC_PM_CLK_GET:str2="CLK_GET";break;caseSOF_IPC_PM_CLK_REQ:str2="CLK_REQ";break;caseSOF_IPC_PM_CORE_ENABLE:str2="CORE_ENABLE";break;caseSOF_IPC_PM_GATE:str2="GATE";break;default:str2="unknown type";break;}break;caseSOF_IPC_GLB_COMP_MSG:str="GLB_COMP_MSG";switch(type){caseSOF_IPC_COMP_SET_VALUE:str2="SET_VALUE";break;caseSOF_IPC_COMP_GET_VALUE:str2="GET_VALUE";break;caseSOF_IPC_COMP_SET_DATA:str2="SET_DATA";break;caseSOF_IPC_COMP_GET_DATA:str2="GET_DATA";break