Lines Matching refs:cs_ctl

307 	struct cs_dsp_coeff_ctl *cs_ctl;  member
374 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_info() local
376 switch (cs_ctl->type) { in wm_coeff_info()
386 uinfo->count = cs_ctl->len; in wm_coeff_info()
399 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_put() local
403 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_put()
404 ret = cs_dsp_coeff_write_ctrl(cs_ctl, p, cs_ctl->len); in wm_coeff_put()
405 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_put()
416 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_tlv_put() local
419 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_tlv_put()
421 if (copy_from_user(cs_ctl->cache, bytes, size)) in wm_coeff_tlv_put()
424 ret = cs_dsp_coeff_write_ctrl(cs_ctl, cs_ctl->cache, size); in wm_coeff_tlv_put()
426 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_tlv_put()
437 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_put_acked() local
444 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_put_acked()
446 if (cs_ctl->enabled) in wm_coeff_put_acked()
447 ret = cs_dsp_coeff_write_acked_control(cs_ctl, val); in wm_coeff_put_acked()
451 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_put_acked()
462 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_get() local
466 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_get()
467 ret = cs_dsp_coeff_read_ctrl(cs_ctl, p, cs_ctl->len); in wm_coeff_get()
468 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_get()
479 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_tlv_get() local
482 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_tlv_get()
484 ret = cs_dsp_coeff_read_ctrl(cs_ctl, cs_ctl->cache, size); in wm_coeff_tlv_get()
486 if (!ret && copy_to_user(bytes, cs_ctl->cache, size)) in wm_coeff_tlv_get()
489 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_tlv_get()
542 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wmfw_add_ctl() local
555 kcontrol->access = wmfw_convert_flags(cs_ctl->flags, cs_ctl->len); in wmfw_add_ctl()
557 switch (cs_ctl->type) { in wmfw_add_ctl()
564 ctl->bytes_ext.max = cs_ctl->len; in wmfw_add_ctl()
592 struct wm_adsp *dsp = container_of(ctl->cs_ctl->dsp, in wm_adsp_ctl_work()
599 static int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl) in wm_adsp_control_add() argument
601 struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); in wm_adsp_control_add()
608 if (cs_ctl->flags & WMFW_CTL_FLAG_SYS) in wm_adsp_control_add()
611 region_name = cs_dsp_mem_region_name(cs_ctl->alg_region.type); in wm_adsp_control_add()
613 adsp_err(dsp, "Unknown region type: %d\n", cs_ctl->alg_region.type); in wm_adsp_control_add()
622 cs_ctl->alg_region.alg); in wm_adsp_control_add()
627 wm_adsp_fw_text[dsp->fw], cs_ctl->alg_region.alg); in wm_adsp_control_add()
632 wm_adsp_fw_text[dsp->fw], cs_ctl->alg_region.alg); in wm_adsp_control_add()
636 if (cs_ctl->subname) { in wm_adsp_control_add()
644 if (cs_ctl->subname_len > avail) in wm_adsp_control_add()
645 skip = cs_ctl->subname_len - avail; in wm_adsp_control_add()
648 " %.*s", cs_ctl->subname_len - skip, cs_ctl->subname + skip); in wm_adsp_control_add()
654 ctl->cs_ctl = cs_ctl; in wm_adsp_control_add()
662 cs_ctl->priv = ctl; in wm_adsp_control_add()
675 static void wm_adsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl) in wm_adsp_control_remove() argument
677 struct wm_coeff_ctl *ctl = cs_ctl->priv; in wm_adsp_control_remove()
688 struct cs_dsp_coeff_ctl *cs_ctl; in wm_adsp_write_ctl() local
694 cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg); in wm_adsp_write_ctl()
695 if (!cs_ctl) in wm_adsp_write_ctl()
698 ctl = cs_ctl->priv; in wm_adsp_write_ctl()
700 if (len > cs_ctl->len) in wm_adsp_write_ctl()
703 ret = cs_dsp_coeff_write_ctrl(cs_ctl, buf, len); in wm_adsp_write_ctl()
707 if (cs_ctl->flags & WMFW_CTL_FLAG_SYS) in wm_adsp_write_ctl()
733 struct cs_dsp_coeff_ctl *cs_ctl; in wm_adsp_read_ctl() local
735 cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg); in wm_adsp_read_ctl()
736 if (!cs_ctl) in wm_adsp_read_ctl()
739 if (len > cs_ctl->len) in wm_adsp_read_ctl()
742 return cs_dsp_coeff_read_ctrl(cs_ctl, buf, len); in wm_adsp_read_ctl()
1442 static int wm_adsp_buffer_parse_coeff(struct cs_dsp_coeff_ctl *cs_ctl) in wm_adsp_buffer_parse_coeff() argument
1446 struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); in wm_adsp_buffer_parse_coeff()
1451 ret = cs_dsp_coeff_read_ctrl(cs_ctl, &coeff_v1, sizeof(coeff_v1)); in wm_adsp_buffer_parse_coeff()
1470 buf->host_buf_mem_type = cs_ctl->alg_region.type; in wm_adsp_buffer_parse_coeff()
1481 if (cs_ctl->len == 4) { in wm_adsp_buffer_parse_coeff()
1509 struct cs_dsp_coeff_ctl *cs_ctl; in wm_adsp_buffer_init() local
1512 list_for_each_entry(cs_ctl, &dsp->cs_dsp.ctl_list, list) { in wm_adsp_buffer_init()
1513 if (cs_ctl->type != WMFW_CTL_TYPE_HOST_BUFFER) in wm_adsp_buffer_init()
1516 if (!cs_ctl->enabled) in wm_adsp_buffer_init()
1519 ret = wm_adsp_buffer_parse_coeff(cs_ctl); in wm_adsp_buffer_init()