···337337 ref Reference board338338 mic-ref Reference board with power management for ports339339 dell-s14 Dell laptop340340+ dell-vostro-3500 Dell Vostro 3500 laptop340341 hp HP laptops with (inverted) mute-LED341342 hp-dv7-4000 HP dv-7 4000342343 auto BIOS setup (default)
···765765 * interface to ALSA control for feature/mixer units766766 */767767768768+/* volume control quirks */769769+static void volume_control_quirks(struct usb_mixer_elem_info *cval,770770+ struct snd_kcontrol *kctl)771771+{772772+ switch (cval->mixer->chip->usb_id) {773773+ case USB_ID(0x0471, 0x0101):774774+ case USB_ID(0x0471, 0x0104):775775+ case USB_ID(0x0471, 0x0105):776776+ case USB_ID(0x0672, 0x1041):777777+ /* quirk for UDA1321/N101.778778+ * note that detection between firmware 2.1.1.7 (N101)779779+ * and later 2.1.1.21 is not very clear from datasheets.780780+ * I hope that the min value is -15360 for newer firmware --jk781781+ */782782+ if (!strcmp(kctl->id.name, "PCM Playback Volume") &&783783+ cval->min == -15616) {784784+ snd_printk(KERN_INFO785785+ "set volume quirk for UDA1321/N101 chip\n");786786+ cval->max = -256;787787+ }788788+ break;789789+790790+ case USB_ID(0x046d, 0x09a4):791791+ if (!strcmp(kctl->id.name, "Mic Capture Volume")) {792792+ snd_printk(KERN_INFO793793+ "set volume quirk for QuickCam E3500\n");794794+ cval->min = 6080;795795+ cval->max = 8768;796796+ cval->res = 192;797797+ }798798+ break;799799+800800+ case USB_ID(0x046d, 0x0808):801801+ case USB_ID(0x046d, 0x0809):802802+ case USB_ID(0x046d, 0x0991):803803+ /* Most audio usb devices lie about volume resolution.804804+ * Most Logitech webcams have res = 384.805805+ * Proboly there is some logitech magic behind this number --fishor806806+ */807807+ if (!strcmp(kctl->id.name, "Mic Capture Volume")) {808808+ snd_printk(KERN_INFO809809+ "set resolution quirk: cval->res = 384\n");810810+ cval->res = 384;811811+ }812812+ break;813813+814814+ }815815+}816816+768817/*769818 * retrieve the minimum and maximum values for the specified control770819 */771771-static int get_min_max(struct usb_mixer_elem_info *cval, int default_min)820820+static int get_min_max_with_quirks(struct usb_mixer_elem_info *cval,821821+ int default_min, struct snd_kcontrol *kctl)772822{773823 /* for failsafe */774824 cval->min = default_min;···894844 cval->initialized = 1;895845 }896846847847+ if (kctl)848848+ volume_control_quirks(cval, kctl);849849+897850 /* USB descriptions contain the dB scale in 1/256 dB unit898851 * while ALSA TLV contains in 1/100 dB unit899852 */···917864 return 0;918865}919866867867+#define get_min_max(cval, def) get_min_max_with_quirks(cval, def, NULL)920868921869/* get a feature/mixer unit info */922870static int mixer_ctl_feature_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)···936882 uinfo->value.integer.max = 1;937883 } else {938884 if (!cval->initialized) {939939- get_min_max(cval, 0);885885+ get_min_max_with_quirks(cval, 0, kcontrol);940886 if (cval->initialized && cval->dBmin >= cval->dBmax) {941887 kcontrol->vd[0].access &= 942888 ~(SNDRV_CTL_ELEM_ACCESS_TLV_READ |···10991045 cval->ch_readonly = readonly_mask;11001046 }1101104711021102- /* get min/max values */11031103- get_min_max(cval, 0);11041104-11051048 /* if all channels in the mask are marked read-only, make the control11061049 * read-only. set_cur_mix_value() will check the mask again and won't11071050 * issue write commands to read-only channels. */···11191068 if (! len && nameid)11201069 len = snd_usb_copy_string_desc(state, nameid,11211070 kctl->id.name, sizeof(kctl->id.name));10711071+10721072+ /* get min/max values */10731073+ get_min_max_with_quirks(cval, 0, kctl);1122107411231075 switch (control) {11241076 case UAC_FU_MUTE:···11701116 strlcpy(kctl->id.name, audio_feature_info[control-1].name,11711117 sizeof(kctl->id.name));11721118 break;11731173- }11741174-11751175- /* volume control quirks */11761176- switch (state->chip->usb_id) {11771177- case USB_ID(0x0471, 0x0101):11781178- case USB_ID(0x0471, 0x0104):11791179- case USB_ID(0x0471, 0x0105):11801180- case USB_ID(0x0672, 0x1041):11811181- /* quirk for UDA1321/N101.11821182- * note that detection between firmware 2.1.1.7 (N101)11831183- * and later 2.1.1.21 is not very clear from datasheets.11841184- * I hope that the min value is -15360 for newer firmware --jk11851185- */11861186- if (!strcmp(kctl->id.name, "PCM Playback Volume") &&11871187- cval->min == -15616) {11881188- snd_printk(KERN_INFO11891189- "set volume quirk for UDA1321/N101 chip\n");11901190- cval->max = -256;11911191- }11921192- break;11931193-11941194- case USB_ID(0x046d, 0x09a4):11951195- if (!strcmp(kctl->id.name, "Mic Capture Volume")) {11961196- snd_printk(KERN_INFO11971197- "set volume quirk for QuickCam E3500\n");11981198- cval->min = 6080;11991199- cval->max = 8768;12001200- cval->res = 192;12011201- }12021202- break;12031203-12041204- case USB_ID(0x046d, 0x0808):12051205- case USB_ID(0x046d, 0x0809):12061206- case USB_ID(0x046d, 0x0991):12071207- /* Most audio usb devices lie about volume resolution.12081208- * Most Logitech webcams have res = 384.12091209- * Proboly there is some logitech magic behind this number --fishor12101210- */12111211- if (!strcmp(kctl->id.name, "Mic Capture Volume")) {12121212- snd_printk(KERN_INFO12131213- "set resolution quirk: cval->res = 384\n");12141214- cval->res = 384;12151215- }12161216- break;12171217-12181119 }1219112012201121 range = (cval->max - cval->min) / cval->res;