Lines Matching refs:ctrl
110 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value; in sigmadsp_ctrl_info() local
113 info->count = ctrl->num_bytes; in sigmadsp_ctrl_info()
119 struct sigmadsp_control *ctrl, void *data) in sigmadsp_ctrl_write() argument
122 if (ctrl->num_bytes <= 20 && sigmadsp->ops && sigmadsp->ops->safeload) in sigmadsp_ctrl_write()
123 return sigmadsp->ops->safeload(sigmadsp, ctrl->addr, data, in sigmadsp_ctrl_write()
124 ctrl->num_bytes); in sigmadsp_ctrl_write()
126 return sigmadsp_write(sigmadsp, ctrl->addr, data, in sigmadsp_ctrl_write()
127 ctrl->num_bytes); in sigmadsp_ctrl_write()
133 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value; in sigmadsp_ctrl_put() local
143 ret = sigmadsp_ctrl_write(sigmadsp, ctrl, data); in sigmadsp_ctrl_put()
146 memcpy(ctrl->cache, data, ctrl->num_bytes); in sigmadsp_ctrl_put()
147 if (!ctrl->is_readback) in sigmadsp_ctrl_put()
148 ctrl->cached = true; in sigmadsp_ctrl_put()
159 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value; in sigmadsp_ctrl_get() local
165 if (!ctrl->cached) { in sigmadsp_ctrl_get()
166 ret = sigmadsp_read(sigmadsp, ctrl->addr, ctrl->cache, in sigmadsp_ctrl_get()
167 ctrl->num_bytes); in sigmadsp_ctrl_get()
171 if (!ctrl->is_readback) in sigmadsp_ctrl_get()
172 ctrl->cached = true; in sigmadsp_ctrl_get()
173 memcpy(ucontrol->value.bytes.data, ctrl->cache, in sigmadsp_ctrl_get()
174 ctrl->num_bytes); in sigmadsp_ctrl_get()
184 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value; in sigmadsp_control_free() local
186 ctrl->kcontrol = NULL; in sigmadsp_control_free()
206 struct sigmadsp_control *ctrl; in sigma_fw_load_control() local
226 ctrl = kzalloc(sizeof(*ctrl) + num_bytes, GFP_KERNEL); in sigma_fw_load_control()
227 if (!ctrl) in sigma_fw_load_control()
235 ctrl->name = name; in sigma_fw_load_control()
242 if (ctrl->name && strncmp(ctrl->name, READBACK_CTRL_NAME, in sigma_fw_load_control()
244 ctrl->is_readback = true; in sigma_fw_load_control()
246 ctrl->addr = le16_to_cpu(ctrl_chunk->addr); in sigma_fw_load_control()
247 ctrl->num_bytes = num_bytes; in sigma_fw_load_control()
248 ctrl->samplerates = le32_to_cpu(chunk->samplerates); in sigma_fw_load_control()
250 list_add_tail(&ctrl->head, &sigmadsp->ctrl_list); in sigma_fw_load_control()
255 kfree(ctrl); in sigma_fw_load_control()
467 struct sigmadsp_control *ctrl, *_ctrl; in sigmadsp_firmware_release() local
470 list_for_each_entry_safe(ctrl, _ctrl, &sigmadsp->ctrl_list, head) { in sigmadsp_firmware_release()
471 kfree(ctrl->name); in sigmadsp_firmware_release()
472 kfree(ctrl); in sigmadsp_firmware_release()
642 struct sigmadsp_control *ctrl, unsigned int samplerate_mask) in sigmadsp_alloc_control() argument
649 template.name = ctrl->name; in sigmadsp_alloc_control()
653 template.private_value = (unsigned long)ctrl; in sigmadsp_alloc_control()
655 if (!sigmadsp_samplerate_valid(ctrl->samplerates, samplerate_mask)) in sigmadsp_alloc_control()
663 ctrl->kcontrol = kcontrol; in sigmadsp_alloc_control()
669 struct sigmadsp_control *ctrl, unsigned int samplerate_mask) in sigmadsp_activate_ctrl() argument
677 active = sigmadsp_samplerate_valid(ctrl->samplerates, samplerate_mask); in sigmadsp_activate_ctrl()
680 if (!ctrl->kcontrol) { in sigmadsp_activate_ctrl()
685 id = ctrl->kcontrol->id; in sigmadsp_activate_ctrl()
686 vd = &ctrl->kcontrol->vd[0]; in sigmadsp_activate_ctrl()
695 if (ctrl->cached) in sigmadsp_activate_ctrl()
696 sigmadsp_ctrl_write(sigmadsp, ctrl, ctrl->cache); in sigmadsp_activate_ctrl()
718 struct sigmadsp_control *ctrl; in sigmadsp_attach() local
727 list_for_each_entry(ctrl, &sigmadsp->ctrl_list, head) { in sigmadsp_attach()
728 ret = sigmadsp_alloc_control(sigmadsp, ctrl, samplerate_mask); in sigmadsp_attach()
750 struct sigmadsp_control *ctrl; in sigmadsp_setup() local
772 list_for_each_entry(ctrl, &sigmadsp->ctrl_list, head) in sigmadsp_setup()
773 sigmadsp_activate_ctrl(sigmadsp, ctrl, samplerate_mask); in sigmadsp_setup()
794 struct sigmadsp_control *ctrl; in sigmadsp_reset() local
796 list_for_each_entry(ctrl, &sigmadsp->ctrl_list, head) in sigmadsp_reset()
797 sigmadsp_activate_ctrl(sigmadsp, ctrl, false); in sigmadsp_reset()