sonic              62 sound/pci/sonicvibes.c #define SV_REG(sonic, x) ((sonic)->enh_port + SV_REG_##x)
sonic             252 sound/pci/sonicvibes.c static inline void snd_sonicvibes_setdmaa(struct sonicvibes * sonic,
sonic             257 sound/pci/sonicvibes.c 	outl(addr, sonic->dmaa_port + SV_DMA_ADDR0);
sonic             258 sound/pci/sonicvibes.c 	outl(count, sonic->dmaa_port + SV_DMA_COUNT0);
sonic             259 sound/pci/sonicvibes.c 	outb(0x18, sonic->dmaa_port + SV_DMA_MODE);
sonic             261 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev, "program dmaa: addr = 0x%x, paddr = 0x%x\n",
sonic             262 sound/pci/sonicvibes.c 	       addr, inl(sonic->dmaa_port + SV_DMA_ADDR0));
sonic             266 sound/pci/sonicvibes.c static inline void snd_sonicvibes_setdmac(struct sonicvibes * sonic,
sonic             273 sound/pci/sonicvibes.c 	outl(addr, sonic->dmac_port + SV_DMA_ADDR0);
sonic             274 sound/pci/sonicvibes.c 	outl(count, sonic->dmac_port + SV_DMA_COUNT0);
sonic             275 sound/pci/sonicvibes.c 	outb(0x14, sonic->dmac_port + SV_DMA_MODE);
sonic             277 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev, "program dmac: addr = 0x%x, paddr = 0x%x\n",
sonic             278 sound/pci/sonicvibes.c 	       addr, inl(sonic->dmac_port + SV_DMA_ADDR0));
sonic             282 sound/pci/sonicvibes.c static inline unsigned int snd_sonicvibes_getdmaa(struct sonicvibes * sonic)
sonic             284 sound/pci/sonicvibes.c 	return (inl(sonic->dmaa_port + SV_DMA_COUNT0) & 0xffffff) + 1;
sonic             287 sound/pci/sonicvibes.c static inline unsigned int snd_sonicvibes_getdmac(struct sonicvibes * sonic)
sonic             290 sound/pci/sonicvibes.c 	return ((inl(sonic->dmac_port + SV_DMA_COUNT0) & 0xffffff) + 1) << 1;
sonic             293 sound/pci/sonicvibes.c static void snd_sonicvibes_out1(struct sonicvibes * sonic,
sonic             297 sound/pci/sonicvibes.c 	outb(reg, SV_REG(sonic, INDEX));
sonic             299 sound/pci/sonicvibes.c 	outb(value, SV_REG(sonic, DATA));
sonic             303 sound/pci/sonicvibes.c static void snd_sonicvibes_out(struct sonicvibes * sonic,
sonic             309 sound/pci/sonicvibes.c 	spin_lock_irqsave(&sonic->reg_lock, flags);
sonic             310 sound/pci/sonicvibes.c 	outb(reg, SV_REG(sonic, INDEX));
sonic             312 sound/pci/sonicvibes.c 	outb(value, SV_REG(sonic, DATA));
sonic             314 sound/pci/sonicvibes.c 	spin_unlock_irqrestore(&sonic->reg_lock, flags);
sonic             317 sound/pci/sonicvibes.c static unsigned char snd_sonicvibes_in1(struct sonicvibes * sonic, unsigned char reg)
sonic             321 sound/pci/sonicvibes.c 	outb(reg, SV_REG(sonic, INDEX));
sonic             323 sound/pci/sonicvibes.c 	value = inb(SV_REG(sonic, DATA));
sonic             328 sound/pci/sonicvibes.c static unsigned char snd_sonicvibes_in(struct sonicvibes * sonic, unsigned char reg)
sonic             333 sound/pci/sonicvibes.c 	spin_lock_irqsave(&sonic->reg_lock, flags);
sonic             334 sound/pci/sonicvibes.c 	outb(reg, SV_REG(sonic, INDEX));
sonic             336 sound/pci/sonicvibes.c 	value = inb(SV_REG(sonic, DATA));
sonic             338 sound/pci/sonicvibes.c 	spin_unlock_irqrestore(&sonic->reg_lock, flags);
sonic             343 sound/pci/sonicvibes.c static void snd_sonicvibes_debug(struct sonicvibes * sonic)
sonic             345 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             347 sound/pci/sonicvibes.c 		inb(SV_REG(sonic, INDEX)), inb(SV_REG(sonic, STATUS)));
sonic             348 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             350 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x00), snd_sonicvibes_in(sonic, 0x20));
sonic             351 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             353 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x01), snd_sonicvibes_in(sonic, 0x21));
sonic             354 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             356 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x02), snd_sonicvibes_in(sonic, 0x22));
sonic             357 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             359 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x03), snd_sonicvibes_in(sonic, 0x23));
sonic             360 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             362 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x04), snd_sonicvibes_in(sonic, 0x24));
sonic             363 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             365 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x05), snd_sonicvibes_in(sonic, 0x25));
sonic             366 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             368 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x06), snd_sonicvibes_in(sonic, 0x26));
sonic             369 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             371 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x07), snd_sonicvibes_in(sonic, 0x27));
sonic             372 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             374 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x08), snd_sonicvibes_in(sonic, 0x28));
sonic             375 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             377 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x09), snd_sonicvibes_in(sonic, 0x29));
sonic             378 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             380 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x0a), snd_sonicvibes_in(sonic, 0x2a));
sonic             381 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             383 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x0b), snd_sonicvibes_in(sonic, 0x2b));
sonic             384 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             386 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x0c), snd_sonicvibes_in(sonic, 0x2c));
sonic             387 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             389 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x0d), snd_sonicvibes_in(sonic, 0x2d));
sonic             390 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             392 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x0e), snd_sonicvibes_in(sonic, 0x2e));
sonic             393 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             395 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x0f), snd_sonicvibes_in(sonic, 0x2f));
sonic             396 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             398 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x10), snd_sonicvibes_in(sonic, 0x30));
sonic             399 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             401 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x11), snd_sonicvibes_in(sonic, 0x31));
sonic             402 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             404 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x12), snd_sonicvibes_in(sonic, 0x32));
sonic             405 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             407 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x13), snd_sonicvibes_in(sonic, 0x33));
sonic             408 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             410 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x14), snd_sonicvibes_in(sonic, 0x34));
sonic             411 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             413 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x15), snd_sonicvibes_in(sonic, 0x35));
sonic             414 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             416 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x16), snd_sonicvibes_in(sonic, 0x36));
sonic             417 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             419 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x17), snd_sonicvibes_in(sonic, 0x37));
sonic             420 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             422 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x18), snd_sonicvibes_in(sonic, 0x38));
sonic             423 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             425 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x19), snd_sonicvibes_in(sonic, 0x39));
sonic             426 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             428 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x1a), snd_sonicvibes_in(sonic, 0x3a));
sonic             429 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             431 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x1b), snd_sonicvibes_in(sonic, 0x3b));
sonic             432 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             434 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x1c), snd_sonicvibes_in(sonic, 0x3c));
sonic             435 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             437 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x1d), snd_sonicvibes_in(sonic, 0x3d));
sonic             438 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             440 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x1e), snd_sonicvibes_in(sonic, 0x3e));
sonic             441 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             443 sound/pci/sonicvibes.c 		snd_sonicvibes_in(sonic, 0x1f), snd_sonicvibes_in(sonic, 0x3f));
sonic             448 sound/pci/sonicvibes.c static void snd_sonicvibes_setfmt(struct sonicvibes * sonic,
sonic             454 sound/pci/sonicvibes.c 	spin_lock_irqsave(&sonic->reg_lock, flags);
sonic             455 sound/pci/sonicvibes.c 	outb(SV_MCE | SV_IREG_DMA_DATA_FMT, SV_REG(sonic, INDEX));
sonic             457 sound/pci/sonicvibes.c 		sonic->format = inb(SV_REG(sonic, DATA));
sonic             460 sound/pci/sonicvibes.c 	sonic->format = (sonic->format & mask) | value;
sonic             461 sound/pci/sonicvibes.c 	outb(sonic->format, SV_REG(sonic, DATA));
sonic             463 sound/pci/sonicvibes.c 	outb(0, SV_REG(sonic, INDEX));
sonic             465 sound/pci/sonicvibes.c 	spin_unlock_irqrestore(&sonic->reg_lock, flags);
sonic             499 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             501 sound/pci/sonicvibes.c 	dev_dbg(sonic->card->dev,
sonic             506 sound/pci/sonicvibes.c static void snd_sonicvibes_setpll(struct sonicvibes * sonic,
sonic             514 sound/pci/sonicvibes.c 	if (sonic != NULL) {
sonic             515 sound/pci/sonicvibes.c 		spin_lock_irqsave(&sonic->reg_lock, flags);
sonic             516 sound/pci/sonicvibes.c 		snd_sonicvibes_out1(sonic, reg, m);
sonic             517 sound/pci/sonicvibes.c 		snd_sonicvibes_out1(sonic, reg + 1, r | n);
sonic             518 sound/pci/sonicvibes.c 		spin_unlock_irqrestore(&sonic->reg_lock, flags);
sonic             522 sound/pci/sonicvibes.c static void snd_sonicvibes_set_adc_rate(struct sonicvibes * sonic, unsigned int rate)
sonic             535 sound/pci/sonicvibes.c 		snd_sonicvibes_setpll(sonic, SV_IREG_ADC_PLL, rate);
sonic             537 sound/pci/sonicvibes.c 	spin_lock_irqsave(&sonic->reg_lock, flags);
sonic             538 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_ADC_ALT_RATE, (div - 1) << 4);
sonic             539 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_ADC_CLOCK, clock);
sonic             540 sound/pci/sonicvibes.c 	spin_unlock_irqrestore(&sonic->reg_lock, flags);
sonic             568 sound/pci/sonicvibes.c static void snd_sonicvibes_set_dac_rate(struct sonicvibes * sonic, unsigned int rate)
sonic             576 sound/pci/sonicvibes.c 	spin_lock_irqsave(&sonic->reg_lock, flags);
sonic             577 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_PCM_RATE_HIGH, div >> 8);
sonic             578 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_PCM_RATE_LOW, div);
sonic             579 sound/pci/sonicvibes.c 	spin_unlock_irqrestore(&sonic->reg_lock, flags);
sonic             582 sound/pci/sonicvibes.c static int snd_sonicvibes_trigger(struct sonicvibes * sonic, int what, int cmd)
sonic             586 sound/pci/sonicvibes.c 	spin_lock(&sonic->reg_lock);
sonic             588 sound/pci/sonicvibes.c 		if (!(sonic->enable & what)) {
sonic             589 sound/pci/sonicvibes.c 			sonic->enable |= what;
sonic             590 sound/pci/sonicvibes.c 			snd_sonicvibes_out1(sonic, SV_IREG_PC_ENABLE, sonic->enable);
sonic             593 sound/pci/sonicvibes.c 		if (sonic->enable & what) {
sonic             594 sound/pci/sonicvibes.c 			sonic->enable &= ~what;
sonic             595 sound/pci/sonicvibes.c 			snd_sonicvibes_out1(sonic, SV_IREG_PC_ENABLE, sonic->enable);
sonic             600 sound/pci/sonicvibes.c 	spin_unlock(&sonic->reg_lock);
sonic             606 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = dev_id;
sonic             609 sound/pci/sonicvibes.c 	status = inb(SV_REG(sonic, STATUS));
sonic             613 sound/pci/sonicvibes.c 		outb(sonic->irqmask = ~0, SV_REG(sonic, IRQMASK));
sonic             614 sound/pci/sonicvibes.c 		dev_err(sonic->card->dev,
sonic             618 sound/pci/sonicvibes.c 	if (sonic->pcm) {
sonic             620 sound/pci/sonicvibes.c 			snd_pcm_period_elapsed(sonic->playback_substream);
sonic             622 sound/pci/sonicvibes.c 			snd_pcm_period_elapsed(sonic->capture_substream);
sonic             624 sound/pci/sonicvibes.c 	if (sonic->rmidi) {
sonic             626 sound/pci/sonicvibes.c 			snd_mpu401_uart_interrupt(irq, sonic->rmidi->private_data);
sonic             632 sound/pci/sonicvibes.c 		spin_lock(&sonic->reg_lock);
sonic             633 sound/pci/sonicvibes.c 		udreg = snd_sonicvibes_in1(sonic, SV_IREG_UD_BUTTON);
sonic             637 sound/pci/sonicvibes.c 		oleft = mleft = snd_sonicvibes_in1(sonic, SV_IREG_LEFT_ANALOG);
sonic             638 sound/pci/sonicvibes.c 		oright = mright = snd_sonicvibes_in1(sonic, SV_IREG_RIGHT_ANALOG);
sonic             657 sound/pci/sonicvibes.c 		snd_sonicvibes_out1(sonic, SV_IREG_LEFT_ANALOG, oleft);
sonic             658 sound/pci/sonicvibes.c 		snd_sonicvibes_out1(sonic, SV_IREG_RIGHT_ANALOG, oright);
sonic             659 sound/pci/sonicvibes.c 		spin_unlock(&sonic->reg_lock);
sonic             660 sound/pci/sonicvibes.c 		snd_ctl_notify(sonic->card, SNDRV_CTL_EVENT_MASK_VALUE, &sonic->master_mute->id);
sonic             661 sound/pci/sonicvibes.c 		snd_ctl_notify(sonic->card, SNDRV_CTL_EVENT_MASK_VALUE, &sonic->master_volume->id);
sonic             673 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             674 sound/pci/sonicvibes.c 	return snd_sonicvibes_trigger(sonic, 1, cmd);
sonic             680 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             681 sound/pci/sonicvibes.c 	return snd_sonicvibes_trigger(sonic, 2, cmd);
sonic             697 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             703 sound/pci/sonicvibes.c 	sonic->p_dma_size = size;
sonic             709 sound/pci/sonicvibes.c 	snd_sonicvibes_setfmt(sonic, ~3, fmt);
sonic             710 sound/pci/sonicvibes.c 	snd_sonicvibes_set_dac_rate(sonic, runtime->rate);
sonic             711 sound/pci/sonicvibes.c 	spin_lock_irq(&sonic->reg_lock);
sonic             712 sound/pci/sonicvibes.c 	snd_sonicvibes_setdmaa(sonic, runtime->dma_addr, size);
sonic             713 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_DMA_A_UPPER, count >> 8);
sonic             714 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_DMA_A_LOWER, count);
sonic             715 sound/pci/sonicvibes.c 	spin_unlock_irq(&sonic->reg_lock);
sonic             721 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             727 sound/pci/sonicvibes.c 	sonic->c_dma_size = size;
sonic             734 sound/pci/sonicvibes.c 	snd_sonicvibes_setfmt(sonic, ~0x30, fmt);
sonic             735 sound/pci/sonicvibes.c 	snd_sonicvibes_set_adc_rate(sonic, runtime->rate);
sonic             736 sound/pci/sonicvibes.c 	spin_lock_irq(&sonic->reg_lock);
sonic             737 sound/pci/sonicvibes.c 	snd_sonicvibes_setdmac(sonic, runtime->dma_addr, size);
sonic             738 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_DMA_C_UPPER, count >> 8);
sonic             739 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_DMA_C_LOWER, count);
sonic             740 sound/pci/sonicvibes.c 	spin_unlock_irq(&sonic->reg_lock);
sonic             746 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             749 sound/pci/sonicvibes.c 	if (!(sonic->enable & 1))
sonic             751 sound/pci/sonicvibes.c 	ptr = sonic->p_dma_size - snd_sonicvibes_getdmaa(sonic);
sonic             757 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             759 sound/pci/sonicvibes.c 	if (!(sonic->enable & 2))
sonic             761 sound/pci/sonicvibes.c 	ptr = sonic->c_dma_size - snd_sonicvibes_getdmac(sonic);
sonic             805 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             808 sound/pci/sonicvibes.c 	sonic->mode |= SV_MODE_PLAY;
sonic             809 sound/pci/sonicvibes.c 	sonic->playback_substream = substream;
sonic             817 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             820 sound/pci/sonicvibes.c 	sonic->mode |= SV_MODE_CAPTURE;
sonic             821 sound/pci/sonicvibes.c 	sonic->capture_substream = substream;
sonic             830 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             832 sound/pci/sonicvibes.c 	sonic->playback_substream = NULL;
sonic             833 sound/pci/sonicvibes.c 	sonic->mode &= ~SV_MODE_PLAY;
sonic             839 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_pcm_substream_chip(substream);
sonic             841 sound/pci/sonicvibes.c 	sonic->capture_substream = NULL;
sonic             842 sound/pci/sonicvibes.c 	sonic->mode &= ~SV_MODE_CAPTURE;
sonic             868 sound/pci/sonicvibes.c static int snd_sonicvibes_pcm(struct sonicvibes *sonic, int device)
sonic             873 sound/pci/sonicvibes.c 	if ((err = snd_pcm_new(sonic->card, "s3_86c617", device, 1, 1, &pcm)) < 0)
sonic             881 sound/pci/sonicvibes.c 	pcm->private_data = sonic;
sonic             884 sound/pci/sonicvibes.c 	sonic->pcm = pcm;
sonic             887 sound/pci/sonicvibes.c 					      snd_dma_pci_data(sonic->pci), 64*1024, 128*1024);
sonic             912 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
sonic             914 sound/pci/sonicvibes.c 	spin_lock_irq(&sonic->reg_lock);
sonic             915 sound/pci/sonicvibes.c 	ucontrol->value.enumerated.item[0] = ((snd_sonicvibes_in1(sonic, SV_IREG_LEFT_ADC) & SV_RECSRC_OUT) >> 5) - 1;
sonic             916 sound/pci/sonicvibes.c 	ucontrol->value.enumerated.item[1] = ((snd_sonicvibes_in1(sonic, SV_IREG_RIGHT_ADC) & SV_RECSRC_OUT) >> 5) - 1;
sonic             917 sound/pci/sonicvibes.c 	spin_unlock_irq(&sonic->reg_lock);
sonic             923 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
sonic             932 sound/pci/sonicvibes.c 	spin_lock_irq(&sonic->reg_lock);
sonic             933 sound/pci/sonicvibes.c 	oval1 = snd_sonicvibes_in1(sonic, SV_IREG_LEFT_ADC);
sonic             934 sound/pci/sonicvibes.c 	oval2 = snd_sonicvibes_in1(sonic, SV_IREG_RIGHT_ADC);
sonic             938 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_LEFT_ADC, left);
sonic             939 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, SV_IREG_RIGHT_ADC, right);
sonic             940 sound/pci/sonicvibes.c 	spin_unlock_irq(&sonic->reg_lock);
sonic             963 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
sonic             969 sound/pci/sonicvibes.c 	spin_lock_irq(&sonic->reg_lock);
sonic             970 sound/pci/sonicvibes.c 	ucontrol->value.integer.value[0] = (snd_sonicvibes_in1(sonic, reg)>> shift) & mask;
sonic             971 sound/pci/sonicvibes.c 	spin_unlock_irq(&sonic->reg_lock);
sonic             979 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
sonic             991 sound/pci/sonicvibes.c 	spin_lock_irq(&sonic->reg_lock);
sonic             992 sound/pci/sonicvibes.c 	oval = snd_sonicvibes_in1(sonic, reg);
sonic             995 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, reg, val);
sonic             996 sound/pci/sonicvibes.c 	spin_unlock_irq(&sonic->reg_lock);
sonic            1019 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
sonic            1027 sound/pci/sonicvibes.c 	spin_lock_irq(&sonic->reg_lock);
sonic            1028 sound/pci/sonicvibes.c 	ucontrol->value.integer.value[0] = (snd_sonicvibes_in1(sonic, left_reg) >> shift_left) & mask;
sonic            1029 sound/pci/sonicvibes.c 	ucontrol->value.integer.value[1] = (snd_sonicvibes_in1(sonic, right_reg) >> shift_right) & mask;
sonic            1030 sound/pci/sonicvibes.c 	spin_unlock_irq(&sonic->reg_lock);
sonic            1040 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
sonic            1058 sound/pci/sonicvibes.c 	spin_lock_irq(&sonic->reg_lock);
sonic            1059 sound/pci/sonicvibes.c 	oval1 = snd_sonicvibes_in1(sonic, left_reg);
sonic            1060 sound/pci/sonicvibes.c 	oval2 = snd_sonicvibes_in1(sonic, right_reg);
sonic            1064 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, left_reg, val1);
sonic            1065 sound/pci/sonicvibes.c 	snd_sonicvibes_out1(sonic, right_reg, val2);
sonic            1066 sound/pci/sonicvibes.c 	spin_unlock_irq(&sonic->reg_lock);
sonic            1096 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
sonic            1097 sound/pci/sonicvibes.c 	sonic->master_mute = NULL;
sonic            1098 sound/pci/sonicvibes.c 	sonic->master_volume = NULL;
sonic            1101 sound/pci/sonicvibes.c static int snd_sonicvibes_mixer(struct sonicvibes *sonic)
sonic            1108 sound/pci/sonicvibes.c 	if (snd_BUG_ON(!sonic || !sonic->card))
sonic            1110 sound/pci/sonicvibes.c 	card = sonic->card;
sonic            1114 sound/pci/sonicvibes.c 		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_sonicvibes_controls[idx], sonic))) < 0)
sonic            1131 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = entry->private_data;
sonic            1134 sound/pci/sonicvibes.c 	tmp = sonic->srs_space & 0x0f;
sonic            1136 sound/pci/sonicvibes.c 		    sonic->srs_space & 0x80 ? "off" : "on");
sonic            1142 sound/pci/sonicvibes.c 	tmp = sonic->srs_center & 0x0f;
sonic            1148 sound/pci/sonicvibes.c 	tmp = sonic->wave_source & 0x03;
sonic            1152 sound/pci/sonicvibes.c 	tmp = sonic->mpu_switch;
sonic            1158 sound/pci/sonicvibes.c static void snd_sonicvibes_proc_init(struct sonicvibes *sonic)
sonic            1160 sound/pci/sonicvibes.c 	snd_card_ro_proc_new(sonic->card, "sonicvibes", sonic,
sonic            1172 sound/pci/sonicvibes.c static int snd_sonicvibes_create_gameport(struct sonicvibes *sonic)
sonic            1177 sound/pci/sonicvibes.c 	sonic->gameport = gp = gameport_allocate_port();
sonic            1179 sound/pci/sonicvibes.c 		dev_err(sonic->card->dev,
sonic            1185 sound/pci/sonicvibes.c 	gameport_set_phys(gp, "pci%s/gameport0", pci_name(sonic->pci));
sonic            1186 sound/pci/sonicvibes.c 	gameport_set_dev_parent(gp, &sonic->pci->dev);
sonic            1187 sound/pci/sonicvibes.c 	gp->io = sonic->game_port;
sonic            1191 sound/pci/sonicvibes.c 	err = snd_ctl_add(sonic->card,
sonic            1192 sound/pci/sonicvibes.c 		snd_ctl_new1(&snd_sonicvibes_game_control, sonic));
sonic            1199 sound/pci/sonicvibes.c static void snd_sonicvibes_free_gameport(struct sonicvibes *sonic)
sonic            1201 sound/pci/sonicvibes.c 	if (sonic->gameport) {
sonic            1202 sound/pci/sonicvibes.c 		gameport_unregister_port(sonic->gameport);
sonic            1203 sound/pci/sonicvibes.c 		sonic->gameport = NULL;
sonic            1207 sound/pci/sonicvibes.c static inline int snd_sonicvibes_create_gameport(struct sonicvibes *sonic) { return -ENOSYS; }
sonic            1208 sound/pci/sonicvibes.c static inline void snd_sonicvibes_free_gameport(struct sonicvibes *sonic) { }
sonic            1211 sound/pci/sonicvibes.c static int snd_sonicvibes_free(struct sonicvibes *sonic)
sonic            1213 sound/pci/sonicvibes.c 	snd_sonicvibes_free_gameport(sonic);
sonic            1214 sound/pci/sonicvibes.c 	pci_write_config_dword(sonic->pci, 0x40, sonic->dmaa_port);
sonic            1215 sound/pci/sonicvibes.c 	pci_write_config_dword(sonic->pci, 0x48, sonic->dmac_port);
sonic            1216 sound/pci/sonicvibes.c 	if (sonic->irq >= 0)
sonic            1217 sound/pci/sonicvibes.c 		free_irq(sonic->irq, sonic);
sonic            1218 sound/pci/sonicvibes.c 	release_and_free_resource(sonic->res_dmaa);
sonic            1219 sound/pci/sonicvibes.c 	release_and_free_resource(sonic->res_dmac);
sonic            1220 sound/pci/sonicvibes.c 	pci_release_regions(sonic->pci);
sonic            1221 sound/pci/sonicvibes.c 	pci_disable_device(sonic->pci);
sonic            1222 sound/pci/sonicvibes.c 	kfree(sonic);
sonic            1228 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = device->device_data;
sonic            1229 sound/pci/sonicvibes.c 	return snd_sonicvibes_free(sonic);
sonic            1238 sound/pci/sonicvibes.c 	struct sonicvibes *sonic;
sonic            1258 sound/pci/sonicvibes.c 	sonic = kzalloc(sizeof(*sonic), GFP_KERNEL);
sonic            1259 sound/pci/sonicvibes.c 	if (sonic == NULL) {
sonic            1263 sound/pci/sonicvibes.c 	spin_lock_init(&sonic->reg_lock);
sonic            1264 sound/pci/sonicvibes.c 	sonic->card = card;
sonic            1265 sound/pci/sonicvibes.c 	sonic->pci = pci;
sonic            1266 sound/pci/sonicvibes.c 	sonic->irq = -1;
sonic            1269 sound/pci/sonicvibes.c 		kfree(sonic);
sonic            1274 sound/pci/sonicvibes.c 	sonic->sb_port = pci_resource_start(pci, 0);
sonic            1275 sound/pci/sonicvibes.c 	sonic->enh_port = pci_resource_start(pci, 1);
sonic            1276 sound/pci/sonicvibes.c 	sonic->synth_port = pci_resource_start(pci, 2);
sonic            1277 sound/pci/sonicvibes.c 	sonic->midi_port = pci_resource_start(pci, 3);
sonic            1278 sound/pci/sonicvibes.c 	sonic->game_port = pci_resource_start(pci, 4);
sonic            1281 sound/pci/sonicvibes.c 			KBUILD_MODNAME, sonic)) {
sonic            1283 sound/pci/sonicvibes.c 		snd_sonicvibes_free(sonic);
sonic            1286 sound/pci/sonicvibes.c 	sonic->irq = pci->irq;
sonic            1310 sound/pci/sonicvibes.c 	if ((sonic->res_dmaa = request_region(dmaa, 0x10, "S3 SonicVibes DDMA-A")) == NULL) {
sonic            1311 sound/pci/sonicvibes.c 		snd_sonicvibes_free(sonic);
sonic            1317 sound/pci/sonicvibes.c 	if ((sonic->res_dmac = request_region(dmac, 0x10, "S3 SonicVibes DDMA-C")) == NULL) {
sonic            1318 sound/pci/sonicvibes.c 		snd_sonicvibes_free(sonic);
sonic            1325 sound/pci/sonicvibes.c 	pci_read_config_dword(pci, 0x40, &sonic->dmaa_port);
sonic            1326 sound/pci/sonicvibes.c 	pci_read_config_dword(pci, 0x48, &sonic->dmac_port);
sonic            1327 sound/pci/sonicvibes.c 	sonic->dmaa_port &= ~0x0f;
sonic            1328 sound/pci/sonicvibes.c 	sonic->dmac_port &= ~0x0f;
sonic            1329 sound/pci/sonicvibes.c 	pci_write_config_dword(pci, 0x40, sonic->dmaa_port | 9);	/* enable + enhanced */
sonic            1330 sound/pci/sonicvibes.c 	pci_write_config_dword(pci, 0x48, sonic->dmac_port | 9);	/* enable */
sonic            1332 sound/pci/sonicvibes.c 	outb(SV_RESET, SV_REG(sonic, CONTROL));		/* reset chip */
sonic            1334 sound/pci/sonicvibes.c 	outb(0, SV_REG(sonic, CONTROL));	/* release reset */
sonic            1336 sound/pci/sonicvibes.c 	outb(SV_ENHANCED | SV_INTA | (reverb ? SV_REVERB : 0), SV_REG(sonic, CONTROL));
sonic            1337 sound/pci/sonicvibes.c 	inb(SV_REG(sonic, STATUS));	/* clear IRQs */
sonic            1339 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_DRIVE_CTRL, 0);	/* drive current 16mA */
sonic            1341 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_DRIVE_CTRL, 0x40);	/* drive current 8mA */
sonic            1343 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_PC_ENABLE, sonic->enable = 0);	/* disable playback & capture */
sonic            1344 sound/pci/sonicvibes.c 	outb(sonic->irqmask = ~(SV_DMAA_MASK | SV_DMAC_MASK | SV_UD_MASK), SV_REG(sonic, IRQMASK));
sonic            1345 sound/pci/sonicvibes.c 	inb(SV_REG(sonic, STATUS));	/* clear IRQs */
sonic            1346 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_ADC_CLOCK, 0);	/* use PLL as clock source */
sonic            1347 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_ANALOG_POWER, 0);	/* power up analog parts */
sonic            1348 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_DIGITAL_POWER, 0);	/* power up digital parts */
sonic            1349 sound/pci/sonicvibes.c 	snd_sonicvibes_setpll(sonic, SV_IREG_ADC_PLL, 8000);
sonic            1350 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_SRS_SPACE, sonic->srs_space = 0x80);	/* SRS space off */
sonic            1351 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_SRS_CENTER, sonic->srs_center = 0x00);/* SRS center off */
sonic            1352 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_MPU401, sonic->mpu_switch = 0x05);	/* MPU-401 switch */
sonic            1353 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_WAVE_SOURCE, sonic->wave_source = 0x00);	/* onboard ROM */
sonic            1354 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_PCM_RATE_LOW, (8000 * 65536 / SV_FULLRATE) & 0xff);
sonic            1355 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_PCM_RATE_HIGH, ((8000 * 65536 / SV_FULLRATE) >> 8) & 0xff);
sonic            1356 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_LEFT_ADC, mge ? 0xd0 : 0xc0);
sonic            1357 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_RIGHT_ADC, 0xc0);
sonic            1358 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_LEFT_AUX1, 0x9f);
sonic            1359 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_RIGHT_AUX1, 0x9f);
sonic            1360 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_LEFT_CD, 0x9f);
sonic            1361 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_RIGHT_CD, 0x9f);
sonic            1362 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_LEFT_LINE, 0x9f);
sonic            1363 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_RIGHT_LINE, 0x9f);
sonic            1364 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_MIC, 0x8f);
sonic            1365 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_LEFT_SYNTH, 0x9f);
sonic            1366 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_RIGHT_SYNTH, 0x9f);
sonic            1367 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_LEFT_AUX2, 0x9f);
sonic            1368 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_RIGHT_AUX2, 0x9f);
sonic            1369 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_LEFT_ANALOG, 0x9f);
sonic            1370 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_RIGHT_ANALOG, 0x9f);
sonic            1371 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_LEFT_PCM, 0xbf);
sonic            1372 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_RIGHT_PCM, 0xbf);
sonic            1373 sound/pci/sonicvibes.c 	snd_sonicvibes_out(sonic, SV_IREG_ADC_OUTPUT_CTRL, 0xfc);
sonic            1375 sound/pci/sonicvibes.c 	snd_sonicvibes_debug(sonic);
sonic            1377 sound/pci/sonicvibes.c 	sonic->revision = snd_sonicvibes_in(sonic, SV_IREG_REVISION);
sonic            1379 sound/pci/sonicvibes.c 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, sonic, &ops)) < 0) {
sonic            1380 sound/pci/sonicvibes.c 		snd_sonicvibes_free(sonic);
sonic            1384 sound/pci/sonicvibes.c 	snd_sonicvibes_proc_init(sonic);
sonic            1386 sound/pci/sonicvibes.c 	*rsonic = sonic;
sonic            1404 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = mpu->private_data;
sonic            1405 sound/pci/sonicvibes.c 	outb(sonic->irqmask &= ~SV_MIDI_MASK, SV_REG(sonic, IRQMASK));
sonic            1411 sound/pci/sonicvibes.c 	struct sonicvibes *sonic = mpu->private_data;
sonic            1412 sound/pci/sonicvibes.c 	outb(sonic->irqmask |= SV_MIDI_MASK, SV_REG(sonic, IRQMASK));
sonic            1415 sound/pci/sonicvibes.c static int snd_sonicvibes_midi(struct sonicvibes *sonic,
sonic            1419 sound/pci/sonicvibes.c 	struct snd_card *card = sonic->card;
sonic            1423 sound/pci/sonicvibes.c 	mpu->private_data = sonic;
sonic            1427 sound/pci/sonicvibes.c 		if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_sonicvibes_midi_controls[idx], sonic))) < 0)
sonic            1437 sound/pci/sonicvibes.c 	struct sonicvibes *sonic;
sonic            1463 sound/pci/sonicvibes.c 					 &sonic)) < 0) {
sonic            1472 sound/pci/sonicvibes.c 		sonic->revision,
sonic            1474 sound/pci/sonicvibes.c 		sonic->irq);
sonic            1476 sound/pci/sonicvibes.c 	if ((err = snd_sonicvibes_pcm(sonic, 0)) < 0) {
sonic            1480 sound/pci/sonicvibes.c 	if ((err = snd_sonicvibes_mixer(sonic)) < 0) {
sonic            1485 sound/pci/sonicvibes.c 				       sonic->midi_port,
sonic            1492 sound/pci/sonicvibes.c 	snd_sonicvibes_midi(sonic, midi_uart);
sonic            1493 sound/pci/sonicvibes.c 	if ((err = snd_opl3_create(card, sonic->synth_port,
sonic            1494 sound/pci/sonicvibes.c 				   sonic->synth_port + 2,
sonic            1504 sound/pci/sonicvibes.c 	err = snd_sonicvibes_create_gameport(sonic);