ensoniq           141 sound/pci/ens1370.c #define ES_REG(ensoniq, x) ((ensoniq)->port + ES_REG_##x)
ensoniq           520 sound/pci/ens1370.c 		r = inl(ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           526 sound/pci/ens1370.c 		   ES_REG(ensoniq, 1371_SMPRATE), r);
ensoniq           535 sound/pci/ens1370.c 	temp = orig = snd_es1371_wait_src_ready(ensoniq);
ensoniq           541 sound/pci/ens1370.c 	outl(r, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           544 sound/pci/ens1370.c 	temp = snd_es1371_wait_src_ready(ensoniq);
ensoniq           549 sound/pci/ens1370.c 			temp = inl(ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           559 sound/pci/ens1370.c 	outl(r, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           569 sound/pci/ens1370.c 	r = snd_es1371_wait_src_ready(ensoniq) &
ensoniq           573 sound/pci/ens1370.c 	outl(r | ES_1371_SRC_RAM_WE, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           583 sound/pci/ens1370.c 	struct ensoniq *ensoniq = ak4531->private_data;
ensoniq           588 sound/pci/ens1370.c 	       reg, val, ES_1370_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1370_CODEC));
ensoniq           591 sound/pci/ens1370.c 		if (!(inl(ES_REG(ensoniq, STATUS)) & ES_1370_CSTAT)) {
ensoniq           592 sound/pci/ens1370.c 			outw(ES_1370_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1370_CODEC));
ensoniq           598 sound/pci/ens1370.c 		   inl(ES_REG(ensoniq, STATUS)));
ensoniq           608 sound/pci/ens1370.c 	struct ensoniq *ensoniq = ac97->private_data;
ensoniq           611 sound/pci/ens1370.c 	mutex_lock(&ensoniq->src_mutex);
ensoniq           613 sound/pci/ens1370.c 		if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
ensoniq           615 sound/pci/ens1370.c 			x = snd_es1371_wait_src_ready(ensoniq);
ensoniq           618 sound/pci/ens1370.c 			     ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           622 sound/pci/ens1370.c 				if ((inl(ES_REG(ensoniq, 1371_SMPRATE)) & 0x00870000) ==
ensoniq           628 sound/pci/ens1370.c 				if ((inl(ES_REG(ensoniq, 1371_SMPRATE)) & 0x00870000) ==
ensoniq           632 sound/pci/ens1370.c 			outl(ES_1371_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1371_CODEC));
ensoniq           634 sound/pci/ens1370.c 			snd_es1371_wait_src_ready(ensoniq);
ensoniq           635 sound/pci/ens1370.c 			outl(x, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           636 sound/pci/ens1370.c 			mutex_unlock(&ensoniq->src_mutex);
ensoniq           640 sound/pci/ens1370.c 	mutex_unlock(&ensoniq->src_mutex);
ensoniq           642 sound/pci/ens1370.c 		   ES_REG(ensoniq, 1371_CODEC), inl(ES_REG(ensoniq, 1371_CODEC)));
ensoniq           648 sound/pci/ens1370.c 	struct ensoniq *ensoniq = ac97->private_data;
ensoniq           652 sound/pci/ens1370.c 	mutex_lock(&ensoniq->src_mutex);
ensoniq           654 sound/pci/ens1370.c 		if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
ensoniq           656 sound/pci/ens1370.c 			x = snd_es1371_wait_src_ready(ensoniq);
ensoniq           659 sound/pci/ens1370.c 			     ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           663 sound/pci/ens1370.c 				if ((inl(ES_REG(ensoniq, 1371_SMPRATE)) & 0x00870000) ==
ensoniq           669 sound/pci/ens1370.c 				if ((inl(ES_REG(ensoniq, 1371_SMPRATE)) & 0x00870000) ==
ensoniq           673 sound/pci/ens1370.c 			outl(ES_1371_CODEC_READS(reg), ES_REG(ensoniq, 1371_CODEC));
ensoniq           675 sound/pci/ens1370.c 			snd_es1371_wait_src_ready(ensoniq);
ensoniq           676 sound/pci/ens1370.c 			outl(x, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           679 sound/pci/ens1370.c 				if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP))
ensoniq           684 sound/pci/ens1370.c 				if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) {
ensoniq           685 sound/pci/ens1370.c 					mutex_unlock(&ensoniq->src_mutex);
ensoniq           689 sound/pci/ens1370.c 			mutex_unlock(&ensoniq->src_mutex);
ensoniq           693 sound/pci/ens1370.c 					   ES_REG(ensoniq, 1371_CODEC), reg,
ensoniq           694 sound/pci/ens1370.c 					   inl(ES_REG(ensoniq, 1371_CODEC)));
ensoniq           700 sound/pci/ens1370.c 	mutex_unlock(&ensoniq->src_mutex);
ensoniq           702 sound/pci/ens1370.c 		   ES_REG(ensoniq, 1371_CODEC), inl(ES_REG(ensoniq, 1371_CODEC)));
ensoniq           719 sound/pci/ens1370.c 	mutex_lock(&ensoniq->src_mutex);
ensoniq           729 sound/pci/ens1370.c 		snd_es1371_src_write(ensoniq, ES_SMPREG_ADC + ES_SMPREG_TRUNC_N,
ensoniq           734 sound/pci/ens1370.c 		snd_es1371_src_write(ensoniq, ES_SMPREG_ADC + ES_SMPREG_TRUNC_N,
ensoniq           737 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_ADC + ES_SMPREG_INT_REGS,
ensoniq           738 sound/pci/ens1370.c 			     (snd_es1371_src_read(ensoniq, ES_SMPREG_ADC +
ensoniq           741 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_ADC + ES_SMPREG_VFREQ_FRAC, freq & 0x7fff);
ensoniq           742 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_ADC, n << 8);
ensoniq           743 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_ADC + 1, n << 8);
ensoniq           744 sound/pci/ens1370.c 	mutex_unlock(&ensoniq->src_mutex);
ensoniq           751 sound/pci/ens1370.c 	mutex_lock(&ensoniq->src_mutex);
ensoniq           753 sound/pci/ens1370.c 	r = (snd_es1371_wait_src_ready(ensoniq) & (ES_1371_SRC_DISABLE |
ensoniq           756 sound/pci/ens1370.c 	outl(r, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           757 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_DAC1 + ES_SMPREG_INT_REGS,
ensoniq           758 sound/pci/ens1370.c 			     (snd_es1371_src_read(ensoniq, ES_SMPREG_DAC1 +
ensoniq           761 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_DAC1 + ES_SMPREG_VFREQ_FRAC, freq & 0x7fff);
ensoniq           762 sound/pci/ens1370.c 	r = (snd_es1371_wait_src_ready(ensoniq) & (ES_1371_SRC_DISABLE |
ensoniq           764 sound/pci/ens1370.c 	outl(r, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           765 sound/pci/ens1370.c 	mutex_unlock(&ensoniq->src_mutex);
ensoniq           772 sound/pci/ens1370.c 	mutex_lock(&ensoniq->src_mutex);
ensoniq           774 sound/pci/ens1370.c 	r = (snd_es1371_wait_src_ready(ensoniq) & (ES_1371_SRC_DISABLE |
ensoniq           777 sound/pci/ens1370.c 	outl(r, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           778 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_DAC2 + ES_SMPREG_INT_REGS,
ensoniq           779 sound/pci/ens1370.c 			     (snd_es1371_src_read(ensoniq, ES_SMPREG_DAC2 +
ensoniq           782 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_DAC2 + ES_SMPREG_VFREQ_FRAC,
ensoniq           784 sound/pci/ens1370.c 	r = (snd_es1371_wait_src_ready(ensoniq) & (ES_1371_SRC_DISABLE |
ensoniq           786 sound/pci/ens1370.c 	outl(r, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq           787 sound/pci/ens1370.c 	mutex_unlock(&ensoniq->src_mutex);
ensoniq           794 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq           802 sound/pci/ens1370.c 			if (s == ensoniq->playback1_substream) {
ensoniq           805 sound/pci/ens1370.c 			} else if (s == ensoniq->playback2_substream) {
ensoniq           808 sound/pci/ens1370.c 			} else if (s == ensoniq->capture_substream)
ensoniq           811 sound/pci/ens1370.c 		spin_lock(&ensoniq->reg_lock);
ensoniq           813 sound/pci/ens1370.c 			ensoniq->sctrl |= what;
ensoniq           815 sound/pci/ens1370.c 			ensoniq->sctrl &= ~what;
ensoniq           816 sound/pci/ens1370.c 		outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
ensoniq           817 sound/pci/ens1370.c 		spin_unlock(&ensoniq->reg_lock);
ensoniq           826 sound/pci/ens1370.c 			if (s == ensoniq->playback1_substream) {
ensoniq           829 sound/pci/ens1370.c 			} else if (s == ensoniq->playback2_substream) {
ensoniq           832 sound/pci/ens1370.c 			} else if (s == ensoniq->capture_substream) {
ensoniq           837 sound/pci/ens1370.c 		spin_lock(&ensoniq->reg_lock);
ensoniq           839 sound/pci/ens1370.c 			ensoniq->ctrl |= what;
ensoniq           841 sound/pci/ens1370.c 			ensoniq->ctrl &= ~what;
ensoniq           842 sound/pci/ens1370.c 		outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq           843 sound/pci/ens1370.c 		spin_unlock(&ensoniq->reg_lock);
ensoniq           869 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq           873 sound/pci/ens1370.c 	ensoniq->p1_dma_size = snd_pcm_lib_buffer_bytes(substream);
ensoniq           874 sound/pci/ens1370.c 	ensoniq->p1_period_size = snd_pcm_lib_period_bytes(substream);
ensoniq           879 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq           880 sound/pci/ens1370.c 	ensoniq->ctrl &= ~ES_DAC1_EN;
ensoniq           884 sound/pci/ens1370.c 		ensoniq->ctrl |= ES_1373_BYPASS_P1;
ensoniq           886 sound/pci/ens1370.c 		ensoniq->ctrl &= ~ES_1373_BYPASS_P1;
ensoniq           888 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq           889 sound/pci/ens1370.c 	outl(ES_MEM_PAGEO(ES_PAGE_DAC), ES_REG(ensoniq, MEM_PAGE));
ensoniq           890 sound/pci/ens1370.c 	outl(runtime->dma_addr, ES_REG(ensoniq, DAC1_FRAME));
ensoniq           891 sound/pci/ens1370.c 	outl((ensoniq->p1_dma_size >> 2) - 1, ES_REG(ensoniq, DAC1_SIZE));
ensoniq           892 sound/pci/ens1370.c 	ensoniq->sctrl &= ~(ES_P1_LOOP_SEL | ES_P1_PAUSE | ES_P1_SCT_RLD | ES_P1_MODEM);
ensoniq           893 sound/pci/ens1370.c 	ensoniq->sctrl |= ES_P1_INT_EN | ES_P1_MODEO(mode);
ensoniq           894 sound/pci/ens1370.c 	outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
ensoniq           895 sound/pci/ens1370.c 	outl((ensoniq->p1_period_size >> snd_ensoniq_sample_shift[mode]) - 1,
ensoniq           896 sound/pci/ens1370.c 	     ES_REG(ensoniq, DAC1_COUNT));
ensoniq           898 sound/pci/ens1370.c 	ensoniq->ctrl &= ~ES_1370_WTSRSELM;
ensoniq           900 sound/pci/ens1370.c 	case 5512: ensoniq->ctrl |= ES_1370_WTSRSEL(0); break;
ensoniq           901 sound/pci/ens1370.c 	case 11025: ensoniq->ctrl |= ES_1370_WTSRSEL(1); break;
ensoniq           902 sound/pci/ens1370.c 	case 22050: ensoniq->ctrl |= ES_1370_WTSRSEL(2); break;
ensoniq           903 sound/pci/ens1370.c 	case 44100: ensoniq->ctrl |= ES_1370_WTSRSEL(3); break;
ensoniq           907 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq           908 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq           910 sound/pci/ens1370.c 	snd_es1371_dac1_rate(ensoniq, runtime->rate);
ensoniq           917 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq           921 sound/pci/ens1370.c 	ensoniq->p2_dma_size = snd_pcm_lib_buffer_bytes(substream);
ensoniq           922 sound/pci/ens1370.c 	ensoniq->p2_period_size = snd_pcm_lib_period_bytes(substream);
ensoniq           927 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq           928 sound/pci/ens1370.c 	ensoniq->ctrl &= ~ES_DAC2_EN;
ensoniq           929 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq           930 sound/pci/ens1370.c 	outl(ES_MEM_PAGEO(ES_PAGE_DAC), ES_REG(ensoniq, MEM_PAGE));
ensoniq           931 sound/pci/ens1370.c 	outl(runtime->dma_addr, ES_REG(ensoniq, DAC2_FRAME));
ensoniq           932 sound/pci/ens1370.c 	outl((ensoniq->p2_dma_size >> 2) - 1, ES_REG(ensoniq, DAC2_SIZE));
ensoniq           933 sound/pci/ens1370.c 	ensoniq->sctrl &= ~(ES_P2_LOOP_SEL | ES_P2_PAUSE | ES_P2_DAC_SEN |
ensoniq           935 sound/pci/ens1370.c 	ensoniq->sctrl |= ES_P2_INT_EN | ES_P2_MODEO(mode) |
ensoniq           937 sound/pci/ens1370.c 	outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
ensoniq           938 sound/pci/ens1370.c 	outl((ensoniq->p2_period_size >> snd_ensoniq_sample_shift[mode]) - 1,
ensoniq           939 sound/pci/ens1370.c 	     ES_REG(ensoniq, DAC2_COUNT));
ensoniq           941 sound/pci/ens1370.c 	if (!(ensoniq->u.es1370.pclkdiv_lock & ES_MODE_CAPTURE)) {
ensoniq           942 sound/pci/ens1370.c 		ensoniq->ctrl &= ~ES_1370_PCLKDIVM;
ensoniq           943 sound/pci/ens1370.c 		ensoniq->ctrl |= ES_1370_PCLKDIVO(ES_1370_SRTODIV(runtime->rate));
ensoniq           944 sound/pci/ens1370.c 		ensoniq->u.es1370.pclkdiv_lock |= ES_MODE_PLAY2;
ensoniq           947 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq           948 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq           950 sound/pci/ens1370.c 	snd_es1371_dac2_rate(ensoniq, runtime->rate);
ensoniq           957 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq           961 sound/pci/ens1370.c 	ensoniq->c_dma_size = snd_pcm_lib_buffer_bytes(substream);
ensoniq           962 sound/pci/ens1370.c 	ensoniq->c_period_size = snd_pcm_lib_period_bytes(substream);
ensoniq           967 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq           968 sound/pci/ens1370.c 	ensoniq->ctrl &= ~ES_ADC_EN;
ensoniq           969 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq           970 sound/pci/ens1370.c 	outl(ES_MEM_PAGEO(ES_PAGE_ADC), ES_REG(ensoniq, MEM_PAGE));
ensoniq           971 sound/pci/ens1370.c 	outl(runtime->dma_addr, ES_REG(ensoniq, ADC_FRAME));
ensoniq           972 sound/pci/ens1370.c 	outl((ensoniq->c_dma_size >> 2) - 1, ES_REG(ensoniq, ADC_SIZE));
ensoniq           973 sound/pci/ens1370.c 	ensoniq->sctrl &= ~(ES_R1_LOOP_SEL | ES_R1_MODEM);
ensoniq           974 sound/pci/ens1370.c 	ensoniq->sctrl |= ES_R1_INT_EN | ES_R1_MODEO(mode);
ensoniq           975 sound/pci/ens1370.c 	outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
ensoniq           976 sound/pci/ens1370.c 	outl((ensoniq->c_period_size >> snd_ensoniq_sample_shift[mode]) - 1,
ensoniq           977 sound/pci/ens1370.c 	     ES_REG(ensoniq, ADC_COUNT));
ensoniq           979 sound/pci/ens1370.c 	if (!(ensoniq->u.es1370.pclkdiv_lock & ES_MODE_PLAY2)) {
ensoniq           980 sound/pci/ens1370.c 		ensoniq->ctrl &= ~ES_1370_PCLKDIVM;
ensoniq           981 sound/pci/ens1370.c 		ensoniq->ctrl |= ES_1370_PCLKDIVO(ES_1370_SRTODIV(runtime->rate));
ensoniq           982 sound/pci/ens1370.c 		ensoniq->u.es1370.pclkdiv_lock |= ES_MODE_CAPTURE;
ensoniq           985 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq           986 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq           988 sound/pci/ens1370.c 	snd_es1371_adc_rate(ensoniq, runtime->rate);
ensoniq           995 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq           998 sound/pci/ens1370.c 	spin_lock(&ensoniq->reg_lock);
ensoniq           999 sound/pci/ens1370.c 	if (inl(ES_REG(ensoniq, CONTROL)) & ES_DAC1_EN) {
ensoniq          1000 sound/pci/ens1370.c 		outl(ES_MEM_PAGEO(ES_PAGE_DAC), ES_REG(ensoniq, MEM_PAGE));
ensoniq          1001 sound/pci/ens1370.c 		ptr = ES_REG_FCURR_COUNTI(inl(ES_REG(ensoniq, DAC1_SIZE)));
ensoniq          1006 sound/pci/ens1370.c 	spin_unlock(&ensoniq->reg_lock);
ensoniq          1012 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq          1015 sound/pci/ens1370.c 	spin_lock(&ensoniq->reg_lock);
ensoniq          1016 sound/pci/ens1370.c 	if (inl(ES_REG(ensoniq, CONTROL)) & ES_DAC2_EN) {
ensoniq          1017 sound/pci/ens1370.c 		outl(ES_MEM_PAGEO(ES_PAGE_DAC), ES_REG(ensoniq, MEM_PAGE));
ensoniq          1018 sound/pci/ens1370.c 		ptr = ES_REG_FCURR_COUNTI(inl(ES_REG(ensoniq, DAC2_SIZE)));
ensoniq          1023 sound/pci/ens1370.c 	spin_unlock(&ensoniq->reg_lock);
ensoniq          1029 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq          1032 sound/pci/ens1370.c 	spin_lock(&ensoniq->reg_lock);
ensoniq          1033 sound/pci/ens1370.c 	if (inl(ES_REG(ensoniq, CONTROL)) & ES_ADC_EN) {
ensoniq          1034 sound/pci/ens1370.c 		outl(ES_MEM_PAGEO(ES_PAGE_ADC), ES_REG(ensoniq, MEM_PAGE));
ensoniq          1035 sound/pci/ens1370.c 		ptr = ES_REG_FCURR_COUNTI(inl(ES_REG(ensoniq, ADC_SIZE)));
ensoniq          1040 sound/pci/ens1370.c 	spin_unlock(&ensoniq->reg_lock);
ensoniq          1112 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq          1115 sound/pci/ens1370.c 	ensoniq->mode |= ES_MODE_PLAY1;
ensoniq          1116 sound/pci/ens1370.c 	ensoniq->playback1_substream = substream;
ensoniq          1119 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1120 sound/pci/ens1370.c 	if (ensoniq->spdif && ensoniq->playback2_substream == NULL)
ensoniq          1121 sound/pci/ens1370.c 		ensoniq->spdif_stream = ensoniq->spdif_default;
ensoniq          1122 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1135 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq          1138 sound/pci/ens1370.c 	ensoniq->mode |= ES_MODE_PLAY2;
ensoniq          1139 sound/pci/ens1370.c 	ensoniq->playback2_substream = substream;
ensoniq          1142 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1143 sound/pci/ens1370.c 	if (ensoniq->spdif && ensoniq->playback1_substream == NULL)
ensoniq          1144 sound/pci/ens1370.c 		ensoniq->spdif_stream = ensoniq->spdif_default;
ensoniq          1145 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1158 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq          1161 sound/pci/ens1370.c 	ensoniq->mode |= ES_MODE_CAPTURE;
ensoniq          1162 sound/pci/ens1370.c 	ensoniq->capture_substream = substream;
ensoniq          1177 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq          1179 sound/pci/ens1370.c 	ensoniq->playback1_substream = NULL;
ensoniq          1180 sound/pci/ens1370.c 	ensoniq->mode &= ~ES_MODE_PLAY1;
ensoniq          1186 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq          1188 sound/pci/ens1370.c 	ensoniq->playback2_substream = NULL;
ensoniq          1189 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1191 sound/pci/ens1370.c 	ensoniq->u.es1370.pclkdiv_lock &= ~ES_MODE_PLAY2;
ensoniq          1193 sound/pci/ens1370.c 	ensoniq->mode &= ~ES_MODE_PLAY2;
ensoniq          1194 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1200 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_pcm_substream_chip(substream);
ensoniq          1202 sound/pci/ens1370.c 	ensoniq->capture_substream = NULL;
ensoniq          1203 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1205 sound/pci/ens1370.c 	ensoniq->u.es1370.pclkdiv_lock &= ~ES_MODE_CAPTURE;
ensoniq          1207 sound/pci/ens1370.c 	ensoniq->mode &= ~ES_MODE_CAPTURE;
ensoniq          1208 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1254 sound/pci/ens1370.c 	err = snd_pcm_new(ensoniq->card, "ES1370/1", device, 1, 1, &pcm);
ensoniq          1256 sound/pci/ens1370.c 	err = snd_pcm_new(ensoniq->card, "ES1371/1", device, 1, 1, &pcm);
ensoniq          1268 sound/pci/ens1370.c 	pcm->private_data = ensoniq;
ensoniq          1275 sound/pci/ens1370.c 	ensoniq->pcm1 = pcm;
ensoniq          1278 sound/pci/ens1370.c 					      snd_dma_pci_data(ensoniq->pci), 64*1024, 128*1024);
ensoniq          1294 sound/pci/ens1370.c 	err = snd_pcm_new(ensoniq->card, "ES1370/2", device, 1, 0, &pcm);
ensoniq          1296 sound/pci/ens1370.c 	err = snd_pcm_new(ensoniq->card, "ES1371/2", device, 1, 0, &pcm);
ensoniq          1306 sound/pci/ens1370.c 	pcm->private_data = ensoniq;
ensoniq          1313 sound/pci/ens1370.c 	ensoniq->pcm2 = pcm;
ensoniq          1316 sound/pci/ens1370.c 					      snd_dma_pci_data(ensoniq->pci), 64*1024, 128*1024);
ensoniq          1342 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1343 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1344 sound/pci/ens1370.c 	ucontrol->value.iec958.status[0] = (ensoniq->spdif_default >> 0) & 0xff;
ensoniq          1345 sound/pci/ens1370.c 	ucontrol->value.iec958.status[1] = (ensoniq->spdif_default >> 8) & 0xff;
ensoniq          1346 sound/pci/ens1370.c 	ucontrol->value.iec958.status[2] = (ensoniq->spdif_default >> 16) & 0xff;
ensoniq          1347 sound/pci/ens1370.c 	ucontrol->value.iec958.status[3] = (ensoniq->spdif_default >> 24) & 0xff;
ensoniq          1348 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1355 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1363 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1364 sound/pci/ens1370.c 	change = ensoniq->spdif_default != val;
ensoniq          1365 sound/pci/ens1370.c 	ensoniq->spdif_default = val;
ensoniq          1366 sound/pci/ens1370.c 	if (change && ensoniq->playback1_substream == NULL &&
ensoniq          1367 sound/pci/ens1370.c 	    ensoniq->playback2_substream == NULL)
ensoniq          1368 sound/pci/ens1370.c 		outl(val, ES_REG(ensoniq, CHANNEL_STATUS));
ensoniq          1369 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1386 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1387 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1388 sound/pci/ens1370.c 	ucontrol->value.iec958.status[0] = (ensoniq->spdif_stream >> 0) & 0xff;
ensoniq          1389 sound/pci/ens1370.c 	ucontrol->value.iec958.status[1] = (ensoniq->spdif_stream >> 8) & 0xff;
ensoniq          1390 sound/pci/ens1370.c 	ucontrol->value.iec958.status[2] = (ensoniq->spdif_stream >> 16) & 0xff;
ensoniq          1391 sound/pci/ens1370.c 	ucontrol->value.iec958.status[3] = (ensoniq->spdif_stream >> 24) & 0xff;
ensoniq          1392 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1399 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1407 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1408 sound/pci/ens1370.c 	change = ensoniq->spdif_stream != val;
ensoniq          1409 sound/pci/ens1370.c 	ensoniq->spdif_stream = val;
ensoniq          1410 sound/pci/ens1370.c 	if (change && (ensoniq->playback1_substream != NULL ||
ensoniq          1411 sound/pci/ens1370.c 		       ensoniq->playback2_substream != NULL))
ensoniq          1412 sound/pci/ens1370.c 		outl(val, ES_REG(ensoniq, CHANNEL_STATUS));
ensoniq          1413 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1426 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1428 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1429 sound/pci/ens1370.c 	ucontrol->value.integer.value[0] = ensoniq->ctrl & ES_1373_SPDIF_THRU ? 1 : 0;
ensoniq          1430 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1437 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1443 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1444 sound/pci/ens1370.c 	change = (ensoniq->ctrl & ES_1373_SPDIF_THRU) != nval1;
ensoniq          1445 sound/pci/ens1370.c 	ensoniq->ctrl &= ~ES_1373_SPDIF_THRU;
ensoniq          1446 sound/pci/ens1370.c 	ensoniq->ctrl |= nval1;
ensoniq          1447 sound/pci/ens1370.c 	ensoniq->cssr &= ~ES_1373_SPDIF_EN;
ensoniq          1448 sound/pci/ens1370.c 	ensoniq->cssr |= nval2;
ensoniq          1449 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq          1450 sound/pci/ens1370.c 	outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
ensoniq          1451 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1488 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1491 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1492 sound/pci/ens1370.c 	if ((ensoniq->cssr & (ES_1373_REAR_BIT27|ES_1373_REAR_BIT26|
ensoniq          1496 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1503 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1509 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1510 sound/pci/ens1370.c 	change = (ensoniq->cssr & (ES_1373_REAR_BIT27|
ensoniq          1512 sound/pci/ens1370.c 	ensoniq->cssr &= ~(ES_1373_REAR_BIT27|ES_1373_REAR_BIT26|ES_1373_REAR_BIT24);
ensoniq          1513 sound/pci/ens1370.c 	ensoniq->cssr |= nval1;
ensoniq          1514 sound/pci/ens1370.c 	outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
ensoniq          1515 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1533 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1536 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1537 sound/pci/ens1370.c 	if ((ensoniq->ctrl & ES_1371_GPIO_OUTM) >= 4)
ensoniq          1540 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1547 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1551 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1552 sound/pci/ens1370.c 	ctrl = ensoniq->ctrl;
ensoniq          1554 sound/pci/ens1370.c 		ensoniq->ctrl |= ES_1371_GPIO_OUT(4);	/* switch line-in -> rear out */
ensoniq          1556 sound/pci/ens1370.c 		ensoniq->ctrl &= ~ES_1371_GPIO_OUT(4);
ensoniq          1557 sound/pci/ens1370.c 	changed = (ctrl != ensoniq->ctrl);
ensoniq          1559 sound/pci/ens1370.c 		outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq          1560 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1575 sound/pci/ens1370.c 	struct ensoniq *ensoniq = ac97->private_data;
ensoniq          1576 sound/pci/ens1370.c 	ensoniq->u.es1371.ac97 = NULL;
ensoniq          1589 sound/pci/ens1370.c 		if (ensoniq->pci->vendor == list->vid &&
ensoniq          1590 sound/pci/ens1370.c 		    ensoniq->pci->device == list->did &&
ensoniq          1591 sound/pci/ens1370.c 		    ensoniq->rev == list->rev)
ensoniq          1616 sound/pci/ens1370.c 	struct snd_card *card = ensoniq->card;
ensoniq          1630 sound/pci/ens1370.c 	ac97.private_data = ensoniq;
ensoniq          1632 sound/pci/ens1370.c 	ac97.pci = ensoniq->pci;
ensoniq          1634 sound/pci/ens1370.c 	if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0)
ensoniq          1637 sound/pci/ens1370.c 	    (!has_spdif && es1371_quirk_lookup(ensoniq, es1371_spdif_present))) {
ensoniq          1641 sound/pci/ens1370.c 		ensoniq->spdif_default = ensoniq->spdif_stream =
ensoniq          1643 sound/pci/ens1370.c 		outl(ensoniq->spdif_default, ES_REG(ensoniq, CHANNEL_STATUS));
ensoniq          1645 sound/pci/ens1370.c 		if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SPDIF)
ensoniq          1649 sound/pci/ens1370.c 			kctl = snd_ctl_new1(&snd_es1371_mixer_spdif[i], ensoniq);
ensoniq          1658 sound/pci/ens1370.c 	if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SDAC) {
ensoniq          1660 sound/pci/ens1370.c 		ensoniq->cssr &= ~(ES_1373_REAR_BIT27|ES_1373_REAR_BIT24);
ensoniq          1661 sound/pci/ens1370.c 		ensoniq->cssr |= ES_1373_REAR_BIT26;
ensoniq          1662 sound/pci/ens1370.c 		err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_rear, ensoniq));
ensoniq          1667 sound/pci/ens1370.c 	    snd_pci_quirk_lookup(ensoniq->pci, ens1373_line_quirk)) {
ensoniq          1669 sound/pci/ens1370.c 						      ensoniq));
ensoniq          1691 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1694 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1695 sound/pci/ens1370.c 	ucontrol->value.integer.value[0] = ensoniq->ctrl & mask ? 1 : 0;
ensoniq          1696 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1703 sound/pci/ens1370.c 	struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
ensoniq          1709 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          1710 sound/pci/ens1370.c 	change = (ensoniq->ctrl & mask) != nval;
ensoniq          1711 sound/pci/ens1370.c 	ensoniq->ctrl &= ~mask;
ensoniq          1712 sound/pci/ens1370.c 	ensoniq->ctrl |= nval;
ensoniq          1713 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq          1714 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          1731 sound/pci/ens1370.c 	struct ensoniq *ensoniq = ak4531->private_data;
ensoniq          1732 sound/pci/ens1370.c 	ensoniq->u.es1370.ak4531 = NULL;
ensoniq          1737 sound/pci/ens1370.c 	struct snd_card *card = ensoniq->card;
ensoniq          1743 sound/pci/ens1370.c 	outw(ES_1370_CODEC_WRITE(AK4531_RESET, 0x02), ES_REG(ensoniq, 1370_CODEC));
ensoniq          1744 sound/pci/ens1370.c 	inw(ES_REG(ensoniq, 1370_CODEC));
ensoniq          1746 sound/pci/ens1370.c 	outw(ES_1370_CODEC_WRITE(AK4531_RESET, 0x03), ES_REG(ensoniq, 1370_CODEC));
ensoniq          1747 sound/pci/ens1370.c 	inw(ES_REG(ensoniq, 1370_CODEC));
ensoniq          1752 sound/pci/ens1370.c 	ak4531.private_data = ensoniq;
ensoniq          1754 sound/pci/ens1370.c 	if ((err = snd_ak4531_mixer(card, &ak4531, &ensoniq->u.es1370.ak4531)) < 0)
ensoniq          1757 sound/pci/ens1370.c 		err = snd_ctl_add(card, snd_ctl_new1(&snd_es1370_controls[idx], ensoniq));
ensoniq          1822 sound/pci/ens1370.c 	ensoniq->gameport = gp = gameport_allocate_port();
ensoniq          1830 sound/pci/ens1370.c 	gameport_set_phys(gp, "pci%s/gameport0", pci_name(ensoniq->pci));
ensoniq          1831 sound/pci/ens1370.c 	gameport_set_dev_parent(gp, &ensoniq->pci->dev);
ensoniq          1834 sound/pci/ens1370.c 	ensoniq->ctrl |= ES_JYSTK_EN;
ensoniq          1836 sound/pci/ens1370.c 	ensoniq->ctrl &= ~ES_1371_JOY_ASELM;
ensoniq          1837 sound/pci/ens1370.c 	ensoniq->ctrl |= ES_1371_JOY_ASEL((io_port - 0x200) / 8);
ensoniq          1839 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq          1841 sound/pci/ens1370.c 	gameport_register_port(ensoniq->gameport);
ensoniq          1848 sound/pci/ens1370.c 	if (ensoniq->gameport) {
ensoniq          1849 sound/pci/ens1370.c 		int port = ensoniq->gameport->io;
ensoniq          1851 sound/pci/ens1370.c 		gameport_unregister_port(ensoniq->gameport);
ensoniq          1852 sound/pci/ens1370.c 		ensoniq->gameport = NULL;
ensoniq          1853 sound/pci/ens1370.c 		ensoniq->ctrl &= ~ES_JYSTK_EN;
ensoniq          1854 sound/pci/ens1370.c 		outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq          1870 sound/pci/ens1370.c 	struct ensoniq *ensoniq = entry->private_data;
ensoniq          1878 sound/pci/ens1370.c 		    ensoniq->ctrl & ES_JYSTK_EN ? "on" : "off");
ensoniq          1881 sound/pci/ens1370.c 		    ensoniq->ctrl & ES_1370_XCTL1 ? "on" : "off");
ensoniq          1883 sound/pci/ens1370.c 		    ensoniq->ctrl & ES_1370_XCTL0 ? "on" : "off");
ensoniq          1886 sound/pci/ens1370.c 		    (ES_1371_JOY_ASELI(ensoniq->ctrl) * 8) + 0x200);
ensoniq          1894 sound/pci/ens1370.c 	if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry))
ensoniq          1895 sound/pci/ens1370.c 		snd_info_set_text_ops(entry, ensoniq, snd_ensoniq_proc_read);
ensoniq          1904 sound/pci/ens1370.c 	snd_ensoniq_free_gameport(ensoniq);
ensoniq          1905 sound/pci/ens1370.c 	if (ensoniq->irq < 0)
ensoniq          1908 sound/pci/ens1370.c 	outl(ES_1370_SERR_DISABLE, ES_REG(ensoniq, CONTROL));	/* switch everything off */
ensoniq          1909 sound/pci/ens1370.c 	outl(0, ES_REG(ensoniq, SERIAL));	/* clear serial interface */
ensoniq          1911 sound/pci/ens1370.c 	outl(0, ES_REG(ensoniq, CONTROL));	/* switch everything off */
ensoniq          1912 sound/pci/ens1370.c 	outl(0, ES_REG(ensoniq, SERIAL));	/* clear serial interface */
ensoniq          1914 sound/pci/ens1370.c 	if (ensoniq->irq >= 0)
ensoniq          1915 sound/pci/ens1370.c 		synchronize_irq(ensoniq->irq);
ensoniq          1916 sound/pci/ens1370.c 	pci_set_power_state(ensoniq->pci, 3);
ensoniq          1919 sound/pci/ens1370.c 	if (ensoniq->dma_bug.area)
ensoniq          1920 sound/pci/ens1370.c 		snd_dma_free_pages(&ensoniq->dma_bug);
ensoniq          1922 sound/pci/ens1370.c 	if (ensoniq->irq >= 0)
ensoniq          1923 sound/pci/ens1370.c 		free_irq(ensoniq->irq, ensoniq);
ensoniq          1924 sound/pci/ens1370.c 	pci_release_regions(ensoniq->pci);
ensoniq          1925 sound/pci/ens1370.c 	pci_disable_device(ensoniq->pci);
ensoniq          1926 sound/pci/ens1370.c 	kfree(ensoniq);
ensoniq          1932 sound/pci/ens1370.c 	struct ensoniq *ensoniq = device->device_data;
ensoniq          1933 sound/pci/ens1370.c 	return snd_ensoniq_free(ensoniq);
ensoniq          1964 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq          1965 sound/pci/ens1370.c 	outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
ensoniq          1966 sound/pci/ens1370.c 	outl(ES_MEM_PAGEO(ES_PAGE_ADC), ES_REG(ensoniq, MEM_PAGE));
ensoniq          1967 sound/pci/ens1370.c 	outl(ensoniq->dma_bug.addr, ES_REG(ensoniq, PHANTOM_FRAME));
ensoniq          1968 sound/pci/ens1370.c 	outl(0, ES_REG(ensoniq, PHANTOM_COUNT));
ensoniq          1970 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq          1971 sound/pci/ens1370.c 	outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
ensoniq          1972 sound/pci/ens1370.c 	outl(0, ES_REG(ensoniq, 1371_LEGACY));
ensoniq          1973 sound/pci/ens1370.c 	if (es1371_quirk_lookup(ensoniq, es1371_ac97_reset_hack)) {
ensoniq          1974 sound/pci/ens1370.c 	    outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
ensoniq          1980 sound/pci/ens1370.c 	outl(ensoniq->ctrl | ES_1371_SYNC_RES, ES_REG(ensoniq, CONTROL));
ensoniq          1981 sound/pci/ens1370.c 	inl(ES_REG(ensoniq, CONTROL));
ensoniq          1983 sound/pci/ens1370.c 	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
ensoniq          1985 sound/pci/ens1370.c 	snd_es1371_wait_src_ready(ensoniq);	
ensoniq          1986 sound/pci/ens1370.c 	outl(ES_1371_SRC_DISABLE, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq          1988 sound/pci/ens1370.c 		snd_es1371_src_write(ensoniq, idx, 0);
ensoniq          1989 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_DAC1 + ES_SMPREG_TRUNC_N, 16 << 4);
ensoniq          1990 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_DAC1 + ES_SMPREG_INT_REGS, 16 << 10);
ensoniq          1991 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_DAC2 + ES_SMPREG_TRUNC_N, 16 << 4);
ensoniq          1992 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_DAC2 + ES_SMPREG_INT_REGS, 16 << 10);
ensoniq          1993 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_ADC, 1 << 12);
ensoniq          1994 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_ADC + 1, 1 << 12);
ensoniq          1995 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_DAC1, 1 << 12);
ensoniq          1996 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_DAC1 + 1, 1 << 12);
ensoniq          1997 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_DAC2, 1 << 12);
ensoniq          1998 sound/pci/ens1370.c 	snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_DAC2 + 1, 1 << 12);
ensoniq          1999 sound/pci/ens1370.c 	snd_es1371_adc_rate(ensoniq, 22050);
ensoniq          2000 sound/pci/ens1370.c 	snd_es1371_dac1_rate(ensoniq, 22050);
ensoniq          2001 sound/pci/ens1370.c 	snd_es1371_dac2_rate(ensoniq, 22050);
ensoniq          2008 sound/pci/ens1370.c 	snd_es1371_wait_src_ready(ensoniq);
ensoniq          2009 sound/pci/ens1370.c 	outl(0, ES_REG(ensoniq, 1371_SMPRATE));
ensoniq          2011 sound/pci/ens1370.c 	outl(ES_1371_CODEC_WRITE(0, 0), ES_REG(ensoniq, 1371_CODEC));
ensoniq          2013 sound/pci/ens1370.c 	outb(ensoniq->uartc = 0x00, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2014 sound/pci/ens1370.c 	outb(0x00, ES_REG(ensoniq, UART_RES));
ensoniq          2015 sound/pci/ens1370.c 	outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
ensoniq          2016 sound/pci/ens1370.c 	synchronize_irq(ensoniq->irq);
ensoniq          2023 sound/pci/ens1370.c 	struct ensoniq *ensoniq = card->private_data;
ensoniq          2027 sound/pci/ens1370.c 	snd_pcm_suspend_all(ensoniq->pcm1);
ensoniq          2028 sound/pci/ens1370.c 	snd_pcm_suspend_all(ensoniq->pcm2);
ensoniq          2031 sound/pci/ens1370.c 	snd_ac97_suspend(ensoniq->u.es1371.ac97);
ensoniq          2034 sound/pci/ens1370.c 	outw(ES_1370_CODEC_WRITE(AK4531_RESET, 0x02), ES_REG(ensoniq, 1370_CODEC));
ensoniq          2035 sound/pci/ens1370.c 	inw(ES_REG(ensoniq, 1370_CODEC));
ensoniq          2037 sound/pci/ens1370.c 	outw(ES_1370_CODEC_WRITE(AK4531_RESET, 0x03), ES_REG(ensoniq, 1370_CODEC));
ensoniq          2038 sound/pci/ens1370.c 	inw(ES_REG(ensoniq, 1370_CODEC));
ensoniq          2040 sound/pci/ens1370.c 	snd_ak4531_suspend(ensoniq->u.es1370.ak4531);
ensoniq          2052 sound/pci/ens1370.c 	struct ensoniq *ensoniq = card->private_data;
ensoniq          2064 sound/pci/ens1370.c 	snd_ensoniq_chip_init(ensoniq);
ensoniq          2067 sound/pci/ens1370.c 	snd_ac97_resume(ensoniq->u.es1371.ac97);
ensoniq          2069 sound/pci/ens1370.c 	snd_ak4531_resume(ensoniq->u.es1370.ak4531);
ensoniq          2081 sound/pci/ens1370.c 	struct ensoniq *ensoniq;
ensoniq          2090 sound/pci/ens1370.c 	ensoniq = kzalloc(sizeof(*ensoniq), GFP_KERNEL);
ensoniq          2091 sound/pci/ens1370.c 	if (ensoniq == NULL) {
ensoniq          2095 sound/pci/ens1370.c 	spin_lock_init(&ensoniq->reg_lock);
ensoniq          2096 sound/pci/ens1370.c 	mutex_init(&ensoniq->src_mutex);
ensoniq          2097 sound/pci/ens1370.c 	ensoniq->card = card;
ensoniq          2098 sound/pci/ens1370.c 	ensoniq->pci = pci;
ensoniq          2099 sound/pci/ens1370.c 	ensoniq->irq = -1;
ensoniq          2101 sound/pci/ens1370.c 		kfree(ensoniq);
ensoniq          2105 sound/pci/ens1370.c 	ensoniq->port = pci_resource_start(pci, 0);
ensoniq          2107 sound/pci/ens1370.c 			"Ensoniq AudioPCI", ensoniq)) {
ensoniq          2109 sound/pci/ens1370.c 		snd_ensoniq_free(ensoniq);
ensoniq          2112 sound/pci/ens1370.c 	ensoniq->irq = pci->irq;
ensoniq          2115 sound/pci/ens1370.c 				16, &ensoniq->dma_bug) < 0) {
ensoniq          2117 sound/pci/ens1370.c 		snd_ensoniq_free(ensoniq);
ensoniq          2122 sound/pci/ens1370.c 	ensoniq->rev = pci->revision;
ensoniq          2125 sound/pci/ens1370.c 	ensoniq->ctrl = ES_1370_CDC_EN | ES_1370_SERR_DISABLE |
ensoniq          2128 sound/pci/ens1370.c 	ensoniq->ctrl = ES_1370_CDC_EN | ES_1370_PCLKDIVO(ES_1370_SRTODIV(8000));
ensoniq          2130 sound/pci/ens1370.c 	ensoniq->sctrl = 0;
ensoniq          2132 sound/pci/ens1370.c 	ensoniq->ctrl = 0;
ensoniq          2133 sound/pci/ens1370.c 	ensoniq->sctrl = 0;
ensoniq          2134 sound/pci/ens1370.c 	ensoniq->cssr = 0;
ensoniq          2136 sound/pci/ens1370.c 		ensoniq->ctrl |= ES_1371_GPIO_OUT(1);	/* turn amplifier on */
ensoniq          2138 sound/pci/ens1370.c 	if (es1371_quirk_lookup(ensoniq, es1371_ac97_reset_hack))
ensoniq          2139 sound/pci/ens1370.c 		ensoniq->cssr |= ES_1371_ST_AC97_RST;
ensoniq          2142 sound/pci/ens1370.c 	snd_ensoniq_chip_init(ensoniq);
ensoniq          2144 sound/pci/ens1370.c 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ensoniq, &ops)) < 0) {
ensoniq          2145 sound/pci/ens1370.c 		snd_ensoniq_free(ensoniq);
ensoniq          2149 sound/pci/ens1370.c 	snd_ensoniq_proc_init(ensoniq);
ensoniq          2153 sound/pci/ens1370.c 	*rensoniq = ensoniq;
ensoniq          2163 sound/pci/ens1370.c 	struct snd_rawmidi *rmidi = ensoniq->rmidi;
ensoniq          2169 sound/pci/ens1370.c 	spin_lock(&ensoniq->reg_lock);
ensoniq          2170 sound/pci/ens1370.c 	mask = ensoniq->uartm & ES_MODE_INPUT ? ES_RXRDY : 0;
ensoniq          2172 sound/pci/ens1370.c 		status = inb(ES_REG(ensoniq, UART_STATUS));
ensoniq          2175 sound/pci/ens1370.c 		byte = inb(ES_REG(ensoniq, UART_DATA));
ensoniq          2176 sound/pci/ens1370.c 		snd_rawmidi_receive(ensoniq->midi_input, &byte, 1);
ensoniq          2178 sound/pci/ens1370.c 	spin_unlock(&ensoniq->reg_lock);
ensoniq          2181 sound/pci/ens1370.c 	spin_lock(&ensoniq->reg_lock);
ensoniq          2182 sound/pci/ens1370.c 	mask = ensoniq->uartm & ES_MODE_OUTPUT ? ES_TXRDY : 0;
ensoniq          2184 sound/pci/ens1370.c 		status = inb(ES_REG(ensoniq, UART_STATUS));
ensoniq          2187 sound/pci/ens1370.c 		if (snd_rawmidi_transmit(ensoniq->midi_output, &byte, 1) != 1) {
ensoniq          2188 sound/pci/ens1370.c 			ensoniq->uartc &= ~ES_TXINTENM;
ensoniq          2189 sound/pci/ens1370.c 			outb(ensoniq->uartc, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2192 sound/pci/ens1370.c 			outb(byte, ES_REG(ensoniq, UART_DATA));
ensoniq          2195 sound/pci/ens1370.c 	spin_unlock(&ensoniq->reg_lock);
ensoniq          2200 sound/pci/ens1370.c 	struct ensoniq *ensoniq = substream->rmidi->private_data;
ensoniq          2202 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          2203 sound/pci/ens1370.c 	ensoniq->uartm |= ES_MODE_INPUT;
ensoniq          2204 sound/pci/ens1370.c 	ensoniq->midi_input = substream;
ensoniq          2205 sound/pci/ens1370.c 	if (!(ensoniq->uartm & ES_MODE_OUTPUT)) {
ensoniq          2206 sound/pci/ens1370.c 		outb(ES_CNTRL(3), ES_REG(ensoniq, UART_CONTROL));
ensoniq          2207 sound/pci/ens1370.c 		outb(ensoniq->uartc = 0, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2208 sound/pci/ens1370.c 		outl(ensoniq->ctrl |= ES_UART_EN, ES_REG(ensoniq, CONTROL));
ensoniq          2210 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          2216 sound/pci/ens1370.c 	struct ensoniq *ensoniq = substream->rmidi->private_data;
ensoniq          2218 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          2219 sound/pci/ens1370.c 	if (!(ensoniq->uartm & ES_MODE_OUTPUT)) {
ensoniq          2220 sound/pci/ens1370.c 		outb(ensoniq->uartc = 0, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2221 sound/pci/ens1370.c 		outl(ensoniq->ctrl &= ~ES_UART_EN, ES_REG(ensoniq, CONTROL));
ensoniq          2223 sound/pci/ens1370.c 		outb(ensoniq->uartc &= ~ES_RXINTEN, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2225 sound/pci/ens1370.c 	ensoniq->midi_input = NULL;
ensoniq          2226 sound/pci/ens1370.c 	ensoniq->uartm &= ~ES_MODE_INPUT;
ensoniq          2227 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          2233 sound/pci/ens1370.c 	struct ensoniq *ensoniq = substream->rmidi->private_data;
ensoniq          2235 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          2236 sound/pci/ens1370.c 	ensoniq->uartm |= ES_MODE_OUTPUT;
ensoniq          2237 sound/pci/ens1370.c 	ensoniq->midi_output = substream;
ensoniq          2238 sound/pci/ens1370.c 	if (!(ensoniq->uartm & ES_MODE_INPUT)) {
ensoniq          2239 sound/pci/ens1370.c 		outb(ES_CNTRL(3), ES_REG(ensoniq, UART_CONTROL));
ensoniq          2240 sound/pci/ens1370.c 		outb(ensoniq->uartc = 0, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2241 sound/pci/ens1370.c 		outl(ensoniq->ctrl |= ES_UART_EN, ES_REG(ensoniq, CONTROL));
ensoniq          2243 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          2249 sound/pci/ens1370.c 	struct ensoniq *ensoniq = substream->rmidi->private_data;
ensoniq          2251 sound/pci/ens1370.c 	spin_lock_irq(&ensoniq->reg_lock);
ensoniq          2252 sound/pci/ens1370.c 	if (!(ensoniq->uartm & ES_MODE_INPUT)) {
ensoniq          2253 sound/pci/ens1370.c 		outb(ensoniq->uartc = 0, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2254 sound/pci/ens1370.c 		outl(ensoniq->ctrl &= ~ES_UART_EN, ES_REG(ensoniq, CONTROL));
ensoniq          2256 sound/pci/ens1370.c 		outb(ensoniq->uartc &= ~ES_TXINTENM, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2258 sound/pci/ens1370.c 	ensoniq->midi_output = NULL;
ensoniq          2259 sound/pci/ens1370.c 	ensoniq->uartm &= ~ES_MODE_OUTPUT;
ensoniq          2260 sound/pci/ens1370.c 	spin_unlock_irq(&ensoniq->reg_lock);
ensoniq          2267 sound/pci/ens1370.c 	struct ensoniq *ensoniq = substream->rmidi->private_data;
ensoniq          2270 sound/pci/ens1370.c 	spin_lock_irqsave(&ensoniq->reg_lock, flags);
ensoniq          2272 sound/pci/ens1370.c 		if ((ensoniq->uartc & ES_RXINTEN) == 0) {
ensoniq          2275 sound/pci/ens1370.c 				inb(ES_REG(ensoniq, UART_DATA));
ensoniq          2276 sound/pci/ens1370.c 			ensoniq->uartc |= ES_RXINTEN;
ensoniq          2277 sound/pci/ens1370.c 			outb(ensoniq->uartc, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2280 sound/pci/ens1370.c 		if (ensoniq->uartc & ES_RXINTEN) {
ensoniq          2281 sound/pci/ens1370.c 			ensoniq->uartc &= ~ES_RXINTEN;
ensoniq          2282 sound/pci/ens1370.c 			outb(ensoniq->uartc, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2285 sound/pci/ens1370.c 	spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
ensoniq          2291 sound/pci/ens1370.c 	struct ensoniq *ensoniq = substream->rmidi->private_data;
ensoniq          2294 sound/pci/ens1370.c 	spin_lock_irqsave(&ensoniq->reg_lock, flags);
ensoniq          2296 sound/pci/ens1370.c 		if (ES_TXINTENI(ensoniq->uartc) == 0) {
ensoniq          2297 sound/pci/ens1370.c 			ensoniq->uartc |= ES_TXINTENO(1);
ensoniq          2299 sound/pci/ens1370.c 			while (ES_TXINTENI(ensoniq->uartc) == 1 &&
ensoniq          2300 sound/pci/ens1370.c 			       (inb(ES_REG(ensoniq, UART_STATUS)) & ES_TXRDY)) {
ensoniq          2302 sound/pci/ens1370.c 					ensoniq->uartc &= ~ES_TXINTENM;
ensoniq          2304 sound/pci/ens1370.c 					outb(byte, ES_REG(ensoniq, UART_DATA));
ensoniq          2307 sound/pci/ens1370.c 			outb(ensoniq->uartc, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2310 sound/pci/ens1370.c 		if (ES_TXINTENI(ensoniq->uartc) == 1) {
ensoniq          2311 sound/pci/ens1370.c 			ensoniq->uartc &= ~ES_TXINTENM;
ensoniq          2312 sound/pci/ens1370.c 			outb(ensoniq->uartc, ES_REG(ensoniq, UART_CONTROL));
ensoniq          2315 sound/pci/ens1370.c 	spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
ensoniq          2340 sound/pci/ens1370.c 	if ((err = snd_rawmidi_new(ensoniq->card, "ES1370/1", device, 1, 1, &rmidi)) < 0)
ensoniq          2351 sound/pci/ens1370.c 	rmidi->private_data = ensoniq;
ensoniq          2352 sound/pci/ens1370.c 	ensoniq->rmidi = rmidi;
ensoniq          2364 sound/pci/ens1370.c 	struct ensoniq *ensoniq = dev_id;
ensoniq          2367 sound/pci/ens1370.c 	if (ensoniq == NULL)
ensoniq          2370 sound/pci/ens1370.c 	status = inl(ES_REG(ensoniq, STATUS));
ensoniq          2374 sound/pci/ens1370.c 	spin_lock(&ensoniq->reg_lock);
ensoniq          2375 sound/pci/ens1370.c 	sctrl = ensoniq->sctrl;
ensoniq          2382 sound/pci/ens1370.c 	outl(sctrl, ES_REG(ensoniq, SERIAL));
ensoniq          2383 sound/pci/ens1370.c 	outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
ensoniq          2384 sound/pci/ens1370.c 	spin_unlock(&ensoniq->reg_lock);
ensoniq          2387 sound/pci/ens1370.c 		snd_ensoniq_midi_interrupt(ensoniq);
ensoniq          2388 sound/pci/ens1370.c 	if ((status & ES_DAC2) && ensoniq->playback2_substream)
ensoniq          2389 sound/pci/ens1370.c 		snd_pcm_period_elapsed(ensoniq->playback2_substream);
ensoniq          2390 sound/pci/ens1370.c 	if ((status & ES_ADC) && ensoniq->capture_substream)
ensoniq          2391 sound/pci/ens1370.c 		snd_pcm_period_elapsed(ensoniq->capture_substream);
ensoniq          2392 sound/pci/ens1370.c 	if ((status & ES_DAC1) && ensoniq->playback1_substream)
ensoniq          2393 sound/pci/ens1370.c 		snd_pcm_period_elapsed(ensoniq->playback1_substream);
ensoniq          2402 sound/pci/ens1370.c 	struct ensoniq *ensoniq;
ensoniq          2416 sound/pci/ens1370.c 	if ((err = snd_ensoniq_create(card, pci, &ensoniq)) < 0) {
ensoniq          2420 sound/pci/ens1370.c 	card->private_data = ensoniq;
ensoniq          2424 sound/pci/ens1370.c 	if ((err = snd_ensoniq_1370_mixer(ensoniq)) < 0) {
ensoniq          2430 sound/pci/ens1370.c 	if ((err = snd_ensoniq_1371_mixer(ensoniq, spdif[dev], lineio[dev])) < 0) {
ensoniq          2435 sound/pci/ens1370.c 	if ((err = snd_ensoniq_pcm(ensoniq, 0, NULL)) < 0) {
ensoniq          2439 sound/pci/ens1370.c 	if ((err = snd_ensoniq_pcm2(ensoniq, 1, NULL)) < 0) {
ensoniq          2443 sound/pci/ens1370.c 	if ((err = snd_ensoniq_midi(ensoniq, 0, NULL)) < 0) {
ensoniq          2448 sound/pci/ens1370.c 	snd_ensoniq_create_gameport(ensoniq, dev);
ensoniq          2456 sound/pci/ens1370.c 		ensoniq->port,
ensoniq          2457 sound/pci/ens1370.c 		ensoniq->irq);