Lines Matching refs:apm

23 static struct audioreach_graph_info *audioreach_tplg_alloc_graph_info(struct q6apm *apm,  in audioreach_tplg_alloc_graph_info()  argument
30 mutex_lock(&apm->lock); in audioreach_tplg_alloc_graph_info()
31 info = idr_find(&apm->graph_info_idr, graph_id); in audioreach_tplg_alloc_graph_info()
32 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_graph_info()
46 mutex_lock(&apm->lock); in audioreach_tplg_alloc_graph_info()
47 ret = idr_alloc(&apm->graph_info_idr, info, graph_id, graph_id + 1, GFP_KERNEL); in audioreach_tplg_alloc_graph_info()
48 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_graph_info()
51 dev_err(apm->dev, "Failed to allocate Graph ID (%x)\n", graph_id); in audioreach_tplg_alloc_graph_info()
69 static struct audioreach_sub_graph *audioreach_tplg_alloc_sub_graph(struct q6apm *apm, in audioreach_tplg_alloc_sub_graph() argument
80 mutex_lock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
81 sg = idr_find(&apm->sub_graphs_idr, sub_graph_id); in audioreach_tplg_alloc_sub_graph()
82 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
96 mutex_lock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
97 ret = idr_alloc(&apm->sub_graphs_idr, sg, sub_graph_id, sub_graph_id + 1, GFP_KERNEL); in audioreach_tplg_alloc_sub_graph()
98 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_sub_graph()
101 dev_err(apm->dev, "Failed to allocate Sub-Graph Instance ID (%x)\n", sub_graph_id); in audioreach_tplg_alloc_sub_graph()
111 static struct audioreach_container *audioreach_tplg_alloc_container(struct q6apm *apm, in audioreach_tplg_alloc_container() argument
122 mutex_lock(&apm->lock); in audioreach_tplg_alloc_container()
123 cont = idr_find(&apm->containers_idr, container_id); in audioreach_tplg_alloc_container()
124 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_container()
138 mutex_lock(&apm->lock); in audioreach_tplg_alloc_container()
139 ret = idr_alloc(&apm->containers_idr, cont, container_id, container_id + 1, GFP_KERNEL); in audioreach_tplg_alloc_container()
140 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_container()
143 dev_err(apm->dev, "Failed to allocate Container Instance ID (%x)\n", container_id); in audioreach_tplg_alloc_container()
157 static struct audioreach_module *audioreach_tplg_alloc_module(struct q6apm *apm, in audioreach_tplg_alloc_module() argument
165 mutex_lock(&apm->lock); in audioreach_tplg_alloc_module()
166 mod = idr_find(&apm->modules_idr, module_id); in audioreach_tplg_alloc_module()
167 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_module()
178 mutex_lock(&apm->lock); in audioreach_tplg_alloc_module()
180 ret = idr_alloc_cyclic(&apm->modules_idr, mod, in audioreach_tplg_alloc_module()
184 ret = idr_alloc(&apm->modules_idr, mod, module_id, module_id + 1, GFP_KERNEL); in audioreach_tplg_alloc_module()
186 mutex_unlock(&apm->lock); in audioreach_tplg_alloc_module()
189 dev_err(apm->dev, "Failed to allocate Module Instance ID (%x)\n", module_id); in audioreach_tplg_alloc_module()
303 static struct audioreach_sub_graph *audioreach_parse_sg_tokens(struct q6apm *apm, in audioreach_parse_sg_tokens() argument
320 sg = audioreach_tplg_alloc_sub_graph(apm, sub_graph_id, &found); in audioreach_parse_sg_tokens()
331 info = audioreach_tplg_alloc_graph_info(apm, graph_id, &found); in audioreach_parse_sg_tokens()
345 dev_err(apm->dev, "Not a valid token %d for graph\n", sg_elem->token); in audioreach_parse_sg_tokens()
360 static struct audioreach_container *audioreach_parse_cont_tokens(struct q6apm *apm, in audioreach_parse_cont_tokens() argument
377 cont = audioreach_tplg_alloc_container(apm, sg, container_id, &found); in audioreach_parse_cont_tokens()
394 dev_err(apm->dev, "Not a valid token %d for graph\n", cont_elem->token); in audioreach_parse_cont_tokens()
405 static struct audioreach_module *audioreach_parse_common_tokens(struct q6apm *apm, in audioreach_parse_common_tokens() argument
430 mod = audioreach_tplg_alloc_module(apm, cont, w, in audioreach_parse_common_tokens()
435 dev_err(apm->dev, "Duplicate Module Instance ID 0x%08x found\n", in audioreach_parse_common_tokens()
492 struct q6apm *apm = dev_get_drvdata(component->dev); in audioreach_widget_load_module_common() local
498 sg = audioreach_parse_sg_tokens(apm, &tplg_w->priv); in audioreach_widget_load_module_common()
502 cont = audioreach_parse_cont_tokens(apm, sg, &tplg_w->priv); in audioreach_widget_load_module_common()
506 mod = audioreach_parse_common_tokens(apm, cont, &tplg_w->priv, w); in audioreach_widget_load_module_common()
731 struct q6apm *apm = dev_get_drvdata(c->dev); in audioreach_pga_event() local
736 audioreach_gain_set_vol_ctrl(apm, mod, mod->gain); in audioreach_pga_event()
813 struct q6apm *apm = dev_get_drvdata(scomp->dev); in audioreach_widget_unload() local
826 mutex_lock(&apm->lock); in audioreach_widget_unload()
827 idr_remove(&apm->modules_idr, mod->instance_id); in audioreach_widget_unload()
836 idr_remove(&apm->containers_idr, cont->container_id); in audioreach_widget_unload()
844 idr_remove(&apm->sub_graphs_idr, sg->sub_graph_id); in audioreach_widget_unload()
850 idr_remove(&apm->graph_info_idr, info->id); in audioreach_widget_unload()
856 mutex_unlock(&apm->lock); in audioreach_widget_unload()
864 struct q6apm *apm = dev_get_drvdata(comp->dev); in audioreach_find_widget() local
868 idr_for_each_entry(&apm->modules_idr, module, id) { in audioreach_find_widget()