Lines Matching refs:scontrol
406 struct snd_sof_control *scontrol; in sof_ipc4_widget_update_kcontrol_module_id() local
409 list_for_each_entry(scontrol, &sdev->kcontrol_list, list) { in sof_ipc4_widget_update_kcontrol_module_id()
410 if (scontrol->comp_id == swidget->comp_id) { in sof_ipc4_widget_update_kcontrol_module_id()
411 struct sof_ipc4_control_data *cdata = scontrol->ipc_control_data; in sof_ipc4_widget_update_kcontrol_module_id()
2421 static int sof_ipc4_control_load_volume(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc4_control_load_volume() argument
2427 scontrol->size = struct_size(control_data, chanv, scontrol->num_channels); in sof_ipc4_control_load_volume()
2430 scontrol->ipc_control_data = kzalloc(scontrol->size, GFP_KERNEL); in sof_ipc4_control_load_volume()
2431 if (!scontrol->ipc_control_data) in sof_ipc4_control_load_volume()
2434 control_data = scontrol->ipc_control_data; in sof_ipc4_control_load_volume()
2435 control_data->index = scontrol->index; in sof_ipc4_control_load_volume()
2443 if (scontrol->max == 1) in sof_ipc4_control_load_volume()
2448 for (i = 0; i < scontrol->num_channels; i++) { in sof_ipc4_control_load_volume()
2456 if (scontrol->max > 1) in sof_ipc4_control_load_volume()
2463 static int sof_ipc4_control_load_enum(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc4_control_load_enum() argument
2469 scontrol->size = struct_size(control_data, chanv, scontrol->num_channels); in sof_ipc4_control_load_enum()
2472 scontrol->ipc_control_data = kzalloc(scontrol->size, GFP_KERNEL); in sof_ipc4_control_load_enum()
2473 if (!scontrol->ipc_control_data) in sof_ipc4_control_load_enum()
2476 control_data = scontrol->ipc_control_data; in sof_ipc4_control_load_enum()
2477 control_data->index = scontrol->index; in sof_ipc4_control_load_enum()
2487 for (i = 0; i < scontrol->num_channels; i++) in sof_ipc4_control_load_enum()
2493 static int sof_ipc4_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc4_control_load_bytes() argument
2499 if (scontrol->max_size < (sizeof(*control_data) + sizeof(struct sof_abi_hdr))) { in sof_ipc4_control_load_bytes()
2501 scontrol->name, scontrol->max_size); in sof_ipc4_control_load_bytes()
2505 if (scontrol->priv_size > scontrol->max_size - sizeof(*control_data)) { in sof_ipc4_control_load_bytes()
2507 scontrol->name, scontrol->priv_size, in sof_ipc4_control_load_bytes()
2508 scontrol->max_size - sizeof(*control_data)); in sof_ipc4_control_load_bytes()
2512 scontrol->size = sizeof(struct sof_ipc4_control_data) + scontrol->priv_size; in sof_ipc4_control_load_bytes()
2514 scontrol->ipc_control_data = kzalloc(scontrol->max_size, GFP_KERNEL); in sof_ipc4_control_load_bytes()
2515 if (!scontrol->ipc_control_data) in sof_ipc4_control_load_bytes()
2518 control_data = scontrol->ipc_control_data; in sof_ipc4_control_load_bytes()
2519 control_data->index = scontrol->index; in sof_ipc4_control_load_bytes()
2520 if (scontrol->priv_size > 0) { in sof_ipc4_control_load_bytes()
2521 memcpy(control_data->data, scontrol->priv, scontrol->priv_size); in sof_ipc4_control_load_bytes()
2522 kfree(scontrol->priv); in sof_ipc4_control_load_bytes()
2523 scontrol->priv = NULL; in sof_ipc4_control_load_bytes()
2527 control_data->data->magic, scontrol->name); in sof_ipc4_control_load_bytes()
2535 scontrol->priv_size) { in sof_ipc4_control_load_bytes()
2537 scontrol->name, in sof_ipc4_control_load_bytes()
2539 scontrol->priv_size); in sof_ipc4_control_load_bytes()
2553 kfree(scontrol->ipc_control_data); in sof_ipc4_control_load_bytes()
2554 scontrol->ipc_control_data = NULL; in sof_ipc4_control_load_bytes()
2558 static int sof_ipc4_control_setup(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc4_control_setup() argument
2560 switch (scontrol->info_type) { in sof_ipc4_control_setup()
2564 return sof_ipc4_control_load_volume(sdev, scontrol); in sof_ipc4_control_setup()
2566 return sof_ipc4_control_load_bytes(sdev, scontrol); in sof_ipc4_control_setup()
2569 return sof_ipc4_control_load_enum(sdev, scontrol); in sof_ipc4_control_setup()