snd_printk("using volume control quirk for the UDA1321/N101 chip\n"); 
snd_printk(KERN_INFO "using volume control quirk for the UDA1321/N101 chip\n"); 
static void build_feature_ctl(mixer_build_t *state, unsigned char *desc,			      unsigned int ctl_mask, int control,			      usb_audio_term_t *iterm, int unitid){	unsigned int len = 0;	int mapped_name = 0;	int nameid = desc[desc[0] - 1];	snd_kcontrol_t *kctl;	usb_mixer_elem_info_t *cval;	control++; /* change from zero-based to 1-based value */	if (control == USB_FEATURE_GEQ) {		/* FIXME: not supported yet */		return;	}	if (check_ignored_ctl(state, unitid, control))		return;	cval = kzalloc(sizeof(*cval), GFP_KERNEL);	if (! cval) {		snd_printk(KERN_ERR "cannot malloc kcontrol\n");		return;	}	cval->mixer = state->mixer;	cval->id = unitid;	cval->control = control;	cval->cmask = ctl_mask;	cval->val_type = audio_feature_info[control-1].type;	if (ctl_mask == 0)		cval->channels = 1;	/* master channel */	else {		int i, c = 0;		for (i = 0; i < 16; i++)			if (ctl_mask & (1 << i))				c++;		cval->channels = c;	}	/* get min/max values */	get_min_max(cval, 0);	kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval);	if (! kctl) {		snd_printk(KERN_ERR "cannot malloc kcontrol\n");		kfree(cval);		return;	}	kctl->private_free = usb_mixer_elem_free;	len = check_mapped_name(state, unitid, control, kctl->id.name, sizeof(kctl->id.name));	mapped_name = len != 0;	if (! len && nameid)		len = snd_usb_copy_string_desc(state, nameid, kctl->id.name, sizeof(kctl->id.name));	switch (control) {	case USB_FEATURE_MUTE:	case USB_FEATURE_VOLUME:		/* determine the control name.  the rule is:		 * - if a name id is given in descriptor, use it.		 * - if the connected input can be determined, then use the name		 *   of terminal type.		 * - if the connected output can be determined, use it.		 * - otherwise, anonymous name.		 */		if (! len) {			len = get_term_name(state, iterm, kctl->id.name, sizeof(kctl->id.name), 1);			if (! len)				len = get_term_name(state, &state->oterm, kctl->id.name, sizeof(kctl->id.name), 1);			if (! len)				len = snprintf(kctl->id.name, sizeof(kctl->id.name),					       "Feature %d", unitid);		}		/* determine the stream direction:		 * if the connected output is USB stream, then it's likely a		 * capture stream.  otherwise it should be playback (hopefully :)		 */		if (! mapped_name && ! (state->oterm.type >> 16)) {			if ((state->oterm.type & 0xff00) == 0x0100) {				len = strlcat(kctl->id.name, " Capture", sizeof(kctl->id.name));			} else {				len = strlcat(kctl->id.name + len, " Playback", sizeof(kctl->id.name));			}		}		strlcat(kctl->id.name + len, control == USB_FEATURE_MUTE ? " Switch" : " Volume",			sizeof(kctl->id.name));		break;	default:		if (! len)			strlcpy(kctl->id.name, audio_feature_info[control-1].name,				sizeof(kctl->id.name));		break;	}	/* quirk for UDA1321/N101 */	/* note that detection between firmware 2.1.1.7 (N101) and later 2.1.1.21 */	/* is not very clear from datasheets */	/* I hope that the min value is -15360 for newer firmware --jk */	switch (state->chip->usb_id) {	case USB_ID(0x0471, 0x0101):	case USB_ID(0x0471, 0x0104):	case USB_ID(0x0471, 0x0105):	case USB_ID(0x0672, 0x1041):		if (!strcmp(kctl->id.name, "PCM Playback Volume") &&		    cval->min == -15616) {			snd_printk("using volume control quirk for the UDA1321/N101 chip\n");			cval->max = -256;		}	}	snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",		    cval->id, kctl->id.name, cval->channels, cval->min, cval->max, cval->res);	add_control_to_empty(state, kctl);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d3d579f84ebf701dedd22ba696d1738ed6759ef7/usbmixer.c/clean/sound/usb/usbmixer.c