Lines Matching refs:apm
27 static struct audioreach_graph_info *audioreach_tplg_alloc_graph_info(struct q6apm *apm, in audioreach_tplg_alloc_graph_info() argument
34 mutex_lock(&apm->lock); in audioreach_tplg_alloc_graph_info()
35 info = idr_find(&apm->graph_info_idr, graph_id); in audioreach_tplg_alloc_graph_info()
36 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_graph_info()
50 mutex_lock(&apm->lock); in audioreach_tplg_alloc_graph_info()
51 ret = idr_alloc_u32(&apm->graph_info_idr, info, &graph_id, graph_id, GFP_KERNEL); in audioreach_tplg_alloc_graph_info()
52 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_graph_info()
55 dev_err(apm->dev, "Failed to allocate Graph ID (%x)\n", graph_id); in audioreach_tplg_alloc_graph_info()
73 static struct audioreach_sub_graph *audioreach_tplg_alloc_sub_graph(struct q6apm *apm, in audioreach_tplg_alloc_sub_graph() argument
84 mutex_lock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
85 sg = idr_find(&apm->sub_graphs_idr, sub_graph_id); in audioreach_tplg_alloc_sub_graph()
86 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
100 mutex_lock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
101 ret = idr_alloc_u32(&apm->sub_graphs_idr, sg, &sub_graph_id, sub_graph_id, GFP_KERNEL); in audioreach_tplg_alloc_sub_graph()
102 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
105 dev_err(apm->dev, "Failed to allocate Sub-Graph Instance ID (%x)\n", sub_graph_id); in audioreach_tplg_alloc_sub_graph()
115 static struct audioreach_container *audioreach_tplg_alloc_container(struct q6apm *apm, in audioreach_tplg_alloc_container() argument
126 mutex_lock(&apm->lock); in audioreach_tplg_alloc_container()
127 cont = idr_find(&apm->containers_idr, container_id); in audioreach_tplg_alloc_container()
128 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_container()
142 mutex_lock(&apm->lock); in audioreach_tplg_alloc_container()
143 ret = idr_alloc_u32(&apm->containers_idr, cont, &container_id, container_id, GFP_KERNEL); in audioreach_tplg_alloc_container()
144 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_container()
147 dev_err(apm->dev, "Failed to allocate Container Instance ID (%x)\n", container_id); in audioreach_tplg_alloc_container()
161 static struct audioreach_module *audioreach_tplg_alloc_module(struct q6apm *apm, in audioreach_tplg_alloc_module() argument
169 mutex_lock(&apm->lock); in audioreach_tplg_alloc_module()
170 mod = idr_find(&apm->modules_idr, module_id); in audioreach_tplg_alloc_module()
171 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_module()
182 mutex_lock(&apm->lock); in audioreach_tplg_alloc_module()
184 ret = idr_alloc_cyclic(&apm->modules_idr, mod, in audioreach_tplg_alloc_module()
188 ret = idr_alloc_u32(&apm->modules_idr, mod, &module_id, module_id, GFP_KERNEL); in audioreach_tplg_alloc_module()
190 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_module()
193 dev_err(apm->dev, "Failed to allocate Module Instance ID (%x)\n", module_id); in audioreach_tplg_alloc_module()
307 static struct audioreach_sub_graph *audioreach_parse_sg_tokens(struct q6apm *apm, in audioreach_parse_sg_tokens() argument
324 sg = audioreach_tplg_alloc_sub_graph(apm, sub_graph_id, &found); in audioreach_parse_sg_tokens()
335 info = audioreach_tplg_alloc_graph_info(apm, graph_id, &found); in audioreach_parse_sg_tokens()
349 dev_err(apm->dev, "Not a valid token %d for graph\n", sg_elem->token); in audioreach_parse_sg_tokens()
364 static struct audioreach_container *audioreach_parse_cont_tokens(struct q6apm *apm, in audioreach_parse_cont_tokens() argument
381 cont = audioreach_tplg_alloc_container(apm, sg, container_id, &found); in audioreach_parse_cont_tokens()
398 dev_err(apm->dev, "Not a valid token %d for graph\n", cont_elem->token); in audioreach_parse_cont_tokens()
409 static struct audioreach_module *audioreach_parse_common_tokens(struct q6apm *apm, in audioreach_parse_common_tokens() argument
440 mod = audioreach_tplg_alloc_module(apm, cont, w, in audioreach_parse_common_tokens()
445 dev_err(apm->dev, "Duplicate Module Instance ID 0x%08x found\n", in audioreach_parse_common_tokens()
573 struct q6apm *apm = dev_get_drvdata(component->dev); in audioreach_widget_load_module_common() local
579 sg = audioreach_parse_sg_tokens(apm, &tplg_w->priv); in audioreach_widget_load_module_common()
583 cont = audioreach_parse_cont_tokens(apm, sg, &tplg_w->priv); in audioreach_widget_load_module_common()
587 mod = audioreach_parse_common_tokens(apm, cont, &tplg_w->priv, w); in audioreach_widget_load_module_common()
819 struct q6apm *apm = dev_get_drvdata(c->dev); in audioreach_pga_event() local
824 audioreach_gain_set_vol_ctrl(apm, mod, mod->gain); in audioreach_pga_event()
901 struct q6apm *apm = dev_get_drvdata(scomp->dev); in audioreach_widget_unload() local
917 mutex_lock(&apm->lock); in audioreach_widget_unload()
918 idr_remove(&apm->modules_idr, mod->instance_id); in audioreach_widget_unload()
927 idr_remove(&apm->containers_idr, cont->container_id); in audioreach_widget_unload()
935 idr_remove(&apm->sub_graphs_idr, sg->sub_graph_id); in audioreach_widget_unload()
941 idr_remove(&apm->graph_info_idr, info->id); in audioreach_widget_unload()
947 mutex_unlock(&apm->lock); in audioreach_widget_unload()
955 struct q6apm *apm = dev_get_drvdata(comp->dev); in audioreach_find_widget() local
958 list_for_each_entry(control, &apm->widget_list, node) { in audioreach_find_widget()
969 struct q6apm *apm = dev_get_drvdata(comp->dev); in audioreach_find_module() local
973 idr_for_each_entry(&apm->modules_idr, module, id) { in audioreach_find_module()
1049 static void audioreach_connect_sub_graphs(struct q6apm *apm, in audioreach_connect_sub_graphs() argument
1056 mutex_lock(&apm->lock); in audioreach_connect_sub_graphs()
1057 info = idr_find(&apm->graph_info_idr, m2->graph_id); in audioreach_connect_sub_graphs()
1058 mutex_unlock(&apm->lock); in audioreach_connect_sub_graphs()
1074 static bool audioreach_is_vmixer_connected(struct q6apm *apm, in audioreach_is_vmixer_connected() argument
1080 mutex_lock(&apm->lock); in audioreach_is_vmixer_connected()
1081 info = idr_find(&apm->graph_info_idr, m2->graph_id); in audioreach_is_vmixer_connected()
1082 mutex_unlock(&apm->lock); in audioreach_is_vmixer_connected()