Lines Matching refs:scontrol
710 struct snd_sof_control *scontrol; in sof_ipc3_widget_setup_comp_pga() local
741 list_for_each_entry(scontrol, &sdev->kcontrol_list, list) { in sof_ipc3_widget_setup_comp_pga()
742 if (scontrol->comp_id == swidget->comp_id && in sof_ipc3_widget_setup_comp_pga()
743 scontrol->volume_table) { in sof_ipc3_widget_setup_comp_pga()
744 min_step = scontrol->min_volume_step; in sof_ipc3_widget_setup_comp_pga()
745 max_step = scontrol->max_volume_step; in sof_ipc3_widget_setup_comp_pga()
746 volume->min_value = scontrol->volume_table[min_step]; in sof_ipc3_widget_setup_comp_pga()
747 volume->max_value = scontrol->volume_table[max_step]; in sof_ipc3_widget_setup_comp_pga()
748 volume->channels = scontrol->num_channels; in sof_ipc3_widget_setup_comp_pga()
1631 static int sof_ipc3_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc3_control_load_bytes() argument
1636 if (scontrol->max_size < (sizeof(*cdata) + sizeof(struct sof_abi_hdr))) { in sof_ipc3_control_load_bytes()
1638 __func__, scontrol->max_size); in sof_ipc3_control_load_bytes()
1642 if (scontrol->priv_size > scontrol->max_size - sizeof(*cdata)) { in sof_ipc3_control_load_bytes()
1645 scontrol->priv_size, scontrol->max_size - sizeof(*cdata)); in sof_ipc3_control_load_bytes()
1649 scontrol->ipc_control_data = kzalloc(scontrol->max_size, GFP_KERNEL); in sof_ipc3_control_load_bytes()
1650 if (!scontrol->ipc_control_data) in sof_ipc3_control_load_bytes()
1653 scontrol->size = sizeof(struct sof_ipc_ctrl_data) + scontrol->priv_size; in sof_ipc3_control_load_bytes()
1655 cdata = scontrol->ipc_control_data; in sof_ipc3_control_load_bytes()
1657 cdata->index = scontrol->index; in sof_ipc3_control_load_bytes()
1659 if (scontrol->priv_size > 0) { in sof_ipc3_control_load_bytes()
1660 memcpy(cdata->data, scontrol->priv, scontrol->priv_size); in sof_ipc3_control_load_bytes()
1661 kfree(scontrol->priv); in sof_ipc3_control_load_bytes()
1662 scontrol->priv = NULL; in sof_ipc3_control_load_bytes()
1677 if (cdata->data->size + sizeof(struct sof_abi_hdr) != scontrol->priv_size) { in sof_ipc3_control_load_bytes()
1686 kfree(scontrol->ipc_control_data); in sof_ipc3_control_load_bytes()
1687 scontrol->ipc_control_data = NULL; in sof_ipc3_control_load_bytes()
1691 static int sof_ipc3_control_load_volume(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc3_control_load_volume() argument
1697 scontrol->size = struct_size(cdata, chanv, scontrol->num_channels); in sof_ipc3_control_load_volume()
1699 scontrol->ipc_control_data = kzalloc(scontrol->size, GFP_KERNEL); in sof_ipc3_control_load_volume()
1700 if (!scontrol->ipc_control_data) in sof_ipc3_control_load_volume()
1703 cdata = scontrol->ipc_control_data; in sof_ipc3_control_load_volume()
1704 cdata->index = scontrol->index; in sof_ipc3_control_load_volume()
1707 if (scontrol->max == 1) { in sof_ipc3_control_load_volume()
1715 for (i = 0; i < scontrol->num_channels; i++) { in sof_ipc3_control_load_volume()
1723 static int sof_ipc3_control_load_enum(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc3_control_load_enum() argument
1728 scontrol->size = struct_size(cdata, chanv, scontrol->num_channels); in sof_ipc3_control_load_enum()
1730 scontrol->ipc_control_data = kzalloc(scontrol->size, GFP_KERNEL); in sof_ipc3_control_load_enum()
1731 if (!scontrol->ipc_control_data) in sof_ipc3_control_load_enum()
1734 cdata = scontrol->ipc_control_data; in sof_ipc3_control_load_enum()
1735 cdata->index = scontrol->index; in sof_ipc3_control_load_enum()
1741 static int sof_ipc3_control_setup(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc3_control_setup() argument
1743 switch (scontrol->info_type) { in sof_ipc3_control_setup()
1747 return sof_ipc3_control_load_volume(sdev, scontrol); in sof_ipc3_control_setup()
1749 return sof_ipc3_control_load_bytes(sdev, scontrol); in sof_ipc3_control_setup()
1752 return sof_ipc3_control_load_enum(sdev, scontrol); in sof_ipc3_control_setup()
1760 static int sof_ipc3_control_free(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) in sof_ipc3_control_free() argument
1766 fcomp.id = scontrol->comp_id; in sof_ipc3_control_free()