} 
} } 
static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol){	snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol);	unsigned long flags;	int change, addr = kcontrol->private_value;	int left, right;        u32 anabar, xbarin;	int analog_io, rate;	struct saa7134_dev *dev;	dev = chip->saadev;	left = ucontrol->value.integer.value[0] & 1;	right = ucontrol->value.integer.value[1] & 1;	spin_lock_irqsave(&chip->mixer_lock, flags);	change = chip->capture_source[addr][0] != left &&	         chip->capture_source[addr][1] != right;	chip->capture_source[addr][0] = left;	chip->capture_source[addr][1] = right;	dev->oss.input=addr;	spin_unlock_irqrestore(&chip->mixer_lock, flags);        switch (dev->pci->device) {	   case PCI_DEVICE_ID_PHILIPS_SAA7134:        	switch (addr) {        		case MIXER_ADDR_TVTUNER:                		saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0xc0);                		saa_andorb(SAA7134_SIF_SAMPLE_FREQ,   0x03, 0x00);                		break;        		case MIXER_ADDR_LINE1:        		case MIXER_ADDR_LINE2:                		analog_io = (MIXER_ADDR_LINE1 == addr) ? 0x00 : 0x08;                		rate = (32000 == dev->oss.rate) ? 0x01 : 0x03;                		saa_andorb(SAA7134_ANALOG_IO_SELECT,  0x08, analog_io);                		saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0x80);                		saa_andorb(SAA7134_SIF_SAMPLE_FREQ,   0x03, rate);                		break;        	}	   case PCI_DEVICE_ID_PHILIPS_SAA7133:	   case PCI_DEVICE_ID_PHILIPS_SAA7135:        	xbarin = 0x03; // adc		anabar = 0; 	        switch (addr) {	        	case MIXER_ADDR_TVTUNER:	                	xbarin = 0; // Demodulator	        		anabar = 2; // DACs	                	break;	        	case MIXER_ADDR_LINE1:	                	anabar = 0;  // aux1, aux1	                	break;	        	case MIXER_ADDR_LINE2:	                	anabar = 9;  // aux2, aux2	                	break;	        }	    	/* output xbar always main channel */	        saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL1, 0xbbbb10);		if (left || right) { // We've got data, turn the input on	          //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010);	          saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, xbarin);	          saa_writel(SAA7133_ANALOG_IO_SELECT, anabar);		} else {	          //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010);	          saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, 0);	          saa_writel(SAA7133_ANALOG_IO_SELECT, 0);		}	}	return change;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b2c15ea9b23c216bb49303c076bbdcef7e7ba278/saa7134-alsa.c/clean/drivers/media/video/saa7134/saa7134-alsa.c