Lines Matching refs:scontrol
350 static int set_up_volume_table(struct snd_sof_control *scontrol, in set_up_volume_table() argument
356 scontrol->volume_table = kcalloc(size, sizeof(u32), GFP_KERNEL); in set_up_volume_table()
357 if (!scontrol->volume_table) in set_up_volume_table()
362 scontrol->volume_table[j] = vol_compute_gain(j, tlv); in set_up_volume_table()
1032 struct snd_sof_control *scontrol, in sof_control_load_volume() argument
1060 scontrol->size = struct_size(scontrol->control_data, chanv, in sof_control_load_volume()
1062 scontrol->control_data = kzalloc(scontrol->size, GFP_KERNEL); in sof_control_load_volume()
1063 if (!scontrol->control_data) { in sof_control_load_volume()
1068 scontrol->comp_id = sdev->next_comp_id; in sof_control_load_volume()
1069 scontrol->min_volume_step = le32_to_cpu(mc->min); in sof_control_load_volume()
1070 scontrol->max_volume_step = le32_to_cpu(mc->max); in sof_control_load_volume()
1071 scontrol->num_channels = le32_to_cpu(mc->num_channels); in sof_control_load_volume()
1072 scontrol->control_data->index = kc->index; in sof_control_load_volume()
1076 scontrol->cmd = SOF_CTRL_CMD_SWITCH; in sof_control_load_volume()
1080 scontrol->cmd = SOF_CTRL_CMD_VOLUME; in sof_control_load_volume()
1090 ret = set_up_volume_table(scontrol, tlv, le32_to_cpu(mc->max) + 1); in sof_control_load_volume()
1097 cdata = scontrol->control_data; in sof_control_load_volume()
1098 for (i = 0; i < scontrol->num_channels; i++) { in sof_control_load_volume()
1105 ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens, in sof_control_load_volume()
1115 scontrol->comp_id, scontrol->num_channels); in sof_control_load_volume()
1121 kfree(scontrol->volume_table); in sof_control_load_volume()
1123 kfree(scontrol->control_data); in sof_control_load_volume()
1129 struct snd_sof_control *scontrol, in sof_control_load_enum() argument
1142 scontrol->size = struct_size(scontrol->control_data, chanv, in sof_control_load_enum()
1144 scontrol->control_data = kzalloc(scontrol->size, GFP_KERNEL); in sof_control_load_enum()
1145 if (!scontrol->control_data) in sof_control_load_enum()
1148 scontrol->comp_id = sdev->next_comp_id; in sof_control_load_enum()
1149 scontrol->num_channels = le32_to_cpu(ec->num_channels); in sof_control_load_enum()
1150 scontrol->control_data->index = kc->index; in sof_control_load_enum()
1151 scontrol->cmd = SOF_CTRL_CMD_ENUM; in sof_control_load_enum()
1154 scontrol->comp_id, scontrol->num_channels, scontrol->comp_id); in sof_control_load_enum()
1160 struct snd_sof_control *scontrol, in sof_control_load_bytes() argument
1187 scontrol->size = sizeof(struct sof_ipc_ctrl_data) + priv_size; in sof_control_load_bytes()
1189 scontrol->control_data = kzalloc(max_size, GFP_KERNEL); in sof_control_load_bytes()
1190 cdata = scontrol->control_data; in sof_control_load_bytes()
1191 if (!scontrol->control_data) { in sof_control_load_bytes()
1196 scontrol->comp_id = sdev->next_comp_id; in sof_control_load_bytes()
1197 scontrol->cmd = SOF_CTRL_CMD_BINARY; in sof_control_load_bytes()
1198 scontrol->control_data->index = kc->index; in sof_control_load_bytes()
1201 scontrol->comp_id, scontrol->num_channels); in sof_control_load_bytes()
1233 kfree(scontrol->control_data); in sof_control_load_bytes()
1248 struct snd_sof_control *scontrol; in sof_control_load() local
1254 scontrol = kzalloc(sizeof(*scontrol), GFP_KERNEL); in sof_control_load()
1255 if (!scontrol) in sof_control_load()
1258 scontrol->scomp = scomp; in sof_control_load()
1259 scontrol->access = kc->access; in sof_control_load()
1267 ret = sof_control_load_volume(scomp, scontrol, kc, hdr); in sof_control_load()
1272 ret = sof_control_load_bytes(scomp, scontrol, kc, hdr); in sof_control_load()
1278 ret = sof_control_load_enum(scomp, scontrol, kc, hdr); in sof_control_load()
1290 kfree(scontrol); in sof_control_load()
1295 kfree(scontrol); in sof_control_load()
1299 scontrol->led_ctl.led_value = -1; in sof_control_load()
1301 dobj->private = scontrol; in sof_control_load()
1302 list_add(&scontrol->list, &sdev->kcontrol_list); in sof_control_load()
1311 struct snd_sof_control *scontrol = dobj->private; in sof_control_unload() local
1317 fcomp.id = scontrol->comp_id; in sof_control_unload()
1319 kfree(scontrol->control_data); in sof_control_unload()
1320 list_del(&scontrol->list); in sof_control_unload()
1321 kfree(scontrol); in sof_control_unload()
1869 struct snd_sof_control *scontrol; in sof_widget_load_pga() local
1912 list_for_each_entry(scontrol, &sdev->kcontrol_list, list) { in sof_widget_load_pga()
1913 if (scontrol->comp_id == swidget->comp_id && in sof_widget_load_pga()
1914 scontrol->volume_table) { in sof_widget_load_pga()
1915 min_step = scontrol->min_volume_step; in sof_widget_load_pga()
1916 max_step = scontrol->max_volume_step; in sof_widget_load_pga()
1917 volume->min_value = scontrol->volume_table[min_step]; in sof_widget_load_pga()
1918 volume->max_value = scontrol->volume_table[max_step]; in sof_widget_load_pga()
1919 volume->channels = scontrol->num_channels; in sof_widget_load_pga()
2492 struct snd_sof_control *scontrol; in sof_widget_unload() local
2544 scontrol = sm->dobj.private; in sof_widget_unload()
2546 kfree(scontrol->volume_table); in sof_widget_unload()
2550 scontrol = se->dobj.private; in sof_widget_unload()
2554 scontrol = sbe->dobj.private; in sof_widget_unload()
2560 kfree(scontrol->control_data); in sof_widget_unload()
2561 list_del(&scontrol->list); in sof_widget_unload()
2562 kfree(scontrol); in sof_widget_unload()
3428 struct snd_sof_control *scontrol; in sof_set_pipe_widget() local
3432 list_for_each_entry(scontrol, &sdev->kcontrol_list, list) in sof_set_pipe_widget()
3433 if (scontrol->comp_id == swidget->comp_id && in sof_set_pipe_widget()
3434 (scontrol->access & SNDRV_CTL_ELEM_ACCESS_VOLATILE)) { in sof_set_pipe_widget()