Lines Matching refs:ctrl

110 	struct sigmadsp_control *ctrl = (void *)kcontrol->private_value;
113 info->count = ctrl->num_bytes;
119 struct sigmadsp_control *ctrl, void *data)
122 if (ctrl->num_bytes <= 20 && sigmadsp->ops && sigmadsp->ops->safeload)
123 return sigmadsp->ops->safeload(sigmadsp, ctrl->addr, data,
124 ctrl->num_bytes);
126 return sigmadsp_write(sigmadsp, ctrl->addr, data,
127 ctrl->num_bytes);
133 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value;
143 ret = sigmadsp_ctrl_write(sigmadsp, ctrl, data);
146 memcpy(ctrl->cache, data, ctrl->num_bytes);
147 if (!ctrl->is_readback)
148 ctrl->cached = true;
159 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value;
165 if (!ctrl->cached) {
166 ret = sigmadsp_read(sigmadsp, ctrl->addr, ctrl->cache,
167 ctrl->num_bytes);
171 if (!ctrl->is_readback)
172 ctrl->cached = true;
173 memcpy(ucontrol->value.bytes.data, ctrl->cache,
174 ctrl->num_bytes);
184 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value;
186 ctrl->kcontrol = NULL;
206 struct sigmadsp_control *ctrl;
226 ctrl = kzalloc(sizeof(*ctrl) + num_bytes, GFP_KERNEL);
227 if (!ctrl)
235 ctrl->name = name;
242 if (ctrl->name && strncmp(ctrl->name, READBACK_CTRL_NAME,
244 ctrl->is_readback = true;
246 ctrl->addr = le16_to_cpu(ctrl_chunk->addr);
247 ctrl->num_bytes = num_bytes;
248 ctrl->samplerates = le32_to_cpu(chunk->samplerates);
250 list_add_tail(&ctrl->head, &sigmadsp->ctrl_list);
255 kfree(ctrl);
467 struct sigmadsp_control *ctrl, *_ctrl;
470 list_for_each_entry_safe(ctrl, _ctrl, &sigmadsp->ctrl_list, head) {
471 kfree(ctrl->name);
472 kfree(ctrl);
642 struct sigmadsp_control *ctrl, unsigned int samplerate_mask)
649 template.name = ctrl->name;
653 template.private_value = (unsigned long)ctrl;
655 if (!sigmadsp_samplerate_valid(ctrl->samplerates, samplerate_mask))
663 ctrl->kcontrol = kcontrol;
669 struct sigmadsp_control *ctrl, unsigned int samplerate_mask)
675 active = sigmadsp_samplerate_valid(ctrl->samplerates, samplerate_mask);
676 if (!ctrl->kcontrol)
678 changed = snd_ctl_activate_id(card, &ctrl->kcontrol->id, active);
681 if (ctrl->cached)
682 sigmadsp_ctrl_write(sigmadsp, ctrl, ctrl->cache);
701 struct sigmadsp_control *ctrl;
710 list_for_each_entry(ctrl, &sigmadsp->ctrl_list, head) {
711 ret = sigmadsp_alloc_control(sigmadsp, ctrl, samplerate_mask);
733 struct sigmadsp_control *ctrl;
755 list_for_each_entry(ctrl, &sigmadsp->ctrl_list, head)
756 sigmadsp_activate_ctrl(sigmadsp, ctrl, samplerate_mask);
777 struct sigmadsp_control *ctrl;
779 list_for_each_entry(ctrl, &sigmadsp->ctrl_list, head)
780 sigmadsp_activate_ctrl(sigmadsp, ctrl, false);