Lines Matching full:ue
1506 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_info() local
1510 *uinfo = ue->info; in snd_ctl_elem_user_info()
1519 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_enum_info() local
1527 *uinfo = ue->info; in snd_ctl_elem_user_enum_info()
1533 names = ue->priv_data; in snd_ctl_elem_user_enum_info()
1544 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_get() local
1545 unsigned int size = ue->elem_data_size; in snd_ctl_elem_user_get()
1546 char *src = ue->elem_data + in snd_ctl_elem_user_get()
1557 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_put() local
1558 unsigned int size = ue->elem_data_size; in snd_ctl_elem_user_put()
1559 char *dst = ue->elem_data + in snd_ctl_elem_user_put()
1562 err = sanity_check_input_values(ue->card, ucontrol, &ue->info, false); in snd_ctl_elem_user_put()
1576 struct user_element *ue = kctl->private_data; in replace_user_tlv() local
1582 lockdep_assert_held_write(&ue->card->controls_rwsem); in replace_user_tlv()
1588 if (check_user_elem_overflow(ue->card, (ssize_t)(size - ue->tlv_data_size))) in replace_user_tlv()
1595 change = ue->tlv_data_size != size; in replace_user_tlv()
1597 change = memcmp(ue->tlv_data, container, size) != 0; in replace_user_tlv()
1603 if (ue->tlv_data == NULL) { in replace_user_tlv()
1609 ue->card->user_ctl_alloc_size -= ue->tlv_data_size; in replace_user_tlv()
1610 ue->tlv_data_size = 0; in replace_user_tlv()
1611 kvfree(ue->tlv_data); in replace_user_tlv()
1614 ue->tlv_data = container; in replace_user_tlv()
1615 ue->tlv_data_size = size; in replace_user_tlv()
1617 ue->card->user_ctl_alloc_size += size; in replace_user_tlv()
1621 snd_ctl_notify_one(ue->card, mask, kctl, i); in replace_user_tlv()
1629 struct user_element *ue = kctl->private_data; in read_user_tlv() local
1631 if (ue->tlv_data_size == 0 || ue->tlv_data == NULL) in read_user_tlv()
1634 if (size < ue->tlv_data_size) in read_user_tlv()
1637 if (copy_to_user(buf, ue->tlv_data, ue->tlv_data_size)) in read_user_tlv()
1653 static int snd_ctl_elem_init_enum_names(struct user_element *ue) in snd_ctl_elem_init_enum_names() argument
1658 const uintptr_t user_ptrval = ue->info.value.enumerated.names_ptr; in snd_ctl_elem_init_enum_names()
1660 lockdep_assert_held_write(&ue->card->controls_rwsem); in snd_ctl_elem_init_enum_names()
1662 buf_len = ue->info.value.enumerated.names_length; in snd_ctl_elem_init_enum_names()
1666 if (check_user_elem_overflow(ue->card, buf_len)) in snd_ctl_elem_init_enum_names()
1674 for (i = 0; i < ue->info.value.enumerated.items; ++i) { in snd_ctl_elem_init_enum_names()
1684 ue->priv_data = names; in snd_ctl_elem_init_enum_names()
1685 ue->info.value.enumerated.names_ptr = 0; in snd_ctl_elem_init_enum_names()
1687 ue->card->user_ctl_alloc_size += ue->info.value.enumerated.names_length; in snd_ctl_elem_init_enum_names()
1699 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_free() local
1702 ue->card->user_ctl_alloc_size -= compute_user_elem_size(ue->elem_data_size, kcontrol->count); in snd_ctl_elem_user_free()
1703 ue->card->user_ctl_alloc_size -= ue->tlv_data_size; in snd_ctl_elem_user_free()
1704 if (ue->priv_data) in snd_ctl_elem_user_free()
1705 ue->card->user_ctl_alloc_size -= ue->info.value.enumerated.names_length; in snd_ctl_elem_user_free()
1707 kvfree(ue->tlv_data); in snd_ctl_elem_user_free()
1708 kvfree(ue->priv_data); in snd_ctl_elem_user_free()
1709 kfree(ue); in snd_ctl_elem_user_free()
1721 struct user_element *ue; in snd_ctl_elem_add() local
1786 ue = kzalloc(alloc_size, GFP_KERNEL); in snd_ctl_elem_add()
1787 if (!ue) { in snd_ctl_elem_add()
1792 kctl->private_data = ue; in snd_ctl_elem_add()
1799 ue->card = card; in snd_ctl_elem_add()
1800 ue->info = *info; in snd_ctl_elem_add()
1801 ue->info.access = 0; in snd_ctl_elem_add()
1802 ue->elem_data = (char *)ue + sizeof(*ue); in snd_ctl_elem_add()
1803 ue->elem_data_size = private_size; in snd_ctl_elem_add()
1804 if (ue->info.type == SNDRV_CTL_ELEM_TYPE_ENUMERATED) { in snd_ctl_elem_add()
1805 err = snd_ctl_elem_init_enum_names(ue); in snd_ctl_elem_add()