Lines Matching full:apm
28 static struct audioreach_graph_info *audioreach_tplg_alloc_graph_info(struct q6apm *apm, in audioreach_tplg_alloc_graph_info() argument
35 mutex_lock(&apm->lock); in audioreach_tplg_alloc_graph_info()
36 info = idr_find(&apm->graph_info_idr, graph_id); in audioreach_tplg_alloc_graph_info()
37 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_graph_info()
51 mutex_lock(&apm->lock); in audioreach_tplg_alloc_graph_info()
52 ret = idr_alloc_u32(&apm->graph_info_idr, info, &graph_id, graph_id, GFP_KERNEL); in audioreach_tplg_alloc_graph_info()
53 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_graph_info()
56 dev_err(apm->dev, "Failed to allocate Graph ID (%x)\n", graph_id); in audioreach_tplg_alloc_graph_info()
74 static struct audioreach_sub_graph *audioreach_tplg_alloc_sub_graph(struct q6apm *apm, in audioreach_tplg_alloc_sub_graph() argument
85 mutex_lock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
86 sg = idr_find(&apm->sub_graphs_idr, sub_graph_id); in audioreach_tplg_alloc_sub_graph()
87 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
101 mutex_lock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
102 ret = idr_alloc_u32(&apm->sub_graphs_idr, sg, &sub_graph_id, sub_graph_id, GFP_KERNEL); in audioreach_tplg_alloc_sub_graph()
103 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
106 dev_err(apm->dev, "Failed to allocate Sub-Graph Instance ID (%x)\n", sub_graph_id); in audioreach_tplg_alloc_sub_graph()
116 static struct audioreach_container *audioreach_tplg_alloc_container(struct q6apm *apm, in audioreach_tplg_alloc_container() argument
127 mutex_lock(&apm->lock); in audioreach_tplg_alloc_container()
128 cont = idr_find(&apm->containers_idr, container_id); in audioreach_tplg_alloc_container()
129 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_container()
143 mutex_lock(&apm->lock); in audioreach_tplg_alloc_container()
144 ret = idr_alloc_u32(&apm->containers_idr, cont, &container_id, container_id, GFP_KERNEL); in audioreach_tplg_alloc_container()
145 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_container()
148 dev_err(apm->dev, "Failed to allocate Container Instance ID (%x)\n", container_id); in audioreach_tplg_alloc_container()
162 static struct audioreach_module *audioreach_tplg_alloc_module(struct q6apm *apm, in audioreach_tplg_alloc_module() argument
170 mutex_lock(&apm->lock); in audioreach_tplg_alloc_module()
171 mod = idr_find(&apm->modules_idr, module_id); in audioreach_tplg_alloc_module()
172 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_module()
183 mutex_lock(&apm->lock); in audioreach_tplg_alloc_module()
185 ret = idr_alloc_cyclic(&apm->modules_idr, mod, in audioreach_tplg_alloc_module()
189 ret = idr_alloc_u32(&apm->modules_idr, mod, &module_id, module_id, GFP_KERNEL); in audioreach_tplg_alloc_module()
191 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_module()
194 dev_err(apm->dev, "Failed to allocate Module Instance ID (%x)\n", module_id); in audioreach_tplg_alloc_module()
308 static struct audioreach_sub_graph *audioreach_parse_sg_tokens(struct q6apm *apm, in audioreach_parse_sg_tokens() argument
325 sg = audioreach_tplg_alloc_sub_graph(apm, sub_graph_id, &found); in audioreach_parse_sg_tokens()
336 info = audioreach_tplg_alloc_graph_info(apm, graph_id, &found); in audioreach_parse_sg_tokens()
350 dev_err(apm->dev, "Not a valid token %d for graph\n", sg_elem->token); in audioreach_parse_sg_tokens()
365 static struct audioreach_container *audioreach_parse_cont_tokens(struct q6apm *apm, in audioreach_parse_cont_tokens() argument
382 cont = audioreach_tplg_alloc_container(apm, sg, container_id, &found); in audioreach_parse_cont_tokens()
399 dev_err(apm->dev, "Not a valid token %d for graph\n", cont_elem->token); in audioreach_parse_cont_tokens()
410 static struct audioreach_module *audioreach_parse_common_tokens(struct q6apm *apm, in audioreach_parse_common_tokens() argument
441 mod = audioreach_tplg_alloc_module(apm, cont, w, in audioreach_parse_common_tokens()
446 dev_err(apm->dev, "Duplicate Module Instance ID 0x%08x found\n", in audioreach_parse_common_tokens()
575 struct q6apm *apm = dev_get_drvdata(component->dev); in audioreach_widget_load_module_common() local
581 sg = audioreach_parse_sg_tokens(apm, &tplg_w->priv); in audioreach_widget_load_module_common()
585 cont = audioreach_parse_cont_tokens(apm, sg, &tplg_w->priv); in audioreach_widget_load_module_common()
589 mod = audioreach_parse_common_tokens(apm, cont, &tplg_w->priv, w); in audioreach_widget_load_module_common()
847 struct q6apm *apm = dev_get_drvdata(c->dev); in audioreach_pga_event() local
852 audioreach_gain_set_vol_ctrl(apm, mod, mod->gain); in audioreach_pga_event()
929 struct q6apm *apm = dev_get_drvdata(scomp->dev); in audioreach_widget_unload() local
945 mutex_lock(&apm->lock); in audioreach_widget_unload()
946 idr_remove(&apm->modules_idr, mod->instance_id); in audioreach_widget_unload()
955 idr_remove(&apm->containers_idr, cont->container_id); in audioreach_widget_unload()
963 idr_remove(&apm->sub_graphs_idr, sg->sub_graph_id); in audioreach_widget_unload()
969 idr_remove(&apm->graph_info_idr, info->id); in audioreach_widget_unload()
975 mutex_unlock(&apm->lock); in audioreach_widget_unload()
983 struct q6apm *apm = dev_get_drvdata(comp->dev); in audioreach_find_widget() local
986 list_for_each_entry(control, &apm->widget_list, node) { in audioreach_find_widget()
997 struct q6apm *apm = dev_get_drvdata(comp->dev); in audioreach_find_module() local
1001 idr_for_each_entry(&apm->modules_idr, module, id) { in audioreach_find_module()
1077 static void audioreach_connect_sub_graphs(struct q6apm *apm, in audioreach_connect_sub_graphs() argument
1084 mutex_lock(&apm->lock); in audioreach_connect_sub_graphs()
1085 info = idr_find(&apm->graph_info_idr, m2->graph_id); in audioreach_connect_sub_graphs()
1086 mutex_unlock(&apm->lock); in audioreach_connect_sub_graphs()
1102 static bool audioreach_is_vmixer_connected(struct q6apm *apm, in audioreach_is_vmixer_connected() argument
1108 mutex_lock(&apm->lock); in audioreach_is_vmixer_connected()
1109 info = idr_find(&apm->graph_info_idr, m2->graph_id); in audioreach_is_vmixer_connected()
1110 mutex_unlock(&apm->lock); in audioreach_is_vmixer_connected()