Lines Matching refs:gctl
675 struct snd_emu10k1_fx8010_control_gpr *gctl, in copy_gctl() argument
683 memcpy(gctl, (__force void *)&_gctl[idx], sizeof(*gctl)); in copy_gctl()
684 else if (copy_from_user(gctl, &_gctl[idx], sizeof(*gctl))) in copy_gctl()
691 memcpy(gctl, (__force void *)&octl[idx], sizeof(*octl)); in copy_gctl()
692 else if (copy_from_user(gctl, &octl[idx], sizeof(*octl))) in copy_gctl()
694 gctl->tlv = NULL; in copy_gctl()
700 struct snd_emu10k1_fx8010_control_gpr *gctl, in copy_gctl_to_user() argument
706 return copy_to_user(&_gctl[idx], gctl, sizeof(*gctl)); in copy_gctl_to_user()
709 return copy_to_user(&octl[idx], gctl, sizeof(*octl)); in copy_gctl_to_user()
719 struct snd_emu10k1_fx8010_control_gpr *gctl; in snd_emu10k1_verify_controls() local
731 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); in snd_emu10k1_verify_controls()
732 if (! gctl) in snd_emu10k1_verify_controls()
736 if (copy_gctl(emu, gctl, icode->gpr_add_controls, i, in snd_emu10k1_verify_controls()
741 if (snd_emu10k1_look_for_ctl(emu, &gctl->id)) in snd_emu10k1_verify_controls()
744 if (snd_ctl_find_id(emu->card, &gctl->id) != NULL) { in snd_emu10k1_verify_controls()
750 if (gctl->id.iface != SNDRV_CTL_ELEM_IFACE_MIXER && in snd_emu10k1_verify_controls()
751 gctl->id.iface != SNDRV_CTL_ELEM_IFACE_PCM) { in snd_emu10k1_verify_controls()
758 if (copy_gctl(emu, gctl, icode->gpr_list_controls, i, in snd_emu10k1_verify_controls()
765 kfree(gctl); in snd_emu10k1_verify_controls()
785 struct snd_emu10k1_fx8010_control_gpr *gctl; in snd_emu10k1_add_controls() local
793 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); in snd_emu10k1_add_controls()
795 if (!val || !gctl || !nctl) { in snd_emu10k1_add_controls()
801 if (copy_gctl(emu, gctl, icode->gpr_add_controls, i, in snd_emu10k1_add_controls()
806 if (gctl->id.iface != SNDRV_CTL_ELEM_IFACE_MIXER && in snd_emu10k1_add_controls()
807 gctl->id.iface != SNDRV_CTL_ELEM_IFACE_PCM) { in snd_emu10k1_add_controls()
811 if (! gctl->id.name[0]) { in snd_emu10k1_add_controls()
815 ctl = snd_emu10k1_look_for_ctl(emu, &gctl->id); in snd_emu10k1_add_controls()
817 knew.iface = gctl->id.iface; in snd_emu10k1_add_controls()
818 knew.name = gctl->id.name; in snd_emu10k1_add_controls()
819 knew.index = gctl->id.index; in snd_emu10k1_add_controls()
820 knew.device = gctl->id.device; in snd_emu10k1_add_controls()
821 knew.subdevice = gctl->id.subdevice; in snd_emu10k1_add_controls()
823 knew.tlv.p = copy_tlv((__force const unsigned int __user *)gctl->tlv, in_kernel); in snd_emu10k1_add_controls()
830 nctl->vcount = gctl->vcount; in snd_emu10k1_add_controls()
831 nctl->count = gctl->count; in snd_emu10k1_add_controls()
833 nctl->gpr[j] = gctl->gpr[j]; in snd_emu10k1_add_controls()
834 nctl->value[j] = ~gctl->value[j]; /* inverted, we want to write new value in gpr_ctl_put() */ in snd_emu10k1_add_controls()
835 val->value.integer.value[j] = gctl->value[j]; in snd_emu10k1_add_controls()
837 nctl->min = gctl->min; in snd_emu10k1_add_controls()
838 nctl->max = gctl->max; in snd_emu10k1_add_controls()
839 nctl->translation = gctl->translation; in snd_emu10k1_add_controls()
869 kfree(gctl); in snd_emu10k1_add_controls()
904 struct snd_emu10k1_fx8010_control_gpr *gctl; in snd_emu10k1_list_controls() local
908 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); in snd_emu10k1_list_controls()
909 if (! gctl) in snd_emu10k1_list_controls()
916 memset(gctl, 0, sizeof(*gctl)); in snd_emu10k1_list_controls()
918 gctl->id.iface = id->iface; in snd_emu10k1_list_controls()
919 strlcpy(gctl->id.name, id->name, sizeof(gctl->id.name)); in snd_emu10k1_list_controls()
920 gctl->id.index = id->index; in snd_emu10k1_list_controls()
921 gctl->id.device = id->device; in snd_emu10k1_list_controls()
922 gctl->id.subdevice = id->subdevice; in snd_emu10k1_list_controls()
923 gctl->vcount = ctl->vcount; in snd_emu10k1_list_controls()
924 gctl->count = ctl->count; in snd_emu10k1_list_controls()
926 gctl->gpr[j] = ctl->gpr[j]; in snd_emu10k1_list_controls()
927 gctl->value[j] = ctl->value[j]; in snd_emu10k1_list_controls()
929 gctl->min = ctl->min; in snd_emu10k1_list_controls()
930 gctl->max = ctl->max; in snd_emu10k1_list_controls()
931 gctl->translation = ctl->translation; in snd_emu10k1_list_controls()
933 gctl, i)) { in snd_emu10k1_list_controls()
934 kfree(gctl); in snd_emu10k1_list_controls()
941 kfree(gctl); in snd_emu10k1_list_controls()