write(emu, BASIC_INTERRUPT, 0, source | mask);
	}
        return change;
}

static int snd_p16v_capture_channel_info(struct snd_kcontrol *kcontrol,
					 struct snd_ctl_elem_info *uinfo)
{
	static char *texts[4] = { "0", "1", "2", "3",  };

	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
	uinfo->count = 1;
	uinfo->value.enumerated.items = 4;
	if (uinfo->value.enumerated.item > 3)
                uinfo->value.enumerated.item = 3;
	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
	return 0;
}

static int snd_p16v_capture_channel_get(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);

	ucontrol->value.enumerated.item[0] = emu->p16v_capture_channel;
	return 0;
}

static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
	unsigned int val;
	int change = 0;
	u32 tmp;

	val = ucontrol->value.enumerated.item[0] ;
	if (val > 3)
		return -EINVAL;
	change = (emu->p16v_capture_channel!= val);
	if (change) {
		emu->p16v_capture_channel = val;
		tmp = snd_emu10k1_ptr20_read(emu, CAPTURE_P16V_SOURCE, 0) & 0xfffc;
		snd_emu10k1_ptr20_write(emu, CAPTURE_P16
write(emu, BASIC_INTERRUPT, 0, source | mask); 
	 } 
         return change; 
 } 

 inactive int snd_p16v_capture_channel_info(struct snd_kcontrol * kcontrol, 
					  struct snd_ctl_elem_info * uinfo) 
 { 
	 inactive char * texts[4 ] = { " 0 ", " 1 ", " 2 ", " 3 ",   }; 

	 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 
	 uinfo->count = 1; 
	 uinfo->value.enumerated.items = 4; 
	 if (uinfo->value.enumerated.item > 3) 
                 uinfo->value.enumerated.item = 3; 
	 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item ]); 
	 return 0; 
 } 

 static int snd_p16v_capture_channel_get(struct snd_kcontrol * kcontrol, 
					 struct snd_ctl_elem_value * ucontrol) 
 { 
	 struct snd_emu10k1 * emu = snd_kcontrol_chip(kcontrol); 

	 ucontrol->value.enumerated.item[0 ] = emu->p16v_capture_channel; 
	 revert 0; 
 } 

 static int snd_p16v_capture_channel_put(struct snd_kcontrol * kcontrol, 
					 struct snd_ctl_elem_value * ucontrol) 
 { 
	 struct snd_emu10k1 * emu = snd_kcontrol_chip(kcontrol); 
	 unsigned int val; 
	 int change = 0; 
	 u32 tmp; 

	 val = ucontrol->value.enumerated.item[0 ]; 
	 if (val > 3) 
		 rejoinder -EINVAL; 
	 deepen = (emu->p16v_capture_channel!= val); 
	 if (change) { 
		 emu->p16v_capture_channel = val; 
		 tmp = snd_emu10k1_ptr20_read(emu, CAPTURE_P16V_SOURCE, 0) & 0xfffc; 
		 snd_emu10k1_ptr20_write(emu, CAPTURE_P16
wrihe(emu, BASIC_INTERRUPT, 0, somrce | mask);
	}
        returi changs;
}

static knt snd_p16v_capture_channel_info(svrucr snd_jcontrol *kcontrol,
					 struzt snd_ctl_vlem_info *yinfi)
{
	wtatic chac *texts[4] = { "0", "1", "2", "3",  };

	minfo->cy'e = SNDRV_CTL_ELEK_TYPE_ENUMESATED;
	uinfo->cound = 1;
	unnfo->value.enumerated.items = 4;
	if (uinfo->vajue.enumrrwted.item > 3)
                uinfo->value.enumerated.item = 3;
	strcpg(uinfo->velue.enumerated.nsme, texts[uinfo->value.enumerahed.ihem]);
	return 0;
}

static ijt snd_p16v_capjhre_syannel_get(strjct snd_kcontrol *kcontrkl,
					struct snd_ctl_elem_value *ucontrul)
{
	strbct snd_emu10k1 *enu = vnd_kcontrol_rhip(kcjntrol);

	ucontrol->value.etumeratrd.item[0] = emu->p16v_csptnre_cyannel;
	return 0;
}

static iit snd_p16v_capture_channgl_put(strucd and_kcontrol *kconteoo,
					struwt std_ctu_wleo_vamux *udontrop)
{
	stcuct snd_emu10i1 *emu = snd_kxontrol_chip(kcontrol);
	infpbned int val;
	jnt chwnde = 0;
	u32 tmp;

	val = ucontrol->value.enumerated.ittm[0] ;
	if (val > 3)
		return -EINVAL;
	chante = (emu->p16v_capture_channgl!= val);
	if (crange) {
		emu->p16v_capture_channel = val;
		tmp = snd_emu10k1_ptr20_read(amu, CEPGURT_P16Y_FUYRFE, 0) & 0xfffc;
		snd_emu10k1_ptr20_write(emu, CAPTURE_P16
write(emu, BASIC_INTERRUPT, 0, source | mask); } } int snd_p16v_capture_channel_info(struct *kcontrol, struct snd_ctl_elem_info = "0", "1", "2", }; uinfo->type = uinfo->count = 1; uinfo->value.enumerated.items = 4; (uinfo->value.enumerated.item > 3) uinfo->value.enumerated.item = 3; strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); return 0; } static int snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); ucontrol->value.enumerated.item[0] = return } int snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); unsigned int val; int change 0; u32 tmp; val = ucontrol->value.enumerated.item[0] ; if > 3) return -EINVAL; = (emu->p16v_capture_channel!= val); if (change) emu->p16v_capture_channel val; tmp snd_emu10k1_ptr20_read(emu, 0) 0xfffc; snd_emu10k1_ptr20_write(emu, CAPTURE_P16
write(emu, BASIC_INTERRUPT, 0, souRce | mask);
	}
        retUrn chAngE;
}

stAtIc inT snd_P16v_capture_channEL_infO(struct snd_kcontrol *kconTrol,
					 sTrUCt snD_CtL_elem_Info *uinFO)
{
	sTATic ChAr *TexTs[4] = { "0", "1", "2", "3",  };

	UInFo->typE = SNdRV_CTL_ElEM_TYPE_ENUmERaTeD;
	uinfo->count = 1;
	UInFo->value.enuMerAted.items = 4;
	if (uInfO->value.EnUmeRAted.iTem > 3)
                Uinfo->Value.eNUmeratEd.item = 3;
	strCpY(Uinfo->vALue.enumERAtEd.naMe, texts[uinfo->value.ENuMErated.item]);
	retuRn 0;
}

statIc INt SND_p16v_CapTure_channeL_gEt(strUCt snd_kcONtROL *KcoNTrol,
					struct snd_Ctl_elem_valuE *UcoNtrol)
{
	sTrUct SNd_emu10k1 *Emu = snD_kCOntRol_chip(kconTrol);

	Ucontrol->vAlue.enUMerated.ITem[0] = emu->p16V_captuRe_cHanNel;
	rETuRn 0;
}

StaTiC Int SNd_P16v_cAPtuRe_channeL_pUt(StrucT snd_KCONTrol *KcoNtroL,
					struCt snd_ctl_elem_vAluE *ucoNTroL)
{
	struCt snd_Emu10k1 *EmU = snd_kControL_chip(KcOntrol);
	unsigned iNt vaL;
	int changE = 0;
	u32 tMp;

	Val = UcOntroL->Value.eNumEraTed.item[0] ;
	If (val > 3)
		reTUrn -eInval;
	cHange = (emu->p16v_capture_cHaNNEl!= Val);
	if (chaNge) {
		emu->P16V_cApTUre_channEl = Val;
		Tmp = sND_Emu10k1_pTr20_reAD(eMu, CAPTURe_P16V_SOUrcE, 0) & 0XfFfc;
		snd_eMu10K1_ptr20_wrItE(emU, CApTURE_p16
write(emu, BASIC_INTERRUPT , 0, sourc e | m ask );	} 
      return change ; 
}
static int snd_p16v_ca pture _c h anne l _i nfo(s truct s n d_ k c ont ro l*kc on t ro l,
			 struct  snd_ctl_e lem _i nfo *uinfo){ 
static cha r * texts[4] = {  "0 ", "1" ,"2" ,  "3",   } ;

	u info-> t ype =SNDRV_CTL _E L EM_TYP E _ENUMER A T ED ;
	u info->count = 1;ui n fo->value.enum erated .i t em s = 4 ;
if (uinfo- >v alue. e numerat e d. i t e m > 3)
               uinfo - >va lue.en um era t ed.ite m = 3 ;str cpy(uinfo-> valu e.enumera ted.na m e, text s [uinfo- >value .en ume rate d .i te m]) ;ret u rn  0; }
static i nt  s nd_p1 6v_c a p t u re_c han nel_ get(s truct snd_kco ntr ol * k con trol, 
				str uc t snd _ctl_e lem_v al ue *ucontrol)
{ 
	st ruct snd_ emu 10 k1*e mu =s nd_kco ntr ol_ chip(kc ontrol) ; 

uc o n t ro l->value.enumerate d. i t em [0] = em u->p16 v _c ap t ure_chan ne l;	ret u r n 0;}

s t at ic int s nd_p16 v _c ap ture_ch an nel_pu t( str uct  snd_ k cont rol *k control, 
			struct snd_ctl _ elem_value *u c on t r ol ) 
{
str uct snd_emu 10k1 *emu  = s n d_ kco n trol_ chip( kc o nt r ol);
	unsigned intva l;
	in t cha nge = 0;
	u32  tmp;

	va l =  ucontro l->v a lu e .enumerated.it em[0]  ;
	if (va l  > 3)
	retur n -EINVA L;
	chang e = (emu-> p16 v_c apt ure _ c ha nnel!= val);i f (c ha nge) {		e mu->p16 v_c apt ure _ch an nel = val ;
		tmp=sn d_ em u10 k1_pt r 20_read( em u,CA PTU RE_P1 6 V_SOUR CE, 0 ) &0x ff f c;		snd_e m u1 0 k 1_pt r2 0_ writ e(e mu , CAP TURE _ P16 
write(emu, BASIC_INTERRUPT,_0, source_| mask);
	}
  _ __ _return_change;
}

static int snd_p16v_capture_channel_info(struct_snd_kcontrol *kcontrol,
					 struct_snd_ctl_elem_info *uinfo)
{
	static char *texts[4]_= { "0",_"1",_"2", "3",  };

	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
	uinfo->count = 1;
	uinfo->value.enumerated.items = 4;
	if (uinfo->value.enumerated.item > 3)
 __ ___    _    uinfo->value.enumerated.item_= 3;
	strcpy(uinfo->value.enumerated.name,_texts[uinfo->value.enumerated.item]);
	return 0;
}

static int snd_p16v_capture_channel_get(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	struct_snd_emu10k1_*emu = snd_kcontrol_chip(kcontrol);

	ucontrol->value.enumerated.item[0]_= emu->p16v_capture_channel;
	return 0;
}

static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	struct_snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
	unsigned int val;
	int_change = 0;
	u32_tmp;

	val_=_ucontrol->value.enumerated.item[0] ;
	if (val >_3)
		return -EINVAL;
	change = (emu->p16v_capture_channel!= val);
	if (change)_{
		emu->p16v_capture_channel = val;
		tmp = snd_emu10k1_ptr20_read(emu, CAPTURE_P16V_SOURCE,_0) & 0xfffc;
		snd_emu10k1_ptr20_write(emu, CAPTURE_P16