#ifndef __SOUND_SOC_SOF_PRIV_H
#define __SOUND_SOC_SOF_PRIV_H
#include <linux/device.h>
#include <sound/hdaudio.h>
#include <sound/sof.h>
#include <sound/sof/info.h>
#include <sound/sof/pm.h>
#include <sound/sof/trace.h>
#include <uapi/sound/sof/fw.h>
#include <sound/sof/ext_manifest.h>
struct snd_sof_pcm_stream;
#define SOF_DBG_ENABLE_TRACE …
#define SOF_DBG_RETAIN_CTX …
#define SOF_DBG_VERIFY_TPLG …
#define SOF_DBG_DYNAMIC_PIPELINES_OVERRIDE …
#define SOF_DBG_DYNAMIC_PIPELINES_ENABLE …
#define SOF_DBG_DISABLE_MULTICORE …
#define SOF_DBG_PRINT_ALL_DUMPS …
#define SOF_DBG_IGNORE_D3_PERSISTENT …
#define SOF_DBG_PRINT_DMA_POSITION_UPDATE_LOGS …
#define SOF_DBG_PRINT_IPC_SUCCESS_LOGS …
#define SOF_DBG_FORCE_NOCODEC …
#define SOF_DBG_DUMP_IPC_MESSAGE_PAYLOAD …
#define SOF_DBG_DSPLESS_MODE …
#define SOF_DBG_DUMP_REGS …
#define SOF_DBG_DUMP_MBOX …
#define SOF_DBG_DUMP_TEXT …
#define SOF_DBG_DUMP_PCI …
#define SOF_DBG_DUMP_OPTIONAL …
bool sof_debug_check_flag(int mask);
#define SND_SOF_BARS …
#define SND_SOF_SUSPEND_DELAY_MS …
#define DMA_BUF_SIZE_FOR_TRACE …
#define SOF_IPC_DSP_REPLY …
#define SOF_IPC_HOST_REPLY …
#define SOF_DAI_STREAM(sname, scmin, scmax, srates, sfmt) …
#define SOF_FORMATS …
#define SOF_DSP_PRIMARY_CORE …
#define SOF_MAX_DSP_NUM_CORES …
struct sof_dsp_power_state { … };
enum sof_system_suspend_state { … };
enum sof_dfsentry_type { … };
enum sof_debugfs_access_type { … };
struct sof_compr_stream { … };
struct snd_sof_dev;
struct snd_sof_ipc_msg;
struct snd_sof_ipc;
struct snd_sof_debugfs_map;
struct snd_soc_tplg_ops;
struct snd_soc_component;
struct snd_sof_pdata;
struct snd_sof_platform_stream_params { … };
struct sof_firmware { … };
enum sof_dai_access { … };
struct snd_sof_dsp_ops { … };
struct dsp_arch_ops { … };
#define sof_dsp_arch_ops(sdev) …
struct snd_sof_dfsentry { … };
struct snd_sof_debugfs_map { … };
struct snd_sof_mailbox { … };
struct snd_sof_ipc_msg { … };
struct sof_ipc_fw_tracing_ops { … };
struct sof_ipc_pm_ops { … };
struct sof_ipc_fw_loader_ops { … };
struct sof_ipc_tplg_ops;
struct sof_ipc_pcm_ops;
struct sof_ipc_ops { … };
struct snd_sof_ipc { … };
#define sof_ipc_get_ops(sdev, ops_name) …
struct snd_sof_dev { … };
int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data);
int snd_sof_device_remove(struct device *dev);
int snd_sof_device_shutdown(struct device *dev);
bool snd_sof_device_probe_completed(struct device *dev);
int snd_sof_runtime_suspend(struct device *dev);
int snd_sof_runtime_resume(struct device *dev);
int snd_sof_runtime_idle(struct device *dev);
int snd_sof_resume(struct device *dev);
int snd_sof_suspend(struct device *dev);
int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev);
int snd_sof_prepare(struct device *dev);
void snd_sof_complete(struct device *dev);
void snd_sof_new_platform_drv(struct snd_sof_dev *sdev);
extern struct snd_compress_ops sof_compressed_ops;
int sof_create_ipc_file_profile(struct snd_sof_dev *sdev,
struct sof_loadable_file_profile *base_profile,
struct sof_loadable_file_profile *out_profile);
int snd_sof_load_firmware_raw(struct snd_sof_dev *sdev);
int snd_sof_load_firmware_memcpy(struct snd_sof_dev *sdev);
int snd_sof_run_firmware(struct snd_sof_dev *sdev);
void snd_sof_fw_unload(struct snd_sof_dev *sdev);
struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev);
void snd_sof_ipc_free(struct snd_sof_dev *sdev);
void snd_sof_ipc_get_reply(struct snd_sof_dev *sdev);
void snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id);
static inline void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev)
{ … }
int sof_ipc_tx_message(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes,
void *reply_data, size_t reply_bytes);
static inline int sof_ipc_tx_message_no_reply(struct snd_sof_ipc *ipc, void *msg_data,
size_t msg_bytes)
{ … }
int sof_ipc_set_get_data(struct snd_sof_ipc *ipc, void *msg_data,
size_t msg_bytes, bool set);
int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes,
void *reply_data, size_t reply_bytes);
static inline int sof_ipc_tx_message_no_pm_no_reply(struct snd_sof_ipc *ipc, void *msg_data,
size_t msg_bytes)
{ … }
int sof_ipc_send_msg(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes,
size_t reply_bytes);
static inline void snd_sof_ipc_process_reply(struct snd_sof_dev *sdev, u32 msg_id)
{ … }
int snd_sof_dbg_init(struct snd_sof_dev *sdev);
void snd_sof_free_debug(struct snd_sof_dev *sdev);
int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev,
void *base, size_t size,
const char *name, mode_t mode);
void sof_print_oops_and_stack(struct snd_sof_dev *sdev, const char *level,
u32 panic_code, u32 tracep_code, void *oops,
struct sof_ipc_panic_info *panic_info,
void *stack, size_t stack_words);
void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev, const char *msg);
int snd_sof_dbg_memory_info_init(struct snd_sof_dev *sdev);
int snd_sof_debugfs_add_region_item_iomem(struct snd_sof_dev *sdev,
enum snd_sof_fw_blk_type blk_type, u32 offset, size_t size,
const char *name, enum sof_debugfs_access_type access_type);
int sof_fw_trace_init(struct snd_sof_dev *sdev);
void sof_fw_trace_free(struct snd_sof_dev *sdev);
void sof_fw_trace_fw_crashed(struct snd_sof_dev *sdev);
void sof_fw_trace_suspend(struct snd_sof_dev *sdev, pm_message_t pm_state);
int sof_fw_trace_resume(struct snd_sof_dev *sdev);
static inline void sof_stack(struct snd_sof_dev *sdev, const char *level,
void *oops, u32 *stack, u32 stack_words)
{ … }
static inline void sof_oops(struct snd_sof_dev *sdev, const char *level, void *oops)
{ … }
extern const struct dsp_arch_ops sof_xtensa_arch_ops;
void sof_set_fw_state(struct snd_sof_dev *sdev, enum sof_fw_state new_state);
void sof_io_write(struct snd_sof_dev *sdev, void __iomem *addr, u32 value);
void sof_io_write64(struct snd_sof_dev *sdev, void __iomem *addr, u64 value);
u32 sof_io_read(struct snd_sof_dev *sdev, void __iomem *addr);
u64 sof_io_read64(struct snd_sof_dev *sdev, void __iomem *addr);
void sof_mailbox_write(struct snd_sof_dev *sdev, u32 offset,
void *message, size_t bytes);
void sof_mailbox_read(struct snd_sof_dev *sdev, u32 offset,
void *message, size_t bytes);
int sof_block_write(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_type,
u32 offset, void *src, size_t size);
int sof_block_read(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_type,
u32 offset, void *dest, size_t size);
int sof_ipc_msg_data(struct snd_sof_dev *sdev,
struct snd_sof_pcm_stream *sps,
void *p, size_t sz);
int sof_set_stream_data_offset(struct snd_sof_dev *sdev,
struct snd_sof_pcm_stream *sps,
size_t posn_offset);
int sof_stream_pcm_open(struct snd_sof_dev *sdev,
struct snd_pcm_substream *substream);
int sof_stream_pcm_close(struct snd_sof_dev *sdev,
struct snd_pcm_substream *substream);
#if IS_ENABLED(CONFIG_SND_SOC_SOF_CLIENT)
int sof_client_dev_register(struct snd_sof_dev *sdev, const char *name, u32 id,
const void *data, size_t size);
void sof_client_dev_unregister(struct snd_sof_dev *sdev, const char *name, u32 id);
int sof_register_clients(struct snd_sof_dev *sdev);
void sof_unregister_clients(struct snd_sof_dev *sdev);
void sof_client_ipc_rx_dispatcher(struct snd_sof_dev *sdev, void *msg_buf);
void sof_client_fw_state_dispatcher(struct snd_sof_dev *sdev);
int sof_suspend_clients(struct snd_sof_dev *sdev, pm_message_t state);
int sof_resume_clients(struct snd_sof_dev *sdev);
#else
static inline int sof_client_dev_register(struct snd_sof_dev *sdev, const char *name,
u32 id, const void *data, size_t size)
{
return 0;
}
static inline void sof_client_dev_unregister(struct snd_sof_dev *sdev,
const char *name, u32 id)
{
}
static inline int sof_register_clients(struct snd_sof_dev *sdev)
{
return 0;
}
static inline void sof_unregister_clients(struct snd_sof_dev *sdev)
{
}
static inline void sof_client_ipc_rx_dispatcher(struct snd_sof_dev *sdev, void *msg_buf)
{
}
static inline void sof_client_fw_state_dispatcher(struct snd_sof_dev *sdev)
{
}
static inline int sof_suspend_clients(struct snd_sof_dev *sdev, pm_message_t state)
{
return 0;
}
static inline int sof_resume_clients(struct snd_sof_dev *sdev)
{
return 0;
}
#endif
extern const struct sof_ipc_ops ipc3_ops;
extern const struct sof_ipc_ops ipc4_ops;
#endif