mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
ASoC: qcom: Constify few things in audioreach and
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>: Several functions do not modify the pointed memory they receive, so marking them as pointers to const would serve as self-explanatory code. Also safer a bit.
This commit is contained in:
commit
9b7688c19c
|
|
@ -309,7 +309,7 @@ void audioreach_set_default_channel_mapping(u8 *ch_map, int num_channels)
|
|||
EXPORT_SYMBOL_GPL(audioreach_set_default_channel_mapping);
|
||||
|
||||
static void apm_populate_container_config(struct apm_container_obj *cfg,
|
||||
struct audioreach_container *cont)
|
||||
const struct audioreach_container *cont)
|
||||
{
|
||||
|
||||
/* Container Config */
|
||||
|
|
@ -339,7 +339,7 @@ static void apm_populate_container_config(struct apm_container_obj *cfg,
|
|||
}
|
||||
|
||||
static void apm_populate_sub_graph_config(struct apm_sub_graph_data *cfg,
|
||||
struct audioreach_sub_graph *sg)
|
||||
const struct audioreach_sub_graph *sg)
|
||||
{
|
||||
cfg->sub_graph_cfg.sub_graph_id = sg->sub_graph_id;
|
||||
cfg->sub_graph_cfg.num_sub_graph_prop = APM_SUB_GRAPH_CFG_NPROP;
|
||||
|
|
@ -361,7 +361,7 @@ static void apm_populate_sub_graph_config(struct apm_sub_graph_data *cfg,
|
|||
}
|
||||
|
||||
static void apm_populate_module_prop_obj(struct apm_mod_prop_obj *obj,
|
||||
struct audioreach_module *module)
|
||||
const struct audioreach_module *module)
|
||||
{
|
||||
|
||||
obj->instance_id = module->instance_id;
|
||||
|
|
@ -373,7 +373,7 @@ static void apm_populate_module_prop_obj(struct apm_mod_prop_obj *obj,
|
|||
}
|
||||
|
||||
static void apm_populate_module_list_obj(struct apm_mod_list_obj *obj,
|
||||
struct audioreach_container *container,
|
||||
const struct audioreach_container *container,
|
||||
int sub_graph_id)
|
||||
{
|
||||
struct audioreach_module *module;
|
||||
|
|
@ -390,9 +390,10 @@ static void apm_populate_module_list_obj(struct apm_mod_list_obj *obj,
|
|||
}
|
||||
}
|
||||
|
||||
static void audioreach_populate_graph(struct q6apm *apm, struct audioreach_graph_info *info,
|
||||
static void audioreach_populate_graph(struct q6apm *apm,
|
||||
const struct audioreach_graph_info *info,
|
||||
struct apm_graph_open_params *open,
|
||||
struct list_head *sg_list,
|
||||
const struct list_head *sg_list,
|
||||
int num_sub_graphs)
|
||||
{
|
||||
struct apm_mod_conn_list_params *mc_data = open->mod_conn_list_data;
|
||||
|
|
@ -464,7 +465,8 @@ static void audioreach_populate_graph(struct q6apm *apm, struct audioreach_graph
|
|||
}
|
||||
}
|
||||
|
||||
void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info *info)
|
||||
void *audioreach_alloc_graph_pkt(struct q6apm *apm,
|
||||
const struct audioreach_graph_info *info)
|
||||
{
|
||||
int payload_size, sg_sz, cont_sz, ml_sz, mp_sz, mc_sz;
|
||||
struct apm_module_param_data *param_data;
|
||||
|
|
@ -477,7 +479,7 @@ void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info
|
|||
struct audioreach_module *module;
|
||||
struct audioreach_sub_graph *sgs;
|
||||
struct apm_mod_list_obj *mlobj;
|
||||
struct list_head *sg_list;
|
||||
const struct list_head *sg_list;
|
||||
int num_connections = 0;
|
||||
int num_containers = 0;
|
||||
int num_sub_graphs = 0;
|
||||
|
|
@ -630,8 +632,8 @@ int audioreach_graph_send_cmd_sync(struct q6apm_graph *graph, struct gpr_pkt *pk
|
|||
EXPORT_SYMBOL_GPL(audioreach_graph_send_cmd_sync);
|
||||
|
||||
static int audioreach_display_port_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg)
|
||||
{
|
||||
struct apm_display_port_module_intf_cfg *intf_cfg;
|
||||
struct apm_module_frame_size_factor_cfg *fs_cfg;
|
||||
|
|
@ -687,8 +689,8 @@ static int audioreach_display_port_set_media_format(struct q6apm_graph *graph,
|
|||
|
||||
/* LPASS Codec DMA port Module Media Format Setup */
|
||||
static int audioreach_codec_dma_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg)
|
||||
{
|
||||
struct apm_codec_dma_module_intf_cfg *intf_cfg;
|
||||
struct apm_module_frame_size_factor_cfg *fs_cfg;
|
||||
|
|
@ -753,7 +755,8 @@ static int audioreach_codec_dma_set_media_format(struct q6apm_graph *graph,
|
|||
return q6apm_send_cmd_sync(graph->apm, pkt, 0);
|
||||
}
|
||||
|
||||
int audioreach_send_u32_param(struct q6apm_graph *graph, struct audioreach_module *module,
|
||||
int audioreach_send_u32_param(struct q6apm_graph *graph,
|
||||
const struct audioreach_module *module,
|
||||
uint32_t param_id, uint32_t param_val)
|
||||
{
|
||||
struct apm_module_param_data *param_data;
|
||||
|
|
@ -782,36 +785,37 @@ int audioreach_send_u32_param(struct q6apm_graph *graph, struct audioreach_modul
|
|||
EXPORT_SYMBOL_GPL(audioreach_send_u32_param);
|
||||
|
||||
static int audioreach_sal_limiter_enable(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module, bool enable)
|
||||
const struct audioreach_module *module,
|
||||
bool enable)
|
||||
{
|
||||
return audioreach_send_u32_param(graph, module, PARAM_ID_SAL_LIMITER_ENABLE, enable);
|
||||
}
|
||||
|
||||
static int audioreach_sal_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg)
|
||||
{
|
||||
return audioreach_send_u32_param(graph, module, PARAM_ID_SAL_OUTPUT_CFG, cfg->bit_width);
|
||||
}
|
||||
|
||||
static int audioreach_module_enable(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
const struct audioreach_module *module,
|
||||
bool enable)
|
||||
{
|
||||
return audioreach_send_u32_param(graph, module, PARAM_ID_MODULE_ENABLE, enable);
|
||||
}
|
||||
|
||||
static int audioreach_gapless_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg)
|
||||
{
|
||||
return audioreach_send_u32_param(graph, module, PARAM_ID_EARLY_EOS_DELAY,
|
||||
EARLY_EOS_DELAY_MS);
|
||||
}
|
||||
|
||||
static int audioreach_set_module_config(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg)
|
||||
{
|
||||
int size = le32_to_cpu(module->data->size);
|
||||
void *p;
|
||||
|
|
@ -828,8 +832,8 @@ static int audioreach_set_module_config(struct q6apm_graph *graph,
|
|||
}
|
||||
|
||||
static int audioreach_mfc_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg)
|
||||
{
|
||||
struct apm_module_param_data *param_data;
|
||||
struct param_id_mfc_media_format *media_format;
|
||||
|
|
@ -863,7 +867,8 @@ static int audioreach_mfc_set_media_format(struct q6apm_graph *graph,
|
|||
}
|
||||
|
||||
static int audioreach_set_compr_media_format(struct media_format *media_fmt_hdr,
|
||||
void *p, struct audioreach_module_config *mcfg)
|
||||
void *p,
|
||||
const struct audioreach_module_config *mcfg)
|
||||
{
|
||||
struct payload_media_fmt_aac_t *aac_cfg;
|
||||
struct payload_media_fmt_pcm *mp3_cfg;
|
||||
|
|
@ -944,7 +949,8 @@ static int audioreach_set_compr_media_format(struct media_format *media_fmt_hdr,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int audioreach_compr_set_param(struct q6apm_graph *graph, struct audioreach_module_config *mcfg)
|
||||
int audioreach_compr_set_param(struct q6apm_graph *graph,
|
||||
const struct audioreach_module_config *mcfg)
|
||||
{
|
||||
struct media_format *header;
|
||||
int rc;
|
||||
|
|
@ -969,8 +975,8 @@ int audioreach_compr_set_param(struct q6apm_graph *graph, struct audioreach_modu
|
|||
EXPORT_SYMBOL_GPL(audioreach_compr_set_param);
|
||||
|
||||
static int audioreach_i2s_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg)
|
||||
{
|
||||
struct apm_module_frame_size_factor_cfg *fs_cfg;
|
||||
struct apm_module_param_data *param_data;
|
||||
|
|
@ -1037,7 +1043,7 @@ static int audioreach_i2s_set_media_format(struct q6apm_graph *graph,
|
|||
}
|
||||
|
||||
static int audioreach_logging_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module)
|
||||
const struct audioreach_module *module)
|
||||
{
|
||||
struct apm_module_param_data *param_data;
|
||||
struct data_logging_config *cfg;
|
||||
|
|
@ -1066,8 +1072,8 @@ static int audioreach_logging_set_media_format(struct q6apm_graph *graph,
|
|||
}
|
||||
|
||||
static int audioreach_pcm_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *mcfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *mcfg)
|
||||
{
|
||||
struct payload_pcm_output_format_cfg *media_cfg;
|
||||
uint32_t num_channels = mcfg->num_channels;
|
||||
|
|
@ -1113,8 +1119,8 @@ static int audioreach_pcm_set_media_format(struct q6apm_graph *graph,
|
|||
}
|
||||
|
||||
static int audioreach_shmem_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *mcfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *mcfg)
|
||||
{
|
||||
uint32_t num_channels = mcfg->num_channels;
|
||||
struct apm_module_param_data *param_data;
|
||||
|
|
@ -1170,7 +1176,8 @@ static int audioreach_shmem_set_media_format(struct q6apm_graph *graph,
|
|||
return audioreach_graph_send_cmd_sync(graph, pkt, 0);
|
||||
}
|
||||
|
||||
int audioreach_gain_set_vol_ctrl(struct q6apm *apm, struct audioreach_module *module, int vol)
|
||||
int audioreach_gain_set_vol_ctrl(struct q6apm *apm,
|
||||
const struct audioreach_module *module, int vol)
|
||||
{
|
||||
struct param_id_vol_ctrl_master_gain *cfg;
|
||||
struct apm_module_param_data *param_data;
|
||||
|
|
@ -1195,7 +1202,8 @@ int audioreach_gain_set_vol_ctrl(struct q6apm *apm, struct audioreach_module *mo
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(audioreach_gain_set_vol_ctrl);
|
||||
|
||||
static int audioreach_gain_set(struct q6apm_graph *graph, struct audioreach_module *module)
|
||||
static int audioreach_gain_set(struct q6apm_graph *graph,
|
||||
const struct audioreach_module *module)
|
||||
{
|
||||
struct apm_module_param_data *param_data;
|
||||
struct apm_gain_module_cfg *cfg;
|
||||
|
|
@ -1218,7 +1226,7 @@ static int audioreach_gain_set(struct q6apm_graph *graph, struct audioreach_modu
|
|||
}
|
||||
|
||||
static int audioreach_speaker_protection(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
const struct audioreach_module *module,
|
||||
uint32_t operation_mode)
|
||||
{
|
||||
return audioreach_send_u32_param(graph, module, PARAM_ID_SP_OP_MODE,
|
||||
|
|
@ -1226,8 +1234,8 @@ static int audioreach_speaker_protection(struct q6apm_graph *graph,
|
|||
}
|
||||
|
||||
static int audioreach_speaker_protection_vi(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *mcfg)
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *mcfg)
|
||||
{
|
||||
u32 num_channels = mcfg->num_channels;
|
||||
struct apm_module_sp_vi_op_mode_cfg *op_cfg;
|
||||
|
|
@ -1304,8 +1312,9 @@ static int audioreach_speaker_protection_vi(struct q6apm_graph *graph,
|
|||
return rc;
|
||||
}
|
||||
|
||||
int audioreach_set_media_format(struct q6apm_graph *graph, struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg)
|
||||
int audioreach_set_media_format(struct q6apm_graph *graph,
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg)
|
||||
{
|
||||
int rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -831,8 +831,8 @@ void *audioreach_alloc_apm_pkt(int pkt_size, uint32_t opcode, uint32_t token,
|
|||
void *audioreach_alloc_pkt(int payload_size, uint32_t opcode,
|
||||
uint32_t token, uint32_t src_port,
|
||||
uint32_t dest_port);
|
||||
void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info
|
||||
*info);
|
||||
void *audioreach_alloc_graph_pkt(struct q6apm *apm,
|
||||
const struct audioreach_graph_info *info);
|
||||
/* Topology specific */
|
||||
int audioreach_tplg_init(struct snd_soc_component *component);
|
||||
|
||||
|
|
@ -848,13 +848,15 @@ int audioreach_send_cmd_sync(struct device *dev, gpr_device_t *gdev, struct gpr_
|
|||
int audioreach_graph_send_cmd_sync(struct q6apm_graph *graph, struct gpr_pkt *pkt,
|
||||
uint32_t rsp_opcode);
|
||||
int audioreach_set_media_format(struct q6apm_graph *graph,
|
||||
struct audioreach_module *module,
|
||||
struct audioreach_module_config *cfg);
|
||||
const struct audioreach_module *module,
|
||||
const struct audioreach_module_config *cfg);
|
||||
int audioreach_shared_memory_send_eos(struct q6apm_graph *graph);
|
||||
int audioreach_gain_set_vol_ctrl(struct q6apm *apm,
|
||||
struct audioreach_module *module, int vol);
|
||||
int audioreach_send_u32_param(struct q6apm_graph *graph, struct audioreach_module *module,
|
||||
const struct audioreach_module *module, int vol);
|
||||
int audioreach_send_u32_param(struct q6apm_graph *graph,
|
||||
const struct audioreach_module *module,
|
||||
uint32_t param_id, uint32_t param_val);
|
||||
int audioreach_compr_set_param(struct q6apm_graph *graph, struct audioreach_module_config *mcfg);
|
||||
int audioreach_compr_set_param(struct q6apm_graph *graph,
|
||||
const struct audioreach_module_config *mcfg);
|
||||
|
||||
#endif /* __AUDIOREACH_H__ */
|
||||
|
|
|
|||
|
|
@ -206,15 +206,15 @@ static struct audioreach_module *audioreach_tplg_alloc_module(struct q6apm *apm,
|
|||
return mod;
|
||||
}
|
||||
|
||||
static struct snd_soc_tplg_vendor_array *audioreach_get_sg_array(
|
||||
struct snd_soc_tplg_private *private)
|
||||
static const struct snd_soc_tplg_vendor_array *
|
||||
audioreach_get_sg_array(const struct snd_soc_tplg_private *private)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_array *sg_array = NULL;
|
||||
const struct snd_soc_tplg_vendor_array *sg_array = NULL;
|
||||
bool found = false;
|
||||
int sz;
|
||||
|
||||
for (sz = 0; !found && (sz < le32_to_cpu(private->size)); ) {
|
||||
struct snd_soc_tplg_vendor_value_elem *sg_elem;
|
||||
const struct snd_soc_tplg_vendor_value_elem *sg_elem;
|
||||
int tkn_count = 0;
|
||||
|
||||
sg_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz);
|
||||
|
|
@ -239,15 +239,15 @@ static struct snd_soc_tplg_vendor_array *audioreach_get_sg_array(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static struct snd_soc_tplg_vendor_array *audioreach_get_cont_array(
|
||||
struct snd_soc_tplg_private *private)
|
||||
static const struct snd_soc_tplg_vendor_array *
|
||||
audioreach_get_cont_array(const struct snd_soc_tplg_private *private)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_array *cont_array = NULL;
|
||||
const struct snd_soc_tplg_vendor_array *cont_array = NULL;
|
||||
bool found = false;
|
||||
int sz;
|
||||
|
||||
for (sz = 0; !found && (sz < le32_to_cpu(private->size)); ) {
|
||||
struct snd_soc_tplg_vendor_value_elem *cont_elem;
|
||||
const struct snd_soc_tplg_vendor_value_elem *cont_elem;
|
||||
int tkn_count = 0;
|
||||
|
||||
cont_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz);
|
||||
|
|
@ -272,15 +272,15 @@ static struct snd_soc_tplg_vendor_array *audioreach_get_cont_array(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static struct snd_soc_tplg_vendor_array *audioreach_get_module_array(
|
||||
struct snd_soc_tplg_private *private)
|
||||
static const struct snd_soc_tplg_vendor_array *
|
||||
audioreach_get_module_array(const struct snd_soc_tplg_private *private)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_array *mod_array = NULL;
|
||||
const struct snd_soc_tplg_vendor_array *mod_array = NULL;
|
||||
bool found = false;
|
||||
int sz = 0;
|
||||
|
||||
for (sz = 0; !found && (sz < le32_to_cpu(private->size)); ) {
|
||||
struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
const struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
int tkn_count = 0;
|
||||
|
||||
mod_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz);
|
||||
|
|
@ -305,13 +305,13 @@ static struct snd_soc_tplg_vendor_array *audioreach_get_module_array(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static struct audioreach_module_priv_data *audioreach_get_module_priv_data(
|
||||
struct snd_soc_tplg_private *private)
|
||||
static struct audioreach_module_priv_data *
|
||||
audioreach_get_module_priv_data(const struct snd_soc_tplg_private *private)
|
||||
{
|
||||
int sz;
|
||||
|
||||
for (sz = 0; sz < le32_to_cpu(private->size); ) {
|
||||
struct snd_soc_tplg_vendor_array *mod_array;
|
||||
const struct snd_soc_tplg_vendor_array *mod_array;
|
||||
|
||||
mod_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz);
|
||||
if (le32_to_cpu(mod_array->type) == SND_SOC_AR_TPLG_MODULE_CFG_TYPE) {
|
||||
|
|
@ -334,10 +334,10 @@ static struct audioreach_module_priv_data *audioreach_get_module_priv_data(
|
|||
}
|
||||
|
||||
static struct audioreach_sub_graph *audioreach_parse_sg_tokens(struct q6apm *apm,
|
||||
struct snd_soc_tplg_private *private)
|
||||
const struct snd_soc_tplg_private *private)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *sg_elem;
|
||||
struct snd_soc_tplg_vendor_array *sg_array;
|
||||
const struct snd_soc_tplg_vendor_value_elem *sg_elem;
|
||||
const struct snd_soc_tplg_vendor_array *sg_array;
|
||||
struct audioreach_graph_info *info = NULL;
|
||||
int graph_id, sub_graph_id, tkn_count = 0;
|
||||
struct audioreach_sub_graph *sg;
|
||||
|
|
@ -392,10 +392,10 @@ static struct audioreach_sub_graph *audioreach_parse_sg_tokens(struct q6apm *apm
|
|||
|
||||
static struct audioreach_container *audioreach_parse_cont_tokens(struct q6apm *apm,
|
||||
struct audioreach_sub_graph *sg,
|
||||
struct snd_soc_tplg_private *private)
|
||||
const struct snd_soc_tplg_private *private)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *cont_elem;
|
||||
struct snd_soc_tplg_vendor_array *cont_array;
|
||||
const struct snd_soc_tplg_vendor_value_elem *cont_elem;
|
||||
const struct snd_soc_tplg_vendor_array *cont_array;
|
||||
struct audioreach_container *cont;
|
||||
int container_id, tkn_count = 0;
|
||||
bool found = false;
|
||||
|
|
@ -437,7 +437,7 @@ static struct audioreach_container *audioreach_parse_cont_tokens(struct q6apm *a
|
|||
|
||||
static struct audioreach_module *audioreach_parse_common_tokens(struct q6apm *apm,
|
||||
struct audioreach_container *cont,
|
||||
struct snd_soc_tplg_private *private,
|
||||
const struct snd_soc_tplg_private *private,
|
||||
struct snd_soc_dapm_widget *w)
|
||||
{
|
||||
uint32_t max_ip_port = 0, max_op_port = 0;
|
||||
|
|
@ -447,8 +447,8 @@ static struct audioreach_module *audioreach_parse_common_tokens(struct q6apm *ap
|
|||
uint32_t src_mod_inst_id = 0;
|
||||
|
||||
int module_id = 0, instance_id = 0, tkn_count = 0;
|
||||
struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
struct snd_soc_tplg_vendor_array *mod_array;
|
||||
const struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
const struct snd_soc_tplg_vendor_array *mod_array;
|
||||
struct audioreach_module *mod = NULL;
|
||||
uint32_t token;
|
||||
bool found;
|
||||
|
|
@ -590,7 +590,7 @@ static struct audioreach_module *audioreach_parse_common_tokens(struct q6apm *ap
|
|||
|
||||
static int audioreach_widget_load_module_common(struct snd_soc_component *component,
|
||||
int index, struct snd_soc_dapm_widget *w,
|
||||
struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
const struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
{
|
||||
struct q6apm *apm = dev_get_drvdata(component->dev);
|
||||
struct audioreach_container *cont;
|
||||
|
|
@ -620,10 +620,10 @@ static int audioreach_widget_load_module_common(struct snd_soc_component *compon
|
|||
|
||||
static int audioreach_widget_load_enc_dec_cnv(struct snd_soc_component *component,
|
||||
int index, struct snd_soc_dapm_widget *w,
|
||||
struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
const struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
struct snd_soc_tplg_vendor_array *mod_array;
|
||||
const struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
const struct snd_soc_tplg_vendor_array *mod_array;
|
||||
struct audioreach_module *mod;
|
||||
struct snd_soc_dobj *dobj;
|
||||
int tkn_count = 0;
|
||||
|
|
@ -660,9 +660,9 @@ static int audioreach_widget_load_enc_dec_cnv(struct snd_soc_component *componen
|
|||
}
|
||||
|
||||
static int audioreach_widget_log_module_load(struct audioreach_module *mod,
|
||||
struct snd_soc_tplg_vendor_array *mod_array)
|
||||
const struct snd_soc_tplg_vendor_array *mod_array)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
const struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
int tkn_count = 0;
|
||||
|
||||
mod_elem = mod_array->value;
|
||||
|
|
@ -690,9 +690,9 @@ static int audioreach_widget_log_module_load(struct audioreach_module *mod,
|
|||
}
|
||||
|
||||
static int audioreach_widget_dma_module_load(struct audioreach_module *mod,
|
||||
struct snd_soc_tplg_vendor_array *mod_array)
|
||||
const struct snd_soc_tplg_vendor_array *mod_array)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
const struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
int tkn_count = 0;
|
||||
|
||||
mod_elem = mod_array->value;
|
||||
|
|
@ -719,9 +719,9 @@ static int audioreach_widget_dma_module_load(struct audioreach_module *mod,
|
|||
}
|
||||
|
||||
static int audioreach_widget_i2s_module_load(struct audioreach_module *mod,
|
||||
struct snd_soc_tplg_vendor_array *mod_array)
|
||||
const struct snd_soc_tplg_vendor_array *mod_array)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
const struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
int tkn_count = 0;
|
||||
|
||||
mod_elem = mod_array->value;
|
||||
|
|
@ -754,9 +754,9 @@ static int audioreach_widget_i2s_module_load(struct audioreach_module *mod,
|
|||
}
|
||||
|
||||
static int audioreach_widget_dp_module_load(struct audioreach_module *mod,
|
||||
struct snd_soc_tplg_vendor_array *mod_array)
|
||||
const struct snd_soc_tplg_vendor_array *mod_array)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
const struct snd_soc_tplg_vendor_value_elem *mod_elem;
|
||||
int tkn_count = 0;
|
||||
|
||||
mod_elem = mod_array->value;
|
||||
|
|
@ -778,9 +778,9 @@ static int audioreach_widget_dp_module_load(struct audioreach_module *mod,
|
|||
|
||||
static int audioreach_widget_load_buffer(struct snd_soc_component *component,
|
||||
int index, struct snd_soc_dapm_widget *w,
|
||||
struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
const struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_array *mod_array;
|
||||
const struct snd_soc_tplg_vendor_array *mod_array;
|
||||
struct audioreach_module *mod;
|
||||
struct snd_soc_dobj *dobj;
|
||||
int ret;
|
||||
|
|
@ -818,10 +818,10 @@ static int audioreach_widget_load_buffer(struct snd_soc_component *component,
|
|||
|
||||
static int audioreach_widget_load_mixer(struct snd_soc_component *component,
|
||||
int index, struct snd_soc_dapm_widget *w,
|
||||
struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
const struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *w_elem;
|
||||
struct snd_soc_tplg_vendor_array *w_array;
|
||||
const struct snd_soc_tplg_vendor_value_elem *w_elem;
|
||||
const struct snd_soc_tplg_vendor_array *w_array;
|
||||
struct snd_ar_control *scontrol;
|
||||
struct q6apm *data = dev_get_drvdata(component->dev);
|
||||
struct snd_soc_dobj *dobj;
|
||||
|
|
@ -886,7 +886,7 @@ static const struct snd_soc_tplg_widget_events audioreach_widget_ops[] = {
|
|||
|
||||
static int audioreach_widget_load_pga(struct snd_soc_component *component,
|
||||
int index, struct snd_soc_dapm_widget *w,
|
||||
struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
const struct snd_soc_tplg_dapm_widget *tplg_w)
|
||||
{
|
||||
struct audioreach_module *mod;
|
||||
struct snd_soc_dobj *dobj;
|
||||
|
|
@ -947,7 +947,7 @@ static int audioreach_widget_ready(struct snd_soc_component *component,
|
|||
static int audioreach_widget_unload(struct snd_soc_component *scomp,
|
||||
struct snd_soc_dobj *dobj)
|
||||
{
|
||||
struct snd_soc_dapm_widget *w = container_of(dobj, struct snd_soc_dapm_widget, dobj);
|
||||
const struct snd_soc_dapm_widget *w = container_of(dobj, struct snd_soc_dapm_widget, dobj);
|
||||
struct q6apm *apm = dev_get_drvdata(scomp->dev);
|
||||
struct audioreach_container *cont;
|
||||
struct audioreach_module *mod;
|
||||
|
|
@ -1032,7 +1032,7 @@ static struct audioreach_module *audioreach_find_module(struct snd_soc_component
|
|||
static int audioreach_route_load(struct snd_soc_component *scomp, int index,
|
||||
struct snd_soc_dapm_route *route)
|
||||
{
|
||||
struct audioreach_module *src_module, *sink_module;
|
||||
const struct audioreach_module *src_module, *sink_module;
|
||||
struct snd_ar_control *control;
|
||||
struct snd_soc_dapm_widget *w;
|
||||
int i;
|
||||
|
|
@ -1098,8 +1098,8 @@ static int audioreach_link_load(struct snd_soc_component *component, int index,
|
|||
}
|
||||
|
||||
static void audioreach_connect_sub_graphs(struct q6apm *apm,
|
||||
struct snd_ar_control *m1,
|
||||
struct snd_ar_control *m2,
|
||||
const struct snd_ar_control *m1,
|
||||
const struct snd_ar_control *m2,
|
||||
bool connect)
|
||||
{
|
||||
struct audioreach_graph_info *info;
|
||||
|
|
@ -1123,10 +1123,10 @@ static void audioreach_connect_sub_graphs(struct q6apm *apm,
|
|||
}
|
||||
|
||||
static bool audioreach_is_vmixer_connected(struct q6apm *apm,
|
||||
struct snd_ar_control *m1,
|
||||
struct snd_ar_control *m2)
|
||||
const struct snd_ar_control *m1,
|
||||
const struct snd_ar_control *m2)
|
||||
{
|
||||
struct audioreach_graph_info *info;
|
||||
const struct audioreach_graph_info *info;
|
||||
|
||||
mutex_lock(&apm->lock);
|
||||
info = idr_find(&apm->graph_info_idr, m2->graph_id);
|
||||
|
|
@ -1144,10 +1144,10 @@ static int audioreach_get_audio_mixer(struct snd_kcontrol *kcontrol,
|
|||
{
|
||||
struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value;
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
|
||||
struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol);
|
||||
const struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol);
|
||||
struct snd_soc_component *c = snd_soc_dapm_to_component(dapm);
|
||||
struct snd_ar_control *dapm_scontrol = dw->dobj.private;
|
||||
struct snd_ar_control *scontrol = mc->dobj.private;
|
||||
const struct snd_ar_control *dapm_scontrol = dw->dobj.private;
|
||||
const struct snd_ar_control *scontrol = mc->dobj.private;
|
||||
struct q6apm *data = dev_get_drvdata(c->dev);
|
||||
bool connected;
|
||||
|
||||
|
|
@ -1167,8 +1167,8 @@ static int audioreach_put_audio_mixer(struct snd_kcontrol *kcontrol,
|
|||
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
|
||||
struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol);
|
||||
struct snd_soc_component *c = snd_soc_dapm_to_component(dapm);
|
||||
struct snd_ar_control *dapm_scontrol = dw->dobj.private;
|
||||
struct snd_ar_control *scontrol = mc->dobj.private;
|
||||
const struct snd_ar_control *dapm_scontrol = dw->dobj.private;
|
||||
const struct snd_ar_control *scontrol = mc->dobj.private;
|
||||
struct q6apm *data = dev_get_drvdata(c->dev);
|
||||
|
||||
if (ucontrol->value.integer.value[0]) {
|
||||
|
|
@ -1206,14 +1206,14 @@ static int audioreach_put_vol_ctrl_audio_mixer(struct snd_kcontrol *kcontrol,
|
|||
static int audioreach_control_load_mix(struct snd_soc_component *scomp,
|
||||
struct snd_ar_control *scontrol,
|
||||
struct snd_kcontrol_new *kc,
|
||||
struct snd_soc_tplg_ctl_hdr *hdr)
|
||||
const struct snd_soc_tplg_ctl_hdr *hdr)
|
||||
{
|
||||
struct snd_soc_tplg_vendor_value_elem *c_elem;
|
||||
struct snd_soc_tplg_vendor_array *c_array;
|
||||
struct snd_soc_tplg_mixer_control *mc;
|
||||
const struct snd_soc_tplg_vendor_value_elem *c_elem;
|
||||
const struct snd_soc_tplg_vendor_array *c_array;
|
||||
const struct snd_soc_tplg_mixer_control *mc;
|
||||
int tkn_count = 0;
|
||||
|
||||
mc = container_of(hdr, struct snd_soc_tplg_mixer_control, hdr);
|
||||
mc = container_of_const(hdr, struct snd_soc_tplg_mixer_control, hdr);
|
||||
c_array = (struct snd_soc_tplg_vendor_array *)mc->priv.data;
|
||||
|
||||
c_elem = c_array->value;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user