Lines Matching refs:ctl

368 	struct wm_coeff_ctl *ctl = (struct wm_coeff_ctl *)kcontrol->private_value;  in wm_coeff_info()  local
371 uinfo->count = ctl->len; in wm_coeff_info()
378 struct wm_coeff_ctl *ctl = (struct wm_coeff_ctl *)kcontrol->private_value; in wm_coeff_write_control() local
379 struct wm_adsp_alg_region *region = &ctl->region; in wm_coeff_write_control()
381 struct wm_adsp *adsp = ctl->adsp; in wm_coeff_write_control()
393 reg = ctl->region.base; in wm_coeff_write_control()
396 scratch = kmemdup(buf, ctl->len, GFP_KERNEL | GFP_DMA); in wm_coeff_write_control()
401 ctl->len); in wm_coeff_write_control()
404 ctl->len, reg, ret); in wm_coeff_write_control()
408 adsp_dbg(adsp, "Wrote %zu bytes to %x\n", ctl->len, reg); in wm_coeff_write_control()
418 struct wm_coeff_ctl *ctl = (struct wm_coeff_ctl *)kcontrol->private_value; in wm_coeff_put() local
421 memcpy(ctl->cache, p, ctl->len); in wm_coeff_put()
423 ctl->set = 1; in wm_coeff_put()
424 if (!ctl->enabled) in wm_coeff_put()
427 return wm_coeff_write_control(kcontrol, p, ctl->len); in wm_coeff_put()
433 struct wm_coeff_ctl *ctl = (struct wm_coeff_ctl *)kcontrol->private_value; in wm_coeff_read_control() local
434 struct wm_adsp_alg_region *region = &ctl->region; in wm_coeff_read_control()
436 struct wm_adsp *adsp = ctl->adsp; in wm_coeff_read_control()
448 reg = ctl->region.base; in wm_coeff_read_control()
451 scratch = kmalloc(ctl->len, GFP_KERNEL | GFP_DMA); in wm_coeff_read_control()
455 ret = regmap_raw_read(adsp->regmap, reg, scratch, ctl->len); in wm_coeff_read_control()
458 ctl->len, reg, ret); in wm_coeff_read_control()
462 adsp_dbg(adsp, "Read %zu bytes from %x\n", ctl->len, reg); in wm_coeff_read_control()
464 memcpy(buf, scratch, ctl->len); in wm_coeff_read_control()
473 struct wm_coeff_ctl *ctl = (struct wm_coeff_ctl *)kcontrol->private_value; in wm_coeff_get() local
476 memcpy(p, ctl->cache, ctl->len); in wm_coeff_get()
482 struct wm_coeff_ctl *ctl; member
486 static int wmfw_add_ctl(struct wm_adsp *adsp, struct wm_coeff_ctl *ctl) in wmfw_add_ctl() argument
491 if (!ctl || !ctl->name) in wmfw_add_ctl()
499 kcontrol->name = ctl->name; in wmfw_add_ctl()
503 kcontrol->private_value = (unsigned long)ctl; in wmfw_add_ctl()
512 ctl->kcontrol = snd_soc_card_get_kcontrol(adsp->card, in wmfw_add_ctl()
513 ctl->name); in wmfw_add_ctl()
515 list_add(&ctl->list, &adsp->ctl_list); in wmfw_add_ctl()
735 struct wm_coeff_ctl *ctl; in wm_coeff_init_control_caches() local
738 list_for_each_entry(ctl, &adsp->ctl_list, list) { in wm_coeff_init_control_caches()
739 if (!ctl->enabled || ctl->set) in wm_coeff_init_control_caches()
741 ret = wm_coeff_read_control(ctl->kcontrol, in wm_coeff_init_control_caches()
742 ctl->cache, in wm_coeff_init_control_caches()
743 ctl->len); in wm_coeff_init_control_caches()
753 struct wm_coeff_ctl *ctl; in wm_coeff_sync_controls() local
756 list_for_each_entry(ctl, &adsp->ctl_list, list) { in wm_coeff_sync_controls()
757 if (!ctl->enabled) in wm_coeff_sync_controls()
759 if (ctl->set) { in wm_coeff_sync_controls()
760 ret = wm_coeff_write_control(ctl->kcontrol, in wm_coeff_sync_controls()
761 ctl->cache, in wm_coeff_sync_controls()
762 ctl->len); in wm_coeff_sync_controls()
777 wmfw_add_ctl(ctl_work->adsp, ctl_work->ctl); in wm_adsp_ctl_work()
785 struct wm_coeff_ctl *ctl; in wm_adsp_create_control() local
819 list_for_each_entry(ctl, &dsp->ctl_list, in wm_adsp_create_control()
821 if (!strcmp(ctl->name, name)) { in wm_adsp_create_control()
822 if (!ctl->enabled) in wm_adsp_create_control()
823 ctl->enabled = 1; in wm_adsp_create_control()
828 ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); in wm_adsp_create_control()
829 if (!ctl) { in wm_adsp_create_control()
833 ctl->region = *region; in wm_adsp_create_control()
834 ctl->name = kmemdup(name, strlen(name) + 1, GFP_KERNEL); in wm_adsp_create_control()
835 if (!ctl->name) { in wm_adsp_create_control()
839 ctl->enabled = 1; in wm_adsp_create_control()
840 ctl->set = 0; in wm_adsp_create_control()
841 ctl->ops.xget = wm_coeff_get; in wm_adsp_create_control()
842 ctl->ops.xput = wm_coeff_put; in wm_adsp_create_control()
843 ctl->adsp = dsp; in wm_adsp_create_control()
845 ctl->len = region->len; in wm_adsp_create_control()
846 ctl->cache = kzalloc(ctl->len, GFP_KERNEL); in wm_adsp_create_control()
847 if (!ctl->cache) { in wm_adsp_create_control()
859 ctl_work->ctl = ctl; in wm_adsp_create_control()
869 kfree(ctl->cache); in wm_adsp_create_control()
871 kfree(ctl->name); in wm_adsp_create_control()
873 kfree(ctl); in wm_adsp_create_control()
1373 struct wm_coeff_ctl *ctl; in wm_adsp1_event() local
1448 list_for_each_entry(ctl, &dsp->ctl_list, list) in wm_adsp1_event()
1449 ctl->enabled = 0; in wm_adsp1_event()
1626 struct wm_coeff_ctl *ctl; in wm_adsp2_event() local
1671 list_for_each_entry(ctl, &dsp->ctl_list, list) in wm_adsp2_event()
1672 ctl->enabled = 0; in wm_adsp2_event()