#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/soc/qcom/apr.h>
#include <sound/soc.h>
#include <sound/soc-dai.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <dt-bindings/soc/qcom,gpr.h>
#include "q6apm.h"
#include "audioreach.h"
struct apm_sub_graph_data { … } __packed;
#define APM_SUB_GRAPH_CFG_NPROP …
struct apm_sub_graph_params { … } __packed;
#define APM_SUB_GRAPH_PSIZE(p, n) …
struct apm_container_obj { … } __packed;
struct apm_container_params { … } __packed;
#define APM_CONTAINER_PSIZE(p, n) …
struct apm_mod_list_obj { … } __packed;
#define APM_MOD_LIST_OBJ_PSIZE(p, n) …
struct apm_module_list_params { … } __packed;
struct apm_mod_prop_obj { … } __packed;
struct apm_prop_list_params { … } __packed;
#define APM_MOD_PROP_PSIZE(p, n) …
struct apm_mod_conn_list_params { … } __packed;
#define APM_MOD_CONN_PSIZE(p, n) …
struct apm_graph_open_params { … } __packed;
struct apm_pcm_module_media_fmt_cmd { … } __packed;
struct apm_rd_shmem_module_config_cmd { … } __packed;
struct apm_sh_module_media_fmt_cmd { … } __packed;
#define APM_SHMEM_FMT_CFG_PSIZE(ch) …
#define APM_PCM_MODULE_FMT_CMD_PSIZE(ch) …
#define APM_PCM_OUT_FMT_CFG_PSIZE(p, n) …
struct apm_i2s_module_intf_cfg { … } __packed;
#define APM_I2S_INTF_CFG_PSIZE …
struct apm_module_hw_ep_mf_cfg { … } __packed;
#define APM_HW_EP_CFG_PSIZE …
#define APM_MFC_CFG_PSIZE(p, n) …
struct apm_module_frame_size_factor_cfg { … } __packed;
#define APM_FS_CFG_PSIZE …
struct apm_module_hw_ep_power_mode_cfg { … } __packed;
#define APM_HW_EP_PMODE_CFG_PSIZE …
struct apm_module_hw_ep_dma_data_align_cfg { … } __packed;
#define APM_HW_EP_DALIGN_CFG_PSIZE …
struct apm_gain_module_cfg { … } __packed;
#define APM_GAIN_CFG_PSIZE …
struct apm_codec_dma_module_intf_cfg { … } __packed;
#define APM_CDMA_INTF_CFG_PSIZE …
struct apm_display_port_module_intf_cfg { … } __packed;
#define APM_DP_INTF_CFG_PSIZE …
static void *__audioreach_alloc_pkt(int payload_size, uint32_t opcode, uint32_t token,
uint32_t src_port, uint32_t dest_port, bool has_cmd_hdr)
{ … }
void *audioreach_alloc_pkt(int payload_size, uint32_t opcode, uint32_t token,
uint32_t src_port, uint32_t dest_port)
{ … }
EXPORT_SYMBOL_GPL(…);
void *audioreach_alloc_apm_pkt(int pkt_size, uint32_t opcode, uint32_t token, uint32_t src_port)
{ … }
EXPORT_SYMBOL_GPL(…);
void *audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, uint32_t token,
uint32_t src_port, uint32_t dest_port)
{ … }
EXPORT_SYMBOL_GPL(…);
void *audioreach_alloc_apm_cmd_pkt(int pkt_size, uint32_t opcode, uint32_t token)
{ … }
EXPORT_SYMBOL_GPL(…);
void audioreach_set_default_channel_mapping(u8 *ch_map, int num_channels)
{ … }
EXPORT_SYMBOL_GPL(…);
static void apm_populate_container_config(struct apm_container_obj *cfg,
struct audioreach_container *cont)
{ … }
static void apm_populate_sub_graph_config(struct apm_sub_graph_data *cfg,
struct audioreach_sub_graph *sg)
{ … }
static void apm_populate_module_prop_obj(struct apm_mod_prop_obj *obj,
struct audioreach_module *module)
{ … }
static void apm_populate_module_list_obj(struct apm_mod_list_obj *obj,
struct audioreach_container *container,
int sub_graph_id)
{ … }
static void audioreach_populate_graph(struct q6apm *apm, struct audioreach_graph_info *info,
struct apm_graph_open_params *open,
struct list_head *sg_list,
int num_sub_graphs)
{ … }
void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info *info)
{ … }
EXPORT_SYMBOL_GPL(…);
int audioreach_send_cmd_sync(struct device *dev, gpr_device_t *gdev,
struct gpr_ibasic_rsp_result_t *result, struct mutex *cmd_lock,
gpr_port_t *port, wait_queue_head_t *cmd_wait,
struct gpr_pkt *pkt, uint32_t rsp_opcode)
{ … }
EXPORT_SYMBOL_GPL(…);
int audioreach_graph_send_cmd_sync(struct q6apm_graph *graph, struct gpr_pkt *pkt,
uint32_t rsp_opcode)
{ … }
EXPORT_SYMBOL_GPL(…);
static int audioreach_display_port_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *cfg)
{ … }
static int audioreach_codec_dma_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *cfg)
{ … }
int audioreach_send_u32_param(struct q6apm_graph *graph, struct audioreach_module *module,
uint32_t param_id, uint32_t param_val)
{ … }
EXPORT_SYMBOL_GPL(…);
static int audioreach_sal_limiter_enable(struct q6apm_graph *graph,
struct audioreach_module *module, bool enable)
{ … }
static int audioreach_sal_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *cfg)
{ … }
static int audioreach_module_enable(struct q6apm_graph *graph,
struct audioreach_module *module,
bool enable)
{ … }
static int audioreach_gapless_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *cfg)
{ … }
static int audioreach_mfc_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *cfg)
{ … }
static int audioreach_set_compr_media_format(struct media_format *media_fmt_hdr,
void *p, struct audioreach_module_config *mcfg)
{ … }
int audioreach_compr_set_param(struct q6apm_graph *graph, struct audioreach_module_config *mcfg)
{ … }
EXPORT_SYMBOL_GPL(…);
static int audioreach_i2s_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *cfg)
{ … }
static int audioreach_logging_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module)
{ … }
static int audioreach_pcm_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *mcfg)
{ … }
static int audioreach_shmem_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *mcfg)
{ … }
int audioreach_gain_set_vol_ctrl(struct q6apm *apm, struct audioreach_module *module, int vol)
{ … }
EXPORT_SYMBOL_GPL(…);
static int audioreach_gain_set(struct q6apm_graph *graph, struct audioreach_module *module)
{ … }
int audioreach_set_media_format(struct q6apm_graph *graph, struct audioreach_module *module,
struct audioreach_module_config *cfg)
{ … }
EXPORT_SYMBOL_GPL(…);
void audioreach_graph_free_buf(struct q6apm_graph *graph)
{ … }
EXPORT_SYMBOL_GPL(…);
int audioreach_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, size_t period_sz,
unsigned int periods, bool is_contiguous)
{ … }
EXPORT_SYMBOL_GPL(…);
int audioreach_shared_memory_send_eos(struct q6apm_graph *graph)
{ … }
EXPORT_SYMBOL_GPL(…);