#include <linux/firmware.h>
#include <sound/sof/header.h>
#include <sound/sof/ipc4/header.h>
#include "sof-priv.h"
#include "sof-audio.h"
#include "ipc4-fw-reg.h"
#include "ipc4-priv.h"
#include "ipc4-telemetry.h"
#include "ops.h"
static const struct sof_ipc4_fw_status { … } ipc4_status[] = …;
ipc4_notification_handler;
static int sof_ipc4_check_reply_status(struct snd_sof_dev *sdev, u32 status)
{ … }
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_VERBOSE_IPC)
#define DBG_IPC4_MSG_TYPE_ENTRY(type) …
static const char * const ipc4_dbg_mod_msg_type[] = …;
static const char * const ipc4_dbg_glb_msg_type[] = …;
#define DBG_IPC4_NOTIFICATION_TYPE_ENTRY(type) …
static const char * const ipc4_dbg_notification_type[] = …;
static void sof_ipc4_log_header(struct device *dev, u8 *text, struct sof_ipc4_msg *msg,
bool data_size_valid)
{ … }
#else
static void sof_ipc4_log_header(struct device *dev, u8 *text, struct sof_ipc4_msg *msg,
bool data_size_valid)
{
if (!sof_debug_check_flag(SOF_DBG_PRINT_DMA_POSITION_UPDATE_LOGS) &&
!SOF_IPC4_MSG_IS_MODULE_MSG(msg->primary) &&
SOF_IPC4_MSG_TYPE_GET(msg->primary) == SOF_IPC4_GLB_NOTIFICATION &&
SOF_IPC4_NOTIFICATION_TYPE_GET(msg->primary) == SOF_IPC4_NOTIFY_LOG_BUFFER_STATUS)
return;
if (data_size_valid && msg->data_size)
dev_dbg(dev, "%s: %#x|%#x [data size: %zu]\n", text,
msg->primary, msg->extension, msg->data_size);
else
dev_dbg(dev, "%s: %#x|%#x\n", text, msg->primary, msg->extension);
}
#endif
static void sof_ipc4_dump_payload(struct snd_sof_dev *sdev,
void *ipc_data, size_t size)
{ … }
static int sof_ipc4_get_reply(struct snd_sof_dev *sdev)
{ … }
static int ipc4_wait_tx_done(struct snd_sof_ipc *ipc, void *reply_data)
{ … }
static int ipc4_tx_msg_unlocked(struct snd_sof_ipc *ipc,
void *msg_data, size_t msg_bytes,
void *reply_data, size_t reply_bytes)
{ … }
static int sof_ipc4_tx_msg(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes,
void *reply_data, size_t reply_bytes, bool no_pm)
{ … }
static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
size_t payload_bytes, bool set)
{ … }
static int sof_ipc4_init_msg_memory(struct snd_sof_dev *sdev)
{ … }
size_t sof_ipc4_find_debug_slot_offset_by_type(struct snd_sof_dev *sdev,
u32 slot_type)
{ … }
EXPORT_SYMBOL(…);
static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg)
{ … }
static void sof_ipc4_module_notification_handler(struct snd_sof_dev *sdev,
struct sof_ipc4_msg *ipc4_msg)
{ … }
static void sof_ipc4_rx_msg(struct snd_sof_dev *sdev)
{ … }
static int sof_ipc4_set_core_state(struct snd_sof_dev *sdev, int core_idx, bool on)
{ … }
static int sof_ipc4_ctx_save(struct snd_sof_dev *sdev)
{ … }
static int sof_ipc4_set_pm_gate(struct snd_sof_dev *sdev, u32 flags)
{ … }
static const struct sof_ipc_pm_ops ipc4_pm_ops = …;
static int sof_ipc4_init(struct snd_sof_dev *sdev)
{ … }
static void sof_ipc4_exit(struct snd_sof_dev *sdev)
{ … }
static int sof_ipc4_post_boot(struct snd_sof_dev *sdev)
{ … }
const struct sof_ipc_ops ipc4_ops = …;