Lines Matching refs:mod
162 struct audioreach_module *mod; in audioreach_tplg_alloc_module() local
166 mod = idr_find(&apm->modules_idr, module_id); in audioreach_tplg_alloc_module()
169 if (mod) { in audioreach_tplg_alloc_module()
171 return mod; in audioreach_tplg_alloc_module()
174 mod = kzalloc(sizeof(*mod), GFP_KERNEL); in audioreach_tplg_alloc_module()
175 if (!mod) 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()
190 kfree(mod); in audioreach_tplg_alloc_module()
194 mod->instance_id = ret; in audioreach_tplg_alloc_module()
196 list_add_tail(&mod->node, &cont->modules_list); in audioreach_tplg_alloc_module()
197 mod->container = cont; in audioreach_tplg_alloc_module()
198 mod->widget = w; in audioreach_tplg_alloc_module()
201 return mod; in audioreach_tplg_alloc_module()
416 struct audioreach_module *mod = NULL; in audioreach_parse_common_tokens() local
430 mod = audioreach_tplg_alloc_module(apm, cont, w, in audioreach_parse_common_tokens()
432 if (IS_ERR(mod)) { in audioreach_parse_common_tokens()
433 return mod; in audioreach_parse_common_tokens()
473 if (mod) { in audioreach_parse_common_tokens()
474 mod->module_id = module_id; in audioreach_parse_common_tokens()
475 mod->max_ip_port = max_ip_port; in audioreach_parse_common_tokens()
476 mod->max_op_port = max_op_port; in audioreach_parse_common_tokens()
477 mod->in_port = in_port; in audioreach_parse_common_tokens()
478 mod->out_port = out_port; in audioreach_parse_common_tokens()
479 mod->src_mod_inst_id = src_mod_inst_id; in audioreach_parse_common_tokens()
480 mod->src_mod_op_port_id = src_mod_op_port_id; in audioreach_parse_common_tokens()
481 mod->dst_mod_inst_id = dst_mod_inst_id; in audioreach_parse_common_tokens()
482 mod->dst_mod_ip_port_id = dst_mod_ip_port_id; in audioreach_parse_common_tokens()
485 return mod; in audioreach_parse_common_tokens()
495 struct audioreach_module *mod; in audioreach_widget_load_module_common() local
506 mod = audioreach_parse_common_tokens(apm, cont, &tplg_w->priv, w); in audioreach_widget_load_module_common()
507 if (IS_ERR(mod)) in audioreach_widget_load_module_common()
508 return PTR_ERR(mod); in audioreach_widget_load_module_common()
511 dobj->private = mod; in audioreach_widget_load_module_common()
522 struct audioreach_module *mod; in audioreach_widget_load_enc_dec_cnv() local
532 mod = dobj->private; in audioreach_widget_load_enc_dec_cnv()
539 mod->interleave_type = le32_to_cpu(mod_elem->value); in audioreach_widget_load_enc_dec_cnv()
542 mod->rate = le32_to_cpu(mod_elem->value); in audioreach_widget_load_enc_dec_cnv()
545 mod->bit_depth = le32_to_cpu(mod_elem->value); in audioreach_widget_load_enc_dec_cnv()
557 static int audioreach_widget_log_module_load(struct audioreach_module *mod, in audioreach_widget_log_module_load() argument
569 mod->log_code = le32_to_cpu(mod_elem->value); in audioreach_widget_log_module_load()
572 mod->log_tap_point_id = le32_to_cpu(mod_elem->value); in audioreach_widget_log_module_load()
575 mod->log_mode = le32_to_cpu(mod_elem->value); in audioreach_widget_log_module_load()
587 static int audioreach_widget_dma_module_load(struct audioreach_module *mod, in audioreach_widget_dma_module_load() argument
598 mod->hw_interface_idx = le32_to_cpu(mod_elem->value); in audioreach_widget_dma_module_load()
601 mod->data_format = le32_to_cpu(mod_elem->value); in audioreach_widget_dma_module_load()
604 mod->hw_interface_type = le32_to_cpu(mod_elem->value); in audioreach_widget_dma_module_load()
616 static int audioreach_widget_i2s_module_load(struct audioreach_module *mod, in audioreach_widget_i2s_module_load() argument
627 mod->hw_interface_idx = le32_to_cpu(mod_elem->value); in audioreach_widget_i2s_module_load()
630 mod->data_format = le32_to_cpu(mod_elem->value); in audioreach_widget_i2s_module_load()
633 mod->hw_interface_type = le32_to_cpu(mod_elem->value); in audioreach_widget_i2s_module_load()
636 mod->sd_line_idx = le32_to_cpu(mod_elem->value); in audioreach_widget_i2s_module_load()
639 mod->ws_src = le32_to_cpu(mod_elem->value); in audioreach_widget_i2s_module_load()
656 struct audioreach_module *mod; in audioreach_widget_load_buffer() local
665 mod = dobj->private; in audioreach_widget_load_buffer()
669 switch (mod->module_id) { in audioreach_widget_load_buffer()
672 audioreach_widget_dma_module_load(mod, mod_array); in audioreach_widget_load_buffer()
675 audioreach_widget_log_module_load(mod, mod_array); in audioreach_widget_load_buffer()
679 audioreach_widget_i2s_module_load(mod, mod_array); in audioreach_widget_load_buffer()
730 struct audioreach_module *mod = w->dobj.private; in audioreach_pga_event() local
736 audioreach_gain_set_vol_ctrl(apm, mod, mod->gain); in audioreach_pga_event()
753 struct audioreach_module *mod; in audioreach_widget_load_pga() local
762 mod = dobj->private; in audioreach_widget_load_pga()
763 mod->gain = VOL_CTRL_DEFAULT_GAIN; in audioreach_widget_load_pga()
815 struct audioreach_module *mod; in audioreach_widget_unload() local
817 mod = dobj->private; in audioreach_widget_unload()
818 cont = mod->container; in audioreach_widget_unload()
827 idr_remove(&apm->modules_idr, mod->instance_id); in audioreach_widget_unload()
830 list_del(&mod->node); in audioreach_widget_unload()
831 kfree(mod); in audioreach_widget_unload()
963 struct audioreach_module *mod = dw->dobj.private; in audioreach_get_vol_ctrl_audio_mixer() local
965 ucontrol->value.integer.value[0] = mod->gain; in audioreach_get_vol_ctrl_audio_mixer()
974 struct audioreach_module *mod = dw->dobj.private; in audioreach_put_vol_ctrl_audio_mixer() local
976 mod->gain = ucontrol->value.integer.value[0]; in audioreach_put_vol_ctrl_audio_mixer()