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