Lines Matching full:ue
1408 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_info() local
1412 *uinfo = ue->info; in snd_ctl_elem_user_info()
1421 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_enum_info() local
1429 *uinfo = ue->info; in snd_ctl_elem_user_enum_info()
1435 names = ue->priv_data; in snd_ctl_elem_user_enum_info()
1446 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_get() local
1447 unsigned int size = ue->elem_data_size; in snd_ctl_elem_user_get()
1448 char *src = ue->elem_data + in snd_ctl_elem_user_get()
1459 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_put() local
1460 unsigned int size = ue->elem_data_size; in snd_ctl_elem_user_put()
1461 char *dst = ue->elem_data + in snd_ctl_elem_user_put()
1464 err = sanity_check_input_values(ue->card, ucontrol, &ue->info, false); in snd_ctl_elem_user_put()
1478 struct user_element *ue = kctl->private_data; in replace_user_tlv() local
1484 lockdep_assert_held_write(&ue->card->controls_rwsem); in replace_user_tlv()
1490 if (check_user_elem_overflow(ue->card, (ssize_t)(size - ue->tlv_data_size))) in replace_user_tlv()
1497 change = ue->tlv_data_size != size; in replace_user_tlv()
1499 change = memcmp(ue->tlv_data, container, size) != 0; in replace_user_tlv()
1505 if (ue->tlv_data == NULL) { in replace_user_tlv()
1511 ue->card->user_ctl_alloc_size -= ue->tlv_data_size; in replace_user_tlv()
1512 ue->tlv_data_size = 0; in replace_user_tlv()
1513 kvfree(ue->tlv_data); in replace_user_tlv()
1516 ue->tlv_data = container; in replace_user_tlv()
1517 ue->tlv_data_size = size; in replace_user_tlv()
1519 ue->card->user_ctl_alloc_size += size; in replace_user_tlv()
1523 snd_ctl_notify_one(ue->card, mask, kctl, i); in replace_user_tlv()
1531 struct user_element *ue = kctl->private_data; in read_user_tlv() local
1533 if (ue->tlv_data_size == 0 || ue->tlv_data == NULL) in read_user_tlv()
1536 if (size < ue->tlv_data_size) in read_user_tlv()
1539 if (copy_to_user(buf, ue->tlv_data, ue->tlv_data_size)) in read_user_tlv()
1555 static int snd_ctl_elem_init_enum_names(struct user_element *ue) in snd_ctl_elem_init_enum_names() argument
1560 const uintptr_t user_ptrval = ue->info.value.enumerated.names_ptr; in snd_ctl_elem_init_enum_names()
1562 lockdep_assert_held_write(&ue->card->controls_rwsem); in snd_ctl_elem_init_enum_names()
1564 buf_len = ue->info.value.enumerated.names_length; in snd_ctl_elem_init_enum_names()
1568 if (check_user_elem_overflow(ue->card, buf_len)) in snd_ctl_elem_init_enum_names()
1576 for (i = 0; i < ue->info.value.enumerated.items; ++i) { in snd_ctl_elem_init_enum_names()
1586 ue->priv_data = names; in snd_ctl_elem_init_enum_names()
1587 ue->info.value.enumerated.names_ptr = 0; in snd_ctl_elem_init_enum_names()
1589 ue->card->user_ctl_alloc_size += ue->info.value.enumerated.names_length; in snd_ctl_elem_init_enum_names()
1601 struct user_element *ue = kcontrol->private_data; in snd_ctl_elem_user_free() local
1604 ue->card->user_ctl_alloc_size -= compute_user_elem_size(ue->elem_data_size, kcontrol->count); in snd_ctl_elem_user_free()
1605 ue->card->user_ctl_alloc_size -= ue->tlv_data_size; in snd_ctl_elem_user_free()
1606 if (ue->priv_data) in snd_ctl_elem_user_free()
1607 ue->card->user_ctl_alloc_size -= ue->info.value.enumerated.names_length; in snd_ctl_elem_user_free()
1609 kvfree(ue->tlv_data); in snd_ctl_elem_user_free()
1610 kvfree(ue->priv_data); in snd_ctl_elem_user_free()
1611 kfree(ue); in snd_ctl_elem_user_free()
1623 struct user_element *ue; in snd_ctl_elem_add() local
1688 ue = kzalloc(alloc_size, GFP_KERNEL); in snd_ctl_elem_add()
1689 if (!ue) { in snd_ctl_elem_add()
1693 kctl->private_data = ue; in snd_ctl_elem_add()
1700 ue->card = card; in snd_ctl_elem_add()
1701 ue->info = *info; in snd_ctl_elem_add()
1702 ue->info.access = 0; in snd_ctl_elem_add()
1703 ue->elem_data = (char *)ue + sizeof(*ue); in snd_ctl_elem_add()
1704 ue->elem_data_size = private_size; in snd_ctl_elem_add()
1705 if (ue->info.type == SNDRV_CTL_ELEM_TYPE_ENUMERATED) { in snd_ctl_elem_add()
1706 err = snd_ctl_elem_init_enum_names(ue); in snd_ctl_elem_add()