Lines Matching refs:ctl

334 	struct snd_emu10k1_fx8010_ctl *ctl =  in snd_emu10k1_gpr_ctl_info()  local
337 if (ctl->min == 0 && ctl->max == 1) in snd_emu10k1_gpr_ctl_info()
341 uinfo->count = ctl->vcount; in snd_emu10k1_gpr_ctl_info()
342 uinfo->value.integer.min = ctl->min; in snd_emu10k1_gpr_ctl_info()
343 uinfo->value.integer.max = ctl->max; in snd_emu10k1_gpr_ctl_info()
350 struct snd_emu10k1_fx8010_ctl *ctl = in snd_emu10k1_gpr_ctl_get() local
356 for (i = 0; i < ctl->vcount; i++) in snd_emu10k1_gpr_ctl_get()
357 ucontrol->value.integer.value[i] = ctl->value[i]; in snd_emu10k1_gpr_ctl_get()
365 struct snd_emu10k1_fx8010_ctl *ctl = in snd_emu10k1_gpr_ctl_put() local
373 for (i = 0; i < ctl->vcount; i++) { in snd_emu10k1_gpr_ctl_put()
375 if (nval < ctl->min) in snd_emu10k1_gpr_ctl_put()
376 nval = ctl->min; in snd_emu10k1_gpr_ctl_put()
377 if (nval > ctl->max) in snd_emu10k1_gpr_ctl_put()
378 nval = ctl->max; in snd_emu10k1_gpr_ctl_put()
379 if (nval != ctl->value[i]) in snd_emu10k1_gpr_ctl_put()
381 val = ctl->value[i] = nval; in snd_emu10k1_gpr_ctl_put()
382 switch (ctl->translation) { in snd_emu10k1_gpr_ctl_put()
384 snd_emu10k1_ptr_write(emu, emu->gpr_base + ctl->gpr[i], 0, val); in snd_emu10k1_gpr_ctl_put()
387 snd_emu10k1_ptr_write(emu, emu->gpr_base + ctl->gpr[i], 0, db_table[val]); in snd_emu10k1_gpr_ctl_put()
390 if ((ctl->count % 5) != 0 || (ctl->count / 5) != ctl->vcount) { in snd_emu10k1_gpr_ctl_put()
395 … snd_emu10k1_ptr_write(emu, emu->gpr_base + ctl->gpr[j * ctl->vcount + i], 0, bass_table[val][j]); in snd_emu10k1_gpr_ctl_put()
398 if ((ctl->count % 5) != 0 || (ctl->count / 5) != ctl->vcount) { in snd_emu10k1_gpr_ctl_put()
403 …snd_emu10k1_ptr_write(emu, emu->gpr_base + ctl->gpr[j * ctl->vcount + i], 0, treble_table[val][j]); in snd_emu10k1_gpr_ctl_put()
406 snd_emu10k1_ptr_write(emu, emu->gpr_base + ctl->gpr[i], 0, onoff_table[val]); in snd_emu10k1_gpr_ctl_put()
653 struct snd_emu10k1_fx8010_ctl *ctl; in snd_emu10k1_look_for_ctl() local
656 list_for_each_entry(ctl, &emu->fx8010.gpr_ctl, list) { in snd_emu10k1_look_for_ctl()
657 kcontrol = ctl->kcontrol; in snd_emu10k1_look_for_ctl()
661 return ctl; in snd_emu10k1_look_for_ctl()
774 struct snd_emu10k1_fx8010_ctl *ctl; in snd_emu10k1_ctl_private_free() local
776 ctl = (struct snd_emu10k1_fx8010_ctl *) kctl->private_value; in snd_emu10k1_ctl_private_free()
778 list_del(&ctl->list); in snd_emu10k1_ctl_private_free()
779 kfree(ctl); in snd_emu10k1_ctl_private_free()
788 struct snd_emu10k1_fx8010_ctl *ctl, *nctl; in snd_emu10k1_add_controls() local
816 ctl = snd_emu10k1_look_for_ctl(emu, &gctl->id); in snd_emu10k1_add_controls()
841 if (ctl == NULL) { in snd_emu10k1_add_controls()
842 ctl = kmalloc(sizeof(*ctl), GFP_KERNEL); in snd_emu10k1_add_controls()
843 if (ctl == NULL) { in snd_emu10k1_add_controls()
848 knew.private_value = (unsigned long)ctl; in snd_emu10k1_add_controls()
849 *ctl = *nctl; in snd_emu10k1_add_controls()
851 kfree(ctl); in snd_emu10k1_add_controls()
856 ctl->kcontrol = kctl; in snd_emu10k1_add_controls()
857 list_add_tail(&ctl->list, &emu->fx8010.gpr_ctl); in snd_emu10k1_add_controls()
860 nctl->list = ctl->list; in snd_emu10k1_add_controls()
861 nctl->kcontrol = ctl->kcontrol; in snd_emu10k1_add_controls()
862 *ctl = *nctl; in snd_emu10k1_add_controls()
864 SNDRV_CTL_EVENT_MASK_INFO, &ctl->kcontrol->id); in snd_emu10k1_add_controls()
866 snd_emu10k1_gpr_ctl_put(ctl->kcontrol, val); in snd_emu10k1_add_controls()
881 struct snd_emu10k1_fx8010_ctl *ctl; in snd_emu10k1_del_controls() local
889 ctl = snd_emu10k1_look_for_ctl(emu, &id); in snd_emu10k1_del_controls()
890 if (ctl) in snd_emu10k1_del_controls()
891 snd_ctl_remove(card, ctl->kcontrol); in snd_emu10k1_del_controls()
903 struct snd_emu10k1_fx8010_ctl *ctl; in snd_emu10k1_list_controls() local
910 list_for_each_entry(ctl, &emu->fx8010.gpr_ctl, list) { in snd_emu10k1_list_controls()
915 id = &ctl->kcontrol->id; in snd_emu10k1_list_controls()
921 gctl->vcount = ctl->vcount; in snd_emu10k1_list_controls()
922 gctl->count = ctl->count; in snd_emu10k1_list_controls()
924 gctl->gpr[j] = ctl->gpr[j]; in snd_emu10k1_list_controls()
925 gctl->value[j] = ctl->value[j]; in snd_emu10k1_list_controls()
927 gctl->min = ctl->min; in snd_emu10k1_list_controls()
928 gctl->max = ctl->max; in snd_emu10k1_list_controls()
929 gctl->translation = ctl->translation; in snd_emu10k1_list_controls()
1076 snd_emu10k1_init_mono_control(struct snd_emu10k1_fx8010_control_gpr *ctl, in snd_emu10k1_init_mono_control() argument
1079 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in snd_emu10k1_init_mono_control()
1080 strcpy(ctl->id.name, name); in snd_emu10k1_init_mono_control()
1081 ctl->vcount = ctl->count = 1; in snd_emu10k1_init_mono_control()
1082 ctl->gpr[0] = gpr + 0; ctl->value[0] = defval; in snd_emu10k1_init_mono_control()
1084 ctl->min = 0; in snd_emu10k1_init_mono_control()
1085 ctl->max = 0x7fffffff; in snd_emu10k1_init_mono_control()
1086 ctl->tlv = snd_emu10k1_db_linear; in snd_emu10k1_init_mono_control()
1087 ctl->translation = EMU10K1_GPR_TRANSLATION_NONE; in snd_emu10k1_init_mono_control()
1089 ctl->min = 0; in snd_emu10k1_init_mono_control()
1090 ctl->max = 100; in snd_emu10k1_init_mono_control()
1091 ctl->tlv = snd_emu10k1_db_scale1; in snd_emu10k1_init_mono_control()
1092 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; in snd_emu10k1_init_mono_control()
1097 snd_emu10k1_init_stereo_control(struct snd_emu10k1_fx8010_control_gpr *ctl, in snd_emu10k1_init_stereo_control() argument
1100 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in snd_emu10k1_init_stereo_control()
1101 strcpy(ctl->id.name, name); in snd_emu10k1_init_stereo_control()
1102 ctl->vcount = ctl->count = 2; in snd_emu10k1_init_stereo_control()
1103 ctl->gpr[0] = gpr + 0; ctl->value[0] = defval; in snd_emu10k1_init_stereo_control()
1104 ctl->gpr[1] = gpr + 1; ctl->value[1] = defval; in snd_emu10k1_init_stereo_control()
1106 ctl->min = 0; in snd_emu10k1_init_stereo_control()
1107 ctl->max = 0x7fffffff; in snd_emu10k1_init_stereo_control()
1108 ctl->tlv = snd_emu10k1_db_linear; in snd_emu10k1_init_stereo_control()
1109 ctl->translation = EMU10K1_GPR_TRANSLATION_NONE; in snd_emu10k1_init_stereo_control()
1111 ctl->min = 0; in snd_emu10k1_init_stereo_control()
1112 ctl->max = 100; in snd_emu10k1_init_stereo_control()
1113 ctl->tlv = snd_emu10k1_db_scale1; in snd_emu10k1_init_stereo_control()
1114 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; in snd_emu10k1_init_stereo_control()
1119 snd_emu10k1_init_mono_onoff_control(struct snd_emu10k1_fx8010_control_gpr *ctl, in snd_emu10k1_init_mono_onoff_control() argument
1122 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in snd_emu10k1_init_mono_onoff_control()
1123 strcpy(ctl->id.name, name); in snd_emu10k1_init_mono_onoff_control()
1124 ctl->vcount = ctl->count = 1; in snd_emu10k1_init_mono_onoff_control()
1125 ctl->gpr[0] = gpr + 0; ctl->value[0] = defval; in snd_emu10k1_init_mono_onoff_control()
1126 ctl->min = 0; in snd_emu10k1_init_mono_onoff_control()
1127 ctl->max = 1; in snd_emu10k1_init_mono_onoff_control()
1128 ctl->translation = EMU10K1_GPR_TRANSLATION_ONOFF; in snd_emu10k1_init_mono_onoff_control()
1132 snd_emu10k1_init_stereo_onoff_control(struct snd_emu10k1_fx8010_control_gpr *ctl, in snd_emu10k1_init_stereo_onoff_control() argument
1135 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in snd_emu10k1_init_stereo_onoff_control()
1136 strcpy(ctl->id.name, name); in snd_emu10k1_init_stereo_onoff_control()
1137 ctl->vcount = ctl->count = 2; in snd_emu10k1_init_stereo_onoff_control()
1138 ctl->gpr[0] = gpr + 0; ctl->value[0] = defval; in snd_emu10k1_init_stereo_onoff_control()
1139 ctl->gpr[1] = gpr + 1; ctl->value[1] = defval; in snd_emu10k1_init_stereo_onoff_control()
1140 ctl->min = 0; in snd_emu10k1_init_stereo_onoff_control()
1141 ctl->max = 1; in snd_emu10k1_init_stereo_onoff_control()
1142 ctl->translation = EMU10K1_GPR_TRANSLATION_ONOFF; in snd_emu10k1_init_stereo_onoff_control()
1180 struct snd_emu10k1_fx8010_control_gpr *controls = NULL, *ctl; in _snd_emu10k1_audigy_init_efx() local
1452 ctl = &controls[nctl + 0]; in _snd_emu10k1_audigy_init_efx()
1453 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in _snd_emu10k1_audigy_init_efx()
1454 strcpy(ctl->id.name, "Tone Control - Bass"); in _snd_emu10k1_audigy_init_efx()
1455 ctl->vcount = 2; in _snd_emu10k1_audigy_init_efx()
1456 ctl->count = 10; in _snd_emu10k1_audigy_init_efx()
1457 ctl->min = 0; in _snd_emu10k1_audigy_init_efx()
1458 ctl->max = 40; in _snd_emu10k1_audigy_init_efx()
1459 ctl->value[0] = ctl->value[1] = 20; in _snd_emu10k1_audigy_init_efx()
1460 ctl->translation = EMU10K1_GPR_TRANSLATION_BASS; in _snd_emu10k1_audigy_init_efx()
1461 ctl = &controls[nctl + 1]; in _snd_emu10k1_audigy_init_efx()
1462 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in _snd_emu10k1_audigy_init_efx()
1463 strcpy(ctl->id.name, "Tone Control - Treble"); in _snd_emu10k1_audigy_init_efx()
1464 ctl->vcount = 2; in _snd_emu10k1_audigy_init_efx()
1465 ctl->count = 10; in _snd_emu10k1_audigy_init_efx()
1466 ctl->min = 0; in _snd_emu10k1_audigy_init_efx()
1467 ctl->max = 40; in _snd_emu10k1_audigy_init_efx()
1468 ctl->value[0] = ctl->value[1] = 20; in _snd_emu10k1_audigy_init_efx()
1469 ctl->translation = EMU10K1_GPR_TRANSLATION_TREBLE; in _snd_emu10k1_audigy_init_efx()
1818 struct snd_emu10k1_fx8010_control_gpr *controls = NULL, *ctl; in _snd_emu10k1_init_efx() local
2175 ctl = &controls[i + 0]; in _snd_emu10k1_init_efx()
2176 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in _snd_emu10k1_init_efx()
2177 strcpy(ctl->id.name, "Tone Control - Bass"); in _snd_emu10k1_init_efx()
2178 ctl->vcount = 2; in _snd_emu10k1_init_efx()
2179 ctl->count = 10; in _snd_emu10k1_init_efx()
2180 ctl->min = 0; in _snd_emu10k1_init_efx()
2181 ctl->max = 40; in _snd_emu10k1_init_efx()
2182 ctl->value[0] = ctl->value[1] = 20; in _snd_emu10k1_init_efx()
2183 ctl->tlv = snd_emu10k1_bass_treble_db_scale; in _snd_emu10k1_init_efx()
2184 ctl->translation = EMU10K1_GPR_TRANSLATION_BASS; in _snd_emu10k1_init_efx()
2185 ctl = &controls[i + 1]; in _snd_emu10k1_init_efx()
2186 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; in _snd_emu10k1_init_efx()
2187 strcpy(ctl->id.name, "Tone Control - Treble"); in _snd_emu10k1_init_efx()
2188 ctl->vcount = 2; in _snd_emu10k1_init_efx()
2189 ctl->count = 10; in _snd_emu10k1_init_efx()
2190 ctl->min = 0; in _snd_emu10k1_init_efx()
2191 ctl->max = 40; in _snd_emu10k1_init_efx()
2192 ctl->value[0] = ctl->value[1] = 20; in _snd_emu10k1_init_efx()
2193 ctl->tlv = snd_emu10k1_bass_treble_db_scale; in _snd_emu10k1_init_efx()
2194 ctl->translation = EMU10K1_GPR_TRANSLATION_TREBLE; in _snd_emu10k1_init_efx()